X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=vimconn_openvim.py;h=e86b54db2734fa6d363252f089d86f603a1064af;hb=06e6c396413630640cafae3488442a0869f1642d;hp=fb59ecccea44a2ba5e8c9fcd09b7142c7d91edb4;hpb=0a3fc475690c26c63fb61269315dc17e05584b55;p=osm%2FRO.git diff --git a/vimconn_openvim.py b/vimconn_openvim.py index fb59eccc..e86b54db 100644 --- a/vimconn_openvim.py +++ b/vimconn_openvim.py @@ -323,11 +323,13 @@ get_processor_rankings_response_schema = { } class vimconnector(vimconn.vimconnector): - def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None,log_level="DEBUG",config={}): + def __init__(self, uuid, name, tenant_id, tenant_name, url, url_admin=None, user=None, passwd=None, + log_level="DEBUG", config={}, persistent_info={}): vimconn.vimconnector.__init__(self, uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level, config) self.tenant = None self.headers_req = {'content-type': 'application/json'} self.logger = logging.getLogger('openmano.vim.openvim') + self.persistent_info = persistent_info if tenant_id: self.tenant = tenant_id @@ -481,7 +483,7 @@ class vimconnector(vimconn.vimconnector): except requests.exceptions.RequestException as e: self._format_request_exception(e) - def new_network(self,net_name, net_type, ip_profile=None, shared=False, **vim_specific): + def new_network(self,net_name, net_type, ip_profile=None, shared=False, vlan=None): #, **vim_specific): '''Adds a tenant network to VIM''' '''Returns the network identifier''' try: @@ -489,7 +491,9 @@ class vimconnector(vimconn.vimconnector): if net_type=="bridge": net_type="bridge_data" payload_req = {"name": net_name, "type": net_type, "tenant_id": self.tenant, "shared": shared} - payload_req.update(vim_specific) + if vlan: + payload_req["provider:vlan"] = vlan + # payload_req.update(vim_specific) url = self.url+'/networks' self.logger.info("Adding a new network POST: %s DATA: %s", url, str(payload_req)) vim_response = requests.post(url, headers = self.headers_req, data=json.dumps({"network": payload_req}) )