From 0b8752ff86fdb4bdb6fffe00103a221aa4bbc923 Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 12 May 2020 09:42:02 +0000 Subject: [PATCH] fix 1059. Provide rights parameters to ns_terminate for a nsi service Change-Id: Ic83d30c33f6df148f651f4a06fc4a8d98be8b116 Signed-off-by: tierno --- osm_nbi/instance_topics.py | 15 +++++++++------ osm_nbi/validation.py | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 4b2eb44..8d5b573 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -1537,12 +1537,15 @@ class NsiLcmOpTopic(BaseTopic): try: service = self.db.get_one("nsrs", {"_id": nsr_item["nsrId"]}) - indata_ns = {} - indata_ns = service["instantiate_params"] - indata_ns["lcmOperationType"] = operation - indata_ns["nsInstanceId"] = service["_id"] - # Including netslice_id in the ns instantiate Operation - indata_ns["netsliceInstanceId"] = netsliceInstanceId + indata_ns = { + "lcmOperationType": operation, + "nsInstanceId": service["_id"], + # Including netslice_id in the ns instantiate Operation + "netsliceInstanceId": netsliceInstanceId, + } + if operation == "instantiate": + indata_ns.update(service["instantiate_params"]) + # Creating NS_LCM_OP with the flag slice_object=True to not trigger the service instantiation # message via kafka bus nslcmop, _ = self.nsi_NsLcmOpTopic.new(rollback, session, indata_ns, kwargs, headers, diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 11e9ce4..9ff90db 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -370,6 +370,7 @@ ns_terminate = { "autoremove": bool_schema, "timeout_ns_terminate": integer1_schema, "skip_terminate_primitives": bool_schema, + "netsliceInstanceId": id_schema, }, "additionalProperties": False } -- 2.25.1