Provides a common set of operations for nfio. More...
Public Member Functions | |
def | __init__ |
def | vnfs_create_vnf_instance |
Create the file system structure for a VNF. More... | |
def | vnfs_get_opcode |
Determinse the type of operation based on the path. More... | |
def | vnfs_get_nf_type |
Parse the type of VNF from path. More... | |
def | vnfs_get_file_name |
Return the name of the file represented by a path. More... | |
def | vnfs_is_nf_instance |
Determines if a path represents an nf instance directory. More... | |
def | vnfs_get_instance_configuration |
Return the configuration parameters related to a VNF instance. More... | |
def | vnfs_deploy_nf |
Deploys and STARTS a VNF instance. More... | |
def | vnfs_stop_vnf |
Stops a VNF instance. More... | |
def | vnfs_start_vnf |
Starts a deployed VNF instance. More... | |
def | vnfs_destroy_vnf |
Destroys a deployed VNF instance. More... | |
def | vnfs_get_rx_bytes |
Reads the number of bytes received by a VNF instance. More... | |
def | vnfs_get_tx_bytes |
Reads the number of bytes sent by a VNF instance. More... | |
def | vnfs_get_pkt_drops |
Reads the number of packets dropped by a VNF instance. More... | |
def | vnfs_get_status |
Get the status of a VNF instance, e.g., the VNF is running/suspended/stopped etc. More... | |
def | vnfs_get_ip |
Get the status of a VNF instance, e.g., the VNF is running/suspended/stopped etc. More... | |
Public Attributes | |
vnfs_root | |
Static Public Attributes | |
int | OP_UNDEFINED = 0xFF |
int | OP_NF = 0x01 |
Provides a common set of operations for nfio.
These operations act as a helper.
Definition at line 25 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_create_vnf_instance | ( | self, | |
path, | |||
mode | |||
) |
Create the file system structure for a VNF.
Args: path: path of the new VNF instance. mode: file creation mode for the new VNF instance directory.
Returns: returns the return code of os.mkdir
Definition at line 52 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_deploy_nf | ( | self, | |
nf_path | |||
) |
Deploys and STARTS a VNF instance.
Args: nf_path: path of the VNF instance.
Definition at line 207 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_destroy_vnf | ( | self, | |
nf_path | |||
) |
Destroys a deployed VNF instance.
Args: nf_path: path of the VNF instance.
Returns: return codes are described in hypervisor.hypervisor_return_codes module.
Definition at line 278 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_file_name | ( | self, | |
path | |||
) |
Return the name of the file represented by a path.
Args: path: the path of the file in concern
Returns: returns the name of the file, i.e., last token after / in the path.
Definition at line 141 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_instance_configuration | ( | self, | |
nf_path | |||
) |
Return the configuration parameters related to a VNF instance.
Args: nf_path: path of the VNF instance. e.g., /mnt/vnfsmnt/firewall/fw-alpha
Returns: A tuple representing the configuration of the VNF instance. The tuple is organized in the following order: nf_instance_name: name of the VNF instance. nf_type: type of the VNF. ip_address: IP address of the machine where this VNF will be deployed. image_name: name of the VM/container image for that VNF.
Definition at line 184 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_ip | ( | self, | |
nf_path | |||
) |
Get the status of a VNF instance, e.g., the VNF is running/suspended/stopped etc.
Args: nf_path: path of the VNF instance.
Returns: Hypervisor specific status of the VNF. For example, if Docker is being used for VNF deployment then Docker specific container status message is returned.
Definition at line 390 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_nf_type | ( | self, | |
path | |||
) |
Parse the type of VNF from path.
Args: path: the path of the file/directory on which some operation is being performed.
Returns: Returns the type of VNF parsed from the path, e.g., if the path is /mnt/vnfsroot/nf-types/firewall/fw-alpha/action then returns firewall.
Definition at line 122 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_opcode | ( | self, | |
path | |||
) |
Determinse the type of operation based on the path.
Args: path: path to the file/directory on which the operation is being performed
Returns: If the file is under nf-types subdirectory in the nfio mount, then returns OP_NF. Otherwise, returns OP_UNDEFINED.
Definition at line 103 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_pkt_drops | ( | self, | |
nf_path | |||
) |
Reads the number of packets dropped by a VNF instance.
Args: nf_path: path of the VNF instance.
Returns: returns the number of packets dropped by a VNF instance.
Definition at line 339 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_rx_bytes | ( | self, | |
nf_path | |||
) |
Reads the number of bytes received by a VNF instance.
Args: nf_path: path of the VNF instance.
Returns: returns the number of bytes received by a VNF instance.
Definition at line 295 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_status | ( | self, | |
nf_path | |||
) |
Get the status of a VNF instance, e.g., the VNF is running/suspended/stopped etc.
Args: nf_path: path of the VNF instance.
Returns: Hypervisor specific status of the VNF. For example, if Docker is being used for VNF deployment then Docker specific container status message is returned.
Definition at line 364 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_get_tx_bytes | ( | self, | |
nf_path | |||
) |
Reads the number of bytes sent by a VNF instance.
Args: nf_path: path of the VNF instance.
Returns: returns the number of bytes sent by a VNF instance.
Definition at line 317 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_is_nf_instance | ( | self, | |
path | |||
) |
Determines if a path represents an nf instance directory.
Args: path: path of the file/directory in concern.
Returns: True: if path represents an nf instance directory. For example, if path is /mnt/vnfsmnt/nf-types/firewall/fw-alpha then returns True.
False: if the path does not represent an nf instance directory. For example, if path is /mnt/vnfsmnt/nf-types/firewall/fw-alpha/action then returns False.
Definition at line 160 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_start_vnf | ( | self, | |
nf_path | |||
) |
Starts a deployed VNF instance.
Args: nf_path: path of the VNF instance.
Returns: return codes are described in hypervisor.hypervisor_return_codes module.
Definition at line 260 of file vnfs_operations.py.
def vnfs_operations.VNFSOperations.vnfs_stop_vnf | ( | self, | |
nf_path | |||
) |
Stops a VNF instance.
Args: nf_path: path of the VNF instance.
Definition at line 242 of file vnfs_operations.py.