From: velandy Date: Mon, 9 Jan 2017 17:05:30 +0000 (+0100) Subject: Merge "Bug 140" X-Git-Tag: v1.1.0~29 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=df4e972f5e6581a85dd5a072ac4da8585b4c83e6;hp=af804410b4063fe28658e38d23e3108b1d88a799;p=osm%2FSO.git Merge "Bug 140" --- diff --git a/models/plugins/yang/vnfd.yang b/models/plugins/yang/vnfd.yang index 0e779c51..ce74f02c 100644 --- a/models/plugins/yang/vnfd.yang +++ b/models/plugins/yang/vnfd.yang @@ -266,6 +266,7 @@ module vnfd type uint64; } + list internal-connection-point { key "id-ref"; description "List of internal connection points in this VLD"; @@ -277,8 +278,30 @@ module vnfd } } uses manotypes:provider-network; + choice init-params { + description "Extra parameters for VLD instantiation"; + + case vim-network-ref { + leaf vim-network-name { + description + "Name of network in VIM account. This is used to indicate + pre-provisioned network name in cloud account."; + type string; + } + } + + case vim-network-profile { + leaf ip-profile-ref { + description "Named reference to IP-profile object"; + type string; + } + } + + } } + uses manotypes:ip-profile-list; + list connection-point { key "name"; description diff --git a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py index e0de7b0c..15e6f46a 100755 --- a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py +++ b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py @@ -986,13 +986,14 @@ class VlRecordState(enum.Enum): class InternalVirtualLinkRecord(object): """ Internal Virtual Link record """ - def __init__(self, dts, log, loop, ivld_msg, vnfr_name, cloud_account_name): + def __init__(self, dts, log, loop, ivld_msg, vnfr_name, cloud_account_name, ip_profile=None): self._dts = dts self._log = log self._loop = loop self._ivld_msg = ivld_msg self._vnfr_name = vnfr_name self._cloud_account_name = cloud_account_name + self._ip_profile = ip_profile self._vlr_req = self.create_vlr() self._vlr = None @@ -1006,7 +1007,10 @@ class InternalVirtualLinkRecord(object): @property def name(self): """ Name of this VL """ - return self._vnfr_name + "." + self._ivld_msg.name + if self._ivld_msg.vim_network_name: + return self._ivld_msg.vim_network_name + else: + return self._vnfr_name + "." + self._ivld_msg.name @property def network_id(self): @@ -1025,6 +1029,7 @@ class InternalVirtualLinkRecord(object): "description", "version", "type_yang", + "vim_network_name", "provider_network"] vld_copy_dict = {k: v for k, v in self._ivld_msg.as_dict().items() if k in vld_fields} @@ -1033,6 +1038,10 @@ class InternalVirtualLinkRecord(object): "name": self.name, "cloud_account": self._cloud_account_name, } + + if self._ip_profile and self._ip_profile.has_field('ip_profile_params'): + vlr_dict['ip_profile_params' ] = self._ip_profile.ip_profile_params.as_dict() + vlr_dict.update(vld_copy_dict) vlr = RwVlrYang.YangData_Vlr_VlrCatalog_Vlr.from_dict(vlr_dict) @@ -1416,6 +1425,13 @@ class VirtualNetworkFunctionRecord(object): self._log.debug("Published VNFR path = [%s], record = [%s]", self.xpath, self.msg) + def resolve_vld_ip_profile(self, vnfd_msg, vld): + self._log.debug("Receieved ip profile ref is %s",vld.ip_profile_ref) + if not vld.has_field('ip_profile_ref'): + return None + profile = [profile for profile in vnfd_msg.ip_profiles if profile.name == vld.ip_profile_ref] + return profile[0] if profile else None + @asyncio.coroutine def create_vls(self): """ Publish The VLs associated with this VNF """ @@ -1431,7 +1447,8 @@ class VirtualNetworkFunctionRecord(object): loop=self._loop, ivld_msg=ivld_msg, vnfr_name=self.name, - cloud_account_name=self.cloud_account_name + cloud_account_name=self.cloud_account_name, + ip_profile=self.resolve_vld_ip_profile(self.vnfd, ivld_msg) ) self._vlrs.append(vlr)