4d62a7cc1f
Change-Id: I137901db9ec2d8f2a85b8e22fc7005081fafb032 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468678 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
36 lines
983 B
Python
36 lines
983 B
Python
from .helpers import deprecated_alias
|
|
|
|
|
|
@deprecated_alias('add_ip_address')
|
|
def net_interface_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('net_interface_add_ip_address', params)
|
|
|
|
|
|
@deprecated_alias('delete_ip_address')
|
|
def net_interface_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('net_interface_delete_ip_address', params)
|
|
|
|
|
|
@deprecated_alias('get_interfaces')
|
|
def net_get_interfaces(client):
|
|
"""Display current interface list
|
|
|
|
Returns:
|
|
List of current interface
|
|
"""
|
|
return client.call('net_get_interfaces')
|