summaryrefslogtreecommitdiffstats
path: root/src/spdk/scripts/rpc/net.py
blob: 7c479bba8d980c2d6710e688c229463c758e1eb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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')