node

Methods to work with FABRIC nodes.

You would add a node and operate on it like so:

from fabrictestbed_extensions.fablib.fablib import FablibManager

fablib = FablibManager()

slice = fablib.new_slice(name="MySlice")
node = slice.add_node(name="node1")
slice.submit();

node.execute('echo Hello, FABRIC from node `hostname -s`')

slice.delete()
class fabrictestbed_extensions.fablib.node.Node(slice: Slice, node: FimNode)

Node constructor, usually invoked by Slice.add_node().

Parameters:
  • slice (Slice) – the fablib slice to have this node on

  • node (Node) – the FIM node that this Node represents

__str__()

Creates a tabulated string describing the properties of the node.

Intended for printing node information.

Returns:

Tabulated string of node information

Return type:

String

add_component(model: str | None = None, name: str | None = None, user_data: dict = {}) Component

Creates a new FABRIC component using this fablib node. Example models include:

  • NIC_Basic: A single port 100 Gbps SR-IOV Virtual Function on a Mellanox ConnectX-6

  • NIC_ConnectX_5: A dual port 25 Gbps Mellanox ConnectX-5

  • NIC_ConnectX_6: A dual port 100 Gbps Mellanox ConnectX-6

  • NVME_P4510: NVMe Storage Device

  • GPU_TeslaT4: Tesla T4 GPU

  • GPU_RTX6000: RTX6000 GPU

  • GPU_A30: A30 GPU

  • GPU_A40: A40 GPU

  • FPGA_Xilinx_U280: Xilinx U280 GPU

Parameters:
  • model (String) – the name of the component model to add

  • name (String) – the name of the new component

Returns:

the new component

Return type:

Component

add_fabnet(name='FABNET', net_type='IPv4', nic_type='NIC_Basic', routes=None)

Add a simple layer 3 network to this node.

Parameters:
  • name – a name for the network. Default is "FABNET".

  • net_type – Network type, "IPv4" or "IPv6".

  • nic_type – a NIC type. Default is "NIC_Basic".

  • routes – a list of routes to add. Default is None.

add_post_boot_execute(command: str)

Execute a command on the node after boot.

Parameters:

command (str) – command to be executed on the node.

add_post_boot_upload_directory(local_directory_path: str, remote_directory_path: str = '.')

Upload a directory to the node after boot.

Parameters:
  • local_directory_path (str) – local directory.

  • remote_directory_path (str) – directory on the node.

add_post_boot_upload_file(local_file_path: str, remote_file_path: str = '.')

Upload a file to the node after boot.

Parameters:
  • local_file_path (str) – path to file on local filesystem.

  • remote_file_path (str) – path to file on the node.

add_post_update_command(command: str)

Run a command after boot.

add_public_key(*, sliver_key_name: str | None = None, email: str | None = None, sliver_public_key: str | None = None)

Add public key to a node; - Adds user’s portal public key identified by sliver_key_name to the node - Adds portal public key identified by sliver_key_name for a user identified by email to the node - Add public key from the sliver_public_key to the node

Parameters:
  • sliver_key_name (str) – Sliver Key Name on the Portal

  • email (str) – Email

  • sliver_public_key (str) – Public sliver key

:raises Exception in case of errors

add_route(subnet: IPv4Network, next_hop: IPv4Address)

Add a route.

Parameters:

subnet – an IPv4 or IPv6 address.

:type subnet:IPv4Network or IPv6Network.

Parameters:

next_hop (IPv4Address or IPv6Address or NetworkService.) – a gateway address (IPv4Address or IPv6Address) or a NetworkService.

add_storage(name: str, auto_mount: bool = False) Component

Creates a new FABRIC Storage component and attaches it to the Node

Parameters:
  • name – Name of the Storage volume created for the project outside the scope of the Slice

  • auto_mount – Mount the storage volume

Return type:

Component

add_vlan_os_interface(os_iface: str | None = None, vlan: str | None = None, ip: str | None = None, cidr: str | None = None, mtu: str | None = None, interface: str | None = None)

Deprecated since version 1.1.3..

clear_all_ifaces()

Flush all interfaces and delete VLAN os interfaces

config(log_dir='.')

Run configuration tasks for this node.

Note

Use this method in order to re-apply configuration to a rebooted node. Normally this method is invoked by Slice.submit() or Slice.modify().

Configuration tasks include:

  • Setting hostname.

  • Configuring interfaces.

  • Configuring routes.

  • Running post-boot tasks added by add_post_boot_execute(), add_post_boot_upload_file(), and add_post_boot_upload_directory().

  • Running post-update commands added by add_post_update_command().

download_directory(local_directory_path: str, remote_directory_path: str, retry: int = 3, retry_interval: int = 10)

Downloads a directory from remote location on the node. Makes a gzipped tarball of a directory and downloads it from a node. Then unzips and tars the directory at the local_directory_path

Parameters:
  • local_directory_path (str) – the path to the directory to upload

  • remote_directory_path (str) – the destination path of the directory on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Raises:

Exception – if management IP is invalid

download_directory_thread(local_directory_path: str, remote_directory_path: str, retry: int = 3, retry_interval: int = 10)

Creates a thread that calls node.download_directory. Results from the thread can be retrieved with by calling thread.result()

Parameters:
  • local_directory_path (str) – the path to the directory to upload

  • remote_directory_path (str) – the destination path of the directory on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Raises:

Exception – if management IP is invalid

download_file(local_file_path: str, remote_file_path: str, retry: int = 3, retry_interval: int = 10)

Download a remote file from the node to a local destination.

Parameters:
  • local_file_path (str) – the destination path for the remote file

  • remote_file_path (str) – the path to the remote file to download

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP upon failure

download_file_thread(local_file_path: str, remote_file_path: str, retry: int = 3, retry_interval: int = 10)

Creates a thread that calls node.download_file(). Results from the thread can be retrieved with by calling thread.result()

Parameters:
  • local_file_path (str) – the destination path for the remote file

  • remote_file_path (str) – the path to the remote file to download

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP upon failure

Returns:

a thread that called node.download_file()

Return type:

Thread

Raises:

Exception – if management IP is invalid

execute(command: str, retry: int = 3, retry_interval: int = 10, username: str | None = None, private_key_file: str | None = None, private_key_passphrase: str | None = None, quiet: bool = False, read_timeout: int = 10, timeout=None, output_file: str | None = None)

Runs a command on the FABRIC node.

The function uses paramiko to ssh to the FABRIC node and execute an arbitrary shell command.

Parameters:
  • command (str) – the command to run

  • retry (int) – the number of times to retry SSH upon failure

  • retry_interval (int) – the number of seconds to wait before retrying SSH upon failure

  • username (str) – username

  • private_key_file (str) – path to private key file

  • private_key_passphrase (str) – pass phrase

  • output_file (List[str]) – path to a file where the stdout/stderr will be written. None for no file output

  • output (bool) – print stdout and stderr to the screen

  • read_timeout (int) – the number of seconds to wait before retrying to read from stdout and stderr

  • timeout (int) – the number of seconds to wait before terminating the command using the linux timeout command. Specifying a timeout encapsulates the command with the timeout command for you

Returns:

a tuple of (stdout[Sting],stderr[String])

Return type:

Tuple

Raises:

Exception – if management IP is invalid

execute_thread(command: str, retry: int = 3, retry_interval: int = 10, username: str | None = None, private_key_file: str | None = None, private_key_passphrase: str | None = None, output_file: str | None = None) Thread

Creates a thread that calls node.execute(). Results (i.e. stdout, stderr) from the thread can be retrieved with by calling thread.result()

Parameters:
  • command (str) – the command to run

  • retry (int) – the number of times to retry SSH upon failure

  • retry_interval (int) – the number of seconds to wait before retrying SSH upon failure

  • username (str) – username

  • private_key_file (str) – path to private key file

  • private_key_passphrase (str) – pass phrase

  • output_file (List[str]) – path to a file where the stdout/stderr will be written. None for no file output

Returns:

a thread that called node.execute()

Raises:

Exception – if management IP is invalid

flush_all_os_interfaces()

Flushes the configuration of all dataplane interfaces in the node.

flush_os_interface(os_iface: str)

Flush the configuration of an interface in the node

Parameters:

os_iface (String) – the name of the interface to flush

get_component(name: str) Component

Gets a particular component associated with this node.

Parameters:

name (String) – the name of the component to search for

Raises:

Exception – if component not found by name

Returns:

the component on the FABRIC node

Return type:

Component

get_components() List[Component]

Gets a list of components associated with this node.

Returns:

a list of components on this node

Return type:

List[Component]

get_cores() int

Gets the number of cores on the FABRIC node.

Returns:

the number of cores on the node

Return type:

int

get_cpu_info() dict

Get CPU Information for the Node and the host on which the VM is running

Returns:

cpu info dict

get_dataplane_os_interfaces() List[dict]

Gets a list of all the dataplane interface names used by the node’s operating system.

Returns:

interface names

Return type:

List[String]

get_disk() int

Gets the amount of disk space on the FABRIC node.

Returns:

the amount of disk space on the node

Return type:

int

get_error_message() str

Gets the error message on the FABRIC node.

Returns:

the error message on the node

Return type:

String

get_fim_node() Node

Not recommended for most users.

Gets the node’s FABRIC Information Model (fim) object. This method is used to access data at a lower level than FABlib.

Returns:

the FABRIC model node

Return type:

FIMNode

get_host() str

Gets the hostname on the FABRIC node.

Returns:

the hostname on the node

Return type:

String

get_image() str

Gets the image reference on the FABRIC node.

Returns:

the image reference on the node

Return type:

String

get_image_type() str

Gets the image type on the FABRIC node.

Returns:

the image type on the node

Return type:

String

get_instance_name() str

Gets the instance name of the FABRIC node.

Returns:

the instance name of the node

Return type:

String

get_interface(name: str | None = None, network_name: str | None = None) Interface

Gets a particular interface associated with a FABRIC node. Accepts either the interface name or a network_name. If a network name is used this method will return the interface on the node that is connected to the network specified. If a name and network_name are both used, the interface name will take precedence.

Parameters:
  • name (str) – interface name to search for

  • network_name – network name to search for

Raises:

Exception – if interface is not found

Returns:

an interface on the node

Return type:

Interface

get_interfaces() List[Interface]

Gets a list of the interfaces associated with the FABRIC node.

Returns:

a list of interfaces on the node

Return type:

List[Interface]

get_ip_addrs()

Get a list of ip address info from the node.

get_ip_routes()

Get a list of routes from the node.

get_management_ip() str

Gets the management IP on the FABRIC node.

Returns:

management IP

Return type:

String

get_management_os_interface() str

Gets the name of the management interface used by the node’s operating system.

Returns:

interface name

Return type:

String

get_name() str

Gets the name of the FABRIC node.

Returns:

the name of the node

Return type:

String

static get_node(slice: Slice = None, node=None)

Returns a new fablib node using existing FABRIC resources.

Note:

Not intended for API call.

Parameters:
  • slice (Slice) – the fablib slice storing the existing node

  • node (Node) – the FIM node stored in this fablib node

Returns:

a new fablib node storing resources

Return type:

Node

get_numa_info() dict

Get Numa Information for the Node and the host on which the VM is running

Returns:

numa info dict

get_post_update_commands()

Get the list of commands that are to be run after boot.

get_private_key() str

Gets the private key on the fablib node.

Important! Slice key management is underdevelopment and this functionality will likely change going forward.

Returns:

the private key on the node

Return type:

String

get_private_key_file() str

Gets the private key file path on the fablib slice.

Important! Slice key management is underdevelopment and this functionality will likely change going forward.

Returns:

the private key path

Return type:

String

get_private_key_passphrase() str

Gets the private key passphrase on the FABLIB slice.

Important! Slice key management is underdevelopment and this functionality will likely change going forward.

Returns:

the private key passphrase

Return type:

String

get_public_key() str

Gets the public key on fablib node.

Important! Slice key management is underdevelopment and this functionality will likely change going forward.

Returns:

the public key on the node

Return type:

String

get_public_key_file() str

Gets the public key file path on the fablib node.

Important! Slice key management is underdevelopment and this functionality will likely change going forward.

Returns:

the public key path

Return type:

String

get_ram() int

Gets the amount of RAM on the FABRIC node.

Returns:

the amount of RAM on the node

Return type:

int

get_reservation_id() str

Gets the reservation ID on the FABRIC node.

Returns:

reservation ID on the node

Return type:

String

get_reservation_state() str

Gets the reservation state on the FABRIC node.

Returns:

the reservation state on the node

Return type:

String

get_site() str

Gets the sitename on the FABRIC node.

Returns:

the sitename on the node

Return type:

String

get_slice() Slice

Gets the fablib slice associated with this node.

Returns:

the fablib slice on this node

Return type:

Slice

get_sliver() OrchestratorSliver

Gets the node SM sliver.

Note:

Not intended as API call.

Returns:

SM sliver for the node

Return type:

Sliver

get_ssh_command() str

Gets an SSH command used to access this node from a terminal.

Returns:

the SSH command to access this node

Return type:

str

get_storage(name: str) Component

Gets a particular storage associated with this node.

Parameters:

name (String) – the name of the storage

Raises:

Exception – if storage not found by name

Returns:

the storage on the FABRIC node

Return type:

Component

get_username() str

Gets the username on this fablib node.

Returns:

the username on this node

Return type:

String

ip_addr_add(addr: IPv4Address | IPv6Address, subnet: IPv4Network | IPv6Network, interface: Interface)

Add an IP to an interface on the node.

Parameters:
  • addr (IPv4Address or IPv6Address) – IP address

  • subnet (IPv4Network or IPv6Network) – subnet.

  • interface (Interface) – the FABlib interface.

ip_addr_del(addr: IPv4Address | IPv6Address, subnet: IPv4Network | IPv6Network, interface: Interface)

Delete an IP to an interface on the node.

Parameters:
  • addr (IPv4Address or IPv6Address) – IP address

  • subnet (IPv4Network or IPv6Network) – subnet.

  • interface (Interface) – the FABlib interface.

ip_addr_list(output='json', update=False)

Return the list of IP addresses assciated with this node.

Parameters:
  • output – Output format; "json" by default.

  • update – Setting this to True will force-update the cached list of IP addresses; default is False.

Returns:

When output is set to "json" (which is the default), the result of running ip -j[son] addr list, converted to a Python object. Otherwise the result of ip addr list.

Bring down a link on an interface on the node.

Parameters:
  • subnet (IPv4Network or IPv6Network) – subnet.

  • interface (Interface) – the FABlib interface.

Bring up a link on an interface on the node.

Parameters:
  • subnet (IPv4Network or IPv6Network) – subnet.

  • interface (Interface) – the FABlib interface.

ip_route_add(subnet: IPv4Network | IPv6Network, gateway: IPv4Address | IPv6Address)

Add a route on the node.

Parameters:
  • subnet (IPv4Network or IPv6Network) – The destination subnet

  • gateway (IPv4Address or IPv6Address) – The next hop gateway.

ip_route_del(subnet: IPv4Network | IPv6Network, gateway: IPv4Address | IPv6Address)

Delete a route on the node.

Parameters:
  • subnet (IPv4Network or IPv6Network) – The destination subnet

  • gateway (IPv4Address or IPv6Address) – The next hop gateway.

list_components(fields=None, output=None, quiet=False, filter_function=None, pretty_names=True)

Lists all the components in the node with their attributes.

There are several output options: "text", "pandas", and "json" that determine the format of the output that is returned and (optionally) displayed/printed.

Parameters:
  • output (str) –

    output format. Output can be one of:

    • "text": string formatted with tabular

    • "pandas": pandas dataframe

    • "json": string in json format

  • fields (List[str]) – list of fields (table columns) to show. JSON output will include all available fields/columns.

  • quiet (bool) – True to specify printing/display

  • filter_function (lambda) – A lambda function to filter data by field values.

Returns:

table in format specified by output parameter

Return type:

Object

Here’s an example of fields:

fields=['Name','Model']

Here’s an example of filter_function:

filter_function=lambda s: s['Model'] == 'NIC_Basic'
list_interfaces(fields=None, output=None, quiet=False, filter_function=None, pretty_names=True)

Lists all the interfaces in the node with their attributes.

There are several output options: "text", "pandas", and "json" that determine the format of the output that is returned and (optionally) displayed/printed.

Parameters:
  • output (str) –

    Output format. Options are:

    • "text": string formatted with tabular

    • "pandas": pandas dataframe

    • "json": string in json format

  • fields (List[str]) – List of fields (table columns) to show. JSON output will include all available fields/columns.

  • quiet (bool) – True to specify printing/display

  • filter_function (lambda) – A lambda function to filter data by field values.

Returns:

table in format specified by output parameter

Return type:

Object

Example of fields:

fields=['Name','MAC']

Example of filter_function:

filter_function=lambda s: s['Node'] == 'Node1'
list_networks(fields=None, output=None, quiet=False, filter_function=None, pretty_names=True)

Lists all the networks attached to the nodes with their attributes.

There are several output options: "text", "pandas", and "json" that determine the format of the output that is returned and (optionally) displayed/printed.

Parameters:
  • output (str) –

    Output format. Options are:

    • "text": string formatted with tabular

    • "pandas": pandas dataframe

    • "json": string in JSON format

  • fields (List[str]) – List of fields (table columns) to show. JSON output will include all available fields/columns.

  • quiet (bool) – True to specify printing/display

  • filter_function (lambda) – A lambda function to filter data by field values.

  • pretty_names (bool) – Use “nicer” names in column headers. Default is True.

Returns:

table in format specified by output parameter

Return type:

Object

Example of fields:

fields=['Name','Type']

Example of filter_function:

filter_function=lambda s: s['Type'] == 'FABNetv4'
network_manager_start()

(re)Start network manager on the node.

network_manager_stop()

Stop network manager on the node.

static new_node(slice: Slice = None, name: str = None, site: str = None, avoid: List[str] = [])

Not intended for API call. See: Slice.add_node()

Creates a new FABRIC node and returns a fablib node with the new node.

Parameters:
  • slice (Slice) – the fablib slice to build the new node on

  • name (str) – the name of the new node

  • site (str) – the name of the site to build the node on

  • avoid (List[str]) – a list of node names to avoid

Returns:

a new fablib node

Return type:

Node

numa_tune()

Pin the memory for the VM to the numa node associated with the components

os_reboot()

Reboot the node.

pin_cpu(component_name: str, cpu_range_to_pin: str | None = None)

Pin the cpus for the VM to the numa node associated with the component.

Parameters:
  • component_name – Component Name

  • cpu_range_to_pin – range of the cpus to pin; example: 0-1 or 0

ping_test(dst_ip: str) bool

Test a ping from the node to a destination IP

Parameters:

dst_ip (String) – destination IP String.

poa(operation: str, vcpu_cpu_map: List[Dict[str, str]] | None = None, node_set: List[str] | None = None, keys: List[Dict[str, str]] | None = None) Dict | str

Perform operation action on a VM; an action which is triggered by CF via the Aggregate

Parameters:
  • operation – operation to be performed

  • vcpu_cpu_map – map virtual cpu to host cpu map

  • node_set – list of numa nodes

  • keys – list of ssh keys

Raises:

Exception – in case of failure

Returns:

State of POA or Dictionary containing the info, in case of INFO POAs

post_boot_tasks()

Get the list of tasks to be performed on this node after boot.

remove_all_vlan_os_interfaces()

Delete all VLAN os interfaces

remove_public_key(*, sliver_key_name: str | None = None, email: str | None = None, sliver_public_key: str | None = None)

Remove public key to a node; - Remove user’s portal public key identified by sliver_key_name to the node - Remove portal public key identified by sliver_key_name for a user identified by email to the node - Remove public key from the sliver_public_key to the node

Parameters:
  • sliver_key_name (str) – Sliver Key Name on the Portal

  • email (str) – Email

  • sliver_public_key (str) – Public sliver key

:raises Exception in case of errors

remove_vlan_os_interface(os_iface: str | None = None)

Remove one VLAN OS interface

set_capacities(cores: int = 2, ram: int = 2, disk: int = 10)

Sets the capacities of the FABRIC node.

Parameters:
  • cores (int) – the number of cores to set on this node

  • ram (int) – the amount of RAM to set on this node

  • disk (int) – the amount of disk space to set on this node

set_host(host_name: str | None = None)

Sets the hostname of this fablib node on the FABRIC node.

Parameters:

host_name (String) – the hostname. example: host_name=’renc-w2.fabric-testbed.net’

set_image(image: str, username: str | None = None, image_type: str = 'qcow2')

Sets the image information of this fablib node on the FABRIC node.

Parameters:
  • image (String) – the image reference to set

  • username (String) – the username of this fablib node. Currently unused.

  • image_type (String) – the image type to set

set_instance_type(instance_type: str)

Sets the instance type of this fablib node on the FABRIC node.

Parameters:

instance_type (String) – the name of the instance type to set

set_ip_os_interface(os_iface: str | None = None, vlan: str | None = None, ip: str | None = None, cidr: str | None = None, mtu: str | None = None)

Deprecated since version 1.1.3..

set_site(site)

Sets the site of this fablib node on FABRIC.

Parameters:

site – the site

set_username(username: str | None = None)

Sets this fablib node’s username

Note:

Not intended as an API call.

Parameters:

username – Optional username parameter. The username likely should be picked to match the image type.

show(fields=None, output=None, quiet=False, colors=False, pretty_names=True)

Show a table containing the current node attributes.

There are several output options: "text", "pandas", and "json" that determine the format of the output that is returned and (optionally) displayed/printed.

Parameters:
  • output (str) –

    output format. Options are:

    • "text": string formatted with tabular

    • "pandas": pandas dataframe

    • "json": string in json format

  • fields (List[str]) – List of fields to show. JSON output will include all available fields.

  • quiet (bool) – True to specify printing/display

  • colors (bool) – True to specify state colors for pandas output

Returns:

table in format specified by output parameter

Return type:

Object

Here’s an example of fields:

fields=['Name','State']
test_ssh() bool

Test whether SSH is functional on the node.

Returns:

true if SSH is working, false otherwise

Return type:

bool

toDict(skip=[])

Returns the node attributes as a dictionary

Returns:

slice attributes as dictionary

Return type:

dict

toJson()

Returns the node attributes as a JSON string

Returns:

slice attributes as JSON string

Return type:

str

un_manage_interface(interface: Interface)

Mark an interface unmanaged by Network Manager;

This is needed to be run on rocky* images to avoid the network configuration from being overwritten by NetworkManager

Parameters:

interface (Interface) – the FABlib interface.

upload_directory(local_directory_path: str, remote_directory_path: str, retry: int = 3, retry_interval: int = 10)

Upload a directory to remote location on the node.

Makes a gzipped tarball of a directory and uploads it to a node. Then unzips and untars the directory at the remote_directory_path.

Parameters:
  • local_directory_path (str) – the path to the directory to upload

  • remote_directory_path (str) – the destination path of the directory on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Raises:

Exception – if management IP is invalid

upload_directory_thread(local_directory_path: str, remote_directory_path: str, retry: int = 3, retry_interval: int = 10)

Creates a thread that calls Node.upload_directory().

Results from the thread can be retrieved with by calling thread.result().

Parameters:
  • local_directory_path (str) – the path to the directory to upload

  • remote_directory_path (str) – the destination path of the directory on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Returns:

a thread that called node.upload_directory()

Return type:

Thread

Raises:

Exception – if management IP is invalid

upload_file(local_file_path: str, remote_file_path: str = '.', retry: int = 3, retry_interval: int = 10)

Upload a local file to a remote location on the node.

Parameters:
  • local_file_path (str) – the path to the file to upload

  • remote_file_path (str) – the destination path of the file on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Raises:

Exception – if management IP is invalid

upload_file_thread(local_file_path: str, remote_file_path: str = '.', retry: int = 3, retry_interval: int = 10)

Creates a thread that calls node.upload_file().

Results from the thread can be retrieved with by calling thread.result().

Parameters:
  • local_file_path (str) – the path to the file to upload

  • remote_file_path (str) – the destination path of the file on the node

  • retry (int) – how many times to retry SCP upon failure

  • retry_interval (int) – how often to retry SCP on failure

Returns:

a thread that called node.execute()

Return type:

Thread

Raises:

Exception – if management IP is invalid

validIPAddress(IP: str) str

Checks if the IP string is a valid IP address.

Parameters:

IP (String) – the IP string to check

Returns:

the type of IP address the IP string is, or ‘Invalid’

Return type:

String