2019-09-18 08:53:32 +00:00
|
|
|
from .helpers import deprecated_alias
|
|
|
|
|
|
|
|
|
|
|
|
@deprecated_alias('add_ip_address')
|
|
|
|
def net_interface_add_ip_address(client, ifc_index, ip_addr):
|
2018-07-18 08:48:24 +00:00
|
|
|
"""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}
|
2019-09-18 08:53:32 +00:00
|
|
|
return client.call('net_interface_add_ip_address', params)
|
2017-06-06 21:22:03 +00:00
|
|
|
|
|
|
|
|
2019-09-18 09:00:43 +00:00
|
|
|
@deprecated_alias('delete_ip_address')
|
|
|
|
def net_interface_delete_ip_address(client, ifc_index, ip_addr):
|
2018-07-18 08:48:24 +00:00
|
|
|
"""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}
|
2019-09-18 09:00:43 +00:00
|
|
|
return client.call('net_interface_delete_ip_address', params)
|
2017-06-06 21:22:03 +00:00
|
|
|
|
|
|
|
|
2019-09-18 09:07:01 +00:00
|
|
|
@deprecated_alias('get_interfaces')
|
|
|
|
def net_get_interfaces(client):
|
2018-07-18 08:48:24 +00:00
|
|
|
"""Display current interface list
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
List of current interface
|
|
|
|
"""
|
2019-09-18 09:07:01 +00:00
|
|
|
return client.call('net_get_interfaces')
|