X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=vimconn.py;h=cd529de82d211dc51089ab1ce119b3497c14eda4;hb=ed1be4b1591c258748261f21947dc388c28c6fd9;hp=7e82590d4984fd6549a5bbcb720d62a7fad4638b;hpb=9f8456e62b915ecad8424a2ccfd734db8e777fc9;p=osm%2FRO.git diff --git a/vimconn.py b/vimconn.py index 7e82590d..cd529de8 100644 --- a/vimconn.py +++ b/vimconn.py @@ -82,7 +82,7 @@ class vimconnector(): These plugins must implement a vimconnector class derived from this and all these methods ''' - def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None, log_level="ERROR", config={}): + def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None, log_level=None, config={}): self.id = uuid self.name = name self.url = url @@ -92,8 +92,9 @@ class vimconnector(): self.user = user self.passwd = passwd self.config = config - self.logger = logging.getLogger('mano.vim') - self.logger.setLevel( getattr(logging, log_level) ) + self.logger = logging.getLogger('openmano.vim') + if log_level: + self.logger.setLevel( getattr(logging, log_level) ) if not self.url_admin: #try to use normal url self.url_admin = self.url @@ -263,14 +264,22 @@ class vimconnector(): 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: - 0,"Image not found" if there are no images with that path - 1,image-id if there is one image with that path - <0,message if there was an error (Image not found, error contacting VIM, more than 1 image with that path, etc.) - ''' + '''Get the image id from image path in the VIM database. Returns the image_id''' raise vimconnNotImplemented( "Should have implemented this" ) + def get_image_list(self, filter_dict={}): + '''Obtain tenant images from VIM + Filter_dict can be: + name: image name + id: image uuid + checksum: image checksum + location: image path + Returns the image list of dictionaries: + [{}, ...] + List can be empty + ''' + raise vimconnNotImplemented( "Should have implemented this" ) + def new_vminstance(self,name,description,start,image_id,flavor_id,net_list,cloud_config=None): '''Adds a VM instance to VIM Params: