X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Finstance_topics.py;h=62df4f858dd5f8ecc4c46414742b80530a9a029c;hp=aac0b0b0afe34193a059b4f14116bd1522b3069b;hb=d7753fce51ff422df546353e46dbff1ce495e34a;hpb=8bf978ed8d25bfdc9fe91033b57555946fef8e36 diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index aac0b0b..62df4f8 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -27,6 +27,7 @@ from osm_nbi.validation import ( ns_action, ns_scale, ns_update, + ns_heal, nsi_instantiate, ns_migrate, ) @@ -557,6 +558,9 @@ class NsrTopic(BaseTopic): "image": [], "affinity-or-anti-affinity-group": [], } + if "revision" in nsd["_admin"]: + nsr_descriptor["revision"] = nsd["_admin"]["revision"] + ns_request["nsr_id"] = nsr_id if ns_request and ns_request.get("config-units"): nsr_descriptor["config-units"] = ns_request["config-units"] @@ -1160,6 +1164,7 @@ class NsLcmOpTopic(BaseTopic): "action": ns_action, "update": ns_update, "scale": ns_scale, + "heal": ns_heal, "terminate": ns_terminate, "migrate": ns_migrate, } @@ -1172,7 +1177,7 @@ class NsLcmOpTopic(BaseTopic): """ Check that user has enter right parameters for the operation :param session: contains "username", "admin", "force", "public", "project_id", "set_project" - :param operation: it can be: instantiate, terminate, action, update. TODO: heal + :param operation: it can be: instantiate, terminate, action, update, heal :param indata: descriptor with the parameters of the operation :return: None """ @@ -1182,6 +1187,8 @@ class NsLcmOpTopic(BaseTopic): self._check_scale_ns_operation(indata, nsr) elif operation == "update": self._check_update_ns_operation(indata, nsr) + elif operation == "heal": + self._check_heal_ns_operation(indata, nsr) elif operation == "instantiate": self._check_instantiate_ns_operation(indata, nsr, session) @@ -1384,6 +1391,9 @@ class NsLcmOpTopic(BaseTopic): ) ) + def _check_heal_ns_operation(self, indata, nsr): + return + def _check_instantiate_ns_operation(self, indata, nsr, session): vnf_member_index_to_vnfd = {} # map between vnf_member_index to vnf descriptor. vim_accounts = [] @@ -1478,7 +1488,7 @@ class NsLcmOpTopic(BaseTopic): if in_vdu["id"] == vdu["id"]: for volume in get_iterable(in_vdu.get("volume")): for volumed in get_iterable(vdu.get("virtual-storage-desc")): - if volumed["id"] == volume["name"]: + if volumed == volume["name"]: break else: raise EngineException( @@ -1498,7 +1508,7 @@ class NsLcmOpTopic(BaseTopic): ): vdu_if_names.add(iface.get("name")) - for in_iface in get_iterable(in_vdu["interface"]): + for in_iface in get_iterable(in_vdu.get("interface")): if in_iface["name"] in vdu_if_names: break else: