Feature 7181: Ability to provide real-time feedback in CLI and GUI upon request 70/7470/8
authorkuuse <johan.kuuse@altran.com>
Thu, 16 May 2019 17:24:21 +0000 (19:24 +0200)
committerkuuse <johan.kuuse@altran.com>
Thu, 30 May 2019 16:04:46 +0000 (17:04 +0100)
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 <johan.kuuse@altran.com>
osm_nbi/nbi.py

index 0616430..a43336d 100644 (file)
@@ -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