diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/scripts/rpc/net.py | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/scripts/rpc/net.py')
-rw-r--r-- | src/spdk/scripts/rpc/net.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/spdk/scripts/rpc/net.py b/src/spdk/scripts/rpc/net.py new file mode 100644 index 000000000..7c479bba8 --- /dev/null +++ b/src/spdk/scripts/rpc/net.py @@ -0,0 +1,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') |