- '''Obtain tenant networks of VIM
- Filter_dict can be:
- name: network name
- id: network uuid
- shared: boolean
- tenant_id: tenant
- admin_state_up: boolean
- status: 'ACTIVE'
- Returns the network list of dictionaries
- '''
- raise NotImplementedError( "Should have implemented this" )
-
- def get_tenant_network(self, net_id, tenant_id=None):
- '''Obtain tenant networks of VIM'''
- '''Returns the network information from a network id'''
- raise NotImplementedError( "Should have implemented this" )
-
- def delete_tenant_network(self, net_id):
- '''Deletes a tenant network from VIM'''
- '''Returns the network identifier'''
- raise NotImplementedError( "Should have implemented this" )
-
- def refresh_tenant_network(self, net_id):
- '''Refreshes the status of the tenant network'''
- '''Returns: 0 if no error,
- <0 if error'''
- raise NotImplementedError( "Should have implemented this" )
-
- def get_tenant_flavor(self, flavor_id):
- '''Obtain flavor details from the VIM
- Returns the flavor dict details
- '''
- raise NotImplementedError( "Should have implemented this" )
-
- def new_tenant_flavor(self, flavor_data):
- '''Adds a tenant flavor to VIM'''
- '''Returns the flavor identifier'''
- raise NotImplementedError( "Should have implemented this" )
-
- def delete_tenant_flavor(self,flavor_id):
- '''Deletes a tenant flavor from VIM'''
- '''Returns the HTTP response code and a message indicating details of the success or fail'''
- raise NotImplementedError( "Should have implemented this" )
-
- def new_tenant_image(self,image_dict):
- '''
- Adds a tenant image to VIM
- Returns:
- 200, image-id if the image is created
- <0, message if there is an error
- '''
- raise NotImplementedError( "Should have implemented this" )
-
- def delete_tenant_image(self, image_id):
- '''Deletes a tenant image from VIM'''
- '''Returns the HTTP response code and a message indicating details of the success or fail'''
- raise NotImplementedError( "Should have implemented this" )
+ """Obtain tenant networks of VIM
+ Params:
+ 'filter_dict' (optional) contains entries to return only networks that matches ALL entries:
+ name: string => returns only networks with this name
+ id: string => returns networks with this VIM id, this imply returns one network at most
+ shared: boolean >= returns only networks that are (or are not) shared
+ tenant_id: sting => returns only networks that belong to this tenant/project
+ ,#(not used yet) admin_state_up: boolean => returns only networks that are (or are not) in admin state active
+ #(not used yet) status: 'ACTIVE','ERROR',... => filter networks that are on this status
+ Returns the network list of dictionaries. each dictionary contains:
+ 'id': (mandatory) VIM network id
+ 'name': (mandatory) VIM network name
+ 'status': (mandatory) can be 'ACTIVE', 'INACTIVE', 'DOWN', 'BUILD', 'ERROR', 'VIM_ERROR', 'OTHER'
+ 'network_type': (optional) can be 'vxlan', 'vlan' or 'flat'
+ 'segmentation_id': (optional) in case network_type is vlan or vxlan this field contains the segmentation id
+ 'error_msg': (optional) text that explains the ERROR status
+ other VIM specific fields: (optional) whenever possible using the same naming of filter_dict param
+ List can be empty if no network map the filter_dict. Raise an exception only upon VIM connectivity,
+ authorization, or some other unspecific error
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def get_network(self, net_id):
+ """Obtain network details from the 'net_id' VIM network
+ Return a dict that contains:
+ 'id': (mandatory) VIM network id, that is, net_id
+ 'name': (mandatory) VIM network name
+ 'status': (mandatory) can be 'ACTIVE', 'INACTIVE', 'DOWN', 'BUILD', 'ERROR', 'VIM_ERROR', 'OTHER'
+ 'error_msg': (optional) text that explains the ERROR status
+ other VIM specific fields: (optional) whenever possible using the same naming of filter_dict param
+ Raises an exception upon error or when network is not found
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def delete_network(self, net_id):
+ """Deletes a tenant network from VIM
+ Returns the network identifier or raises an exception upon error or when network is not found
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def refresh_nets_status(self, net_list):
+ """Get the status of the networks
+ Params:
+ 'net_list': a list with the VIM network id to be get the status
+ Returns a dictionary with:
+ 'net_id': #VIM id of this network
+ status: #Mandatory. Text with one of:
+ # DELETED (not found at vim)
+ # VIM_ERROR (Cannot connect to VIM, authentication problems, VIM response error, ...)
+ # OTHER (Vim reported other status not understood)
+ # ERROR (VIM indicates an ERROR status)
+ # ACTIVE, INACTIVE, DOWN (admin down),
+ # BUILD (on building process)
+ error_msg: #Text with VIM error message, if any. Or the VIM connection ERROR
+ vim_info: #Text with plain information obtained from vim (yaml.safe_dump)
+ 'net_id2': ...
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def get_flavor(self, flavor_id):
+ """Obtain flavor details from the VIM
+ Returns the flavor dict details {'id':<>, 'name':<>, other vim specific }
+ Raises an exception upon error or if not found
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def get_flavor_id_from_data(self, flavor_dict):
+ """Obtain flavor id that match the flavor description
+ Params:
+ 'flavor_dict': dictionary that contains:
+ 'disk': main hard disk in GB
+ 'ram': meomry in MB
+ 'vcpus': number of virtual cpus
+ #TODO: complete parameters for EPA
+ Returns the flavor_id or raises a vimconnNotFoundException
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def new_flavor(self, flavor_data):
+ """Adds a tenant flavor to VIM
+ flavor_data contains a dictionary with information, keys:
+ name: flavor name
+ ram: memory (cloud type) in MBytes
+ vpcus: cpus (cloud type)
+ extended: EPA parameters
+ - numas: #items requested in same NUMA
+ memory: number of 1G huge pages memory
+ paired-threads|cores|threads: number of paired hyperthreads, complete cores OR individual threads
+ interfaces: # passthrough(PT) or SRIOV interfaces attached to this numa
+ - name: interface name
+ dedicated: yes|no|yes:sriov; for PT, SRIOV or only one SRIOV for the physical NIC
+ bandwidth: X Gbps; requested guarantee bandwidth
+ vpci: requested virtual PCI address
+ disk: disk size
+ is_public:
+ #TODO to concrete
+ Returns the flavor identifier"""
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def delete_flavor(self, flavor_id):
+ """Deletes a tenant flavor from VIM identify by its id
+ Returns the used id or raise an exception"""
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def new_image(self, image_dict):
+ """ Adds a tenant image to VIM
+ Returns the image id or raises an exception if failed
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def delete_image(self, image_id):
+ """Deletes a tenant image from VIM
+ Returns the image_id if image is deleted or raises an exception on error"""
+ raise vimconnNotImplemented( "Should have implemented this" )
+
+ def get_image_id_from_path(self, path):
+ """Get the image id from image path in the VIM database.
+ Returns the image_id or raises a vimconnNotFoundException
+ """
+ raise vimconnNotImplemented( "Should have implemented this" )