X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Finstance_topics.py;fp=osm_nbi%2Finstance_topics.py;h=2df6a7d15b93bf78a26fd84f74c0672b93e1a440;hp=787f6e1a2bb12139c0bb98385df72d1ffc8a6690;hb=6380e7cbe3ffd525453b5d8ef54c18a9cc14fa5d;hpb=f100459221b95cdaaa543793623e556a9abd4852 diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 787f6e1..2df6a7d 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -1278,6 +1278,9 @@ class NsLcmOpTopic(BaseTopic): - it checks the vnfInstanceId, whether it's available under ns instance - it checks the vnfdId whether it matches with the vnfd-id in the vnf-record of specified VNF. Otherwise exception will be raised. + If updateType is REMOVE_VNF: + - it checks if the vnfInstanceId is available in the ns instance + - Otherwise exception will be raised. Args: indata: includes updateType such as CHANGE_VNFPKG, @@ -1338,6 +1341,14 @@ class NsLcmOpTopic(BaseTopic): ), http_code=HTTPStatus.UNPROCESSABLE_ENTITY, ) + elif indata["updateType"] == "REMOVE_VNF": + vnf_instance_id = indata["removeVnfInstanceId"] + ns_instance_id = indata["nsInstanceId"] + if vnf_instance_id not in nsr["constituent-vnfr-ref"]: + raise EngineException( + "Invalid VNF Instance Id. '{}' is not " + "present in the NS '{}'".format(vnf_instance_id, ns_instance_id) + ) except ( DbException,