- elif item == "ns_instances_content":
- _id = self.engine.new_item(session, engine_item, indata, kwargs, force=force)
- rollback = {"session": session, "item": engine_item, "_id": _id, "force": True}
- self.engine.ns_operation(session, _id, "instantiate", {}, None)
- self._set_location_header(topic, version, item, _id)
+ elif topic == "ns_instances_content":
+ # creates NSR
+ _id = self.engine.new_item(rollback, session, engine_topic, indata, kwargs, force=force)
+ # creates nslcmop
+ indata["lcmOperationType"] = "instantiate"
+ indata["nsInstanceId"] = _id
+ self.engine.new_item(rollback, session, "nslcmops", indata, None)
+ self._set_location_header(main_topic, version, topic, _id)
+ outdata = {"id": _id}
+ elif topic == "ns_instances" and item:
+ indata["lcmOperationType"] = item
+ indata["nsInstanceId"] = _id
+ _id = self.engine.new_item(rollback, session, "nslcmops", indata, kwargs)
+ self._set_location_header(main_topic, version, "ns_lcm_op_occs", _id)
+ outdata = {"id": _id}
+ cherrypy.response.status = HTTPStatus.ACCEPTED.value
+ elif topic == "netslice_instances_content":
+ # creates NSI
+ _id = self.engine.new_item(rollback, session, engine_topic, indata, kwargs, force=force)
+ # creates nsilcmop
+ indata["lcmOperationType"] = "instantiate"
+ indata["nsiInstanceId"] = _id
+ self.engine.new_item(rollback, session, "nsilcmops", indata, None)
+ self._set_location_header(main_topic, version, topic, _id)