Spdk/scripts/rpc/net.py
heluwei 66a91a0498 scripts/rpc.py: pass named args to log.py and net.py
Change-Id: I299b147a644f19d63f4e3d9acc431367e6849f65
Signed-off-by: heluwei <simple_hlw@163.com>
Reviewed-on: https://review.gerrithub.io/419637
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-08-03 07:25:10 +00:00

30 lines
768 B
Python
Executable File

def add_ip_address(client, ifc_index, ip_addr):
"""Add IP address.
Args:
ifc_index: ifc index of the nic device (int)
ip_addr: ip address will be added
"""
params = {'ifc_index': ifc_index, 'ip_address': ip_addr}
return client.call('add_ip_address', params)
def delete_ip_address(client, ifc_index, ip_addr):
"""Delete IP address.
Args:
ifc_index: ifc index of the nic device (int)
ip_addr: ip address will be deleted
"""
params = {'ifc_index': ifc_index, 'ip_address': ip_addr}
return client.call('delete_ip_address', params)
def get_interfaces(client):
"""Display current interface list
Returns:
List of current interface
"""
return client.call('get_interfaces')