From: kuuse Date: Thu, 16 May 2019 17:24:21 +0000 (+0200) Subject: Feature 7181: Ability to provide real-time feedback in CLI and GUI upon request X-Git-Tag: v6.0.0~25 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F7470%2F8;p=osm%2FNBI.git Feature 7181: Ability to provide real-time feedback in CLI and GUI upon request To be able to use 'ns-create' and 'nsi-create' with the new '--wait' option, the following two fields have been added in the response header for topics: - ns_instances_content: nslcmop_id field - netslice_instances_content: nsilcmop_id Change-Id: Id09d7d2581c4360d7bb74e1788f0489d79856b65 Signed-off-by: kuuse --- diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index 0616430..a43336d 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -873,9 +873,9 @@ class Server(object): # creates nslcmop indata["lcmOperationType"] = "instantiate" indata["nsInstanceId"] = _id - self.engine.new_item(rollback, session, "nslcmops", indata, None) + nslcmop_id = self.engine.new_item(rollback, session, "nslcmops", indata, None) self._set_location_header(main_topic, version, topic, _id) - outdata = {"id": _id} + outdata = {"id": _id, "nslcmop_id": nslcmop_id} elif topic == "ns_instances" and item: indata["lcmOperationType"] = item indata["nsInstanceId"] = _id @@ -889,8 +889,8 @@ class Server(object): self._set_location_header(main_topic, version, topic, _id) indata["lcmOperationType"] = "instantiate" indata["nsiInstanceId"] = _id - self.engine.new_item(rollback, session, "nsilcmops", indata, kwargs) - outdata = {"id": _id} + nsilcmop_id = self.engine.new_item(rollback, session, "nsilcmops", indata, kwargs) + outdata = {"id": _id, "nsilcmop_id": nsilcmop_id} elif topic == "netslice_instances" and item: indata["lcmOperationType"] = item