X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fnbi.py;h=1354f2cae797c6e7251703841285dc94e8cee4e7;hp=aeff32c955389fd4a289ce22296ba58584477815;hb=07f3172ef24dab2c7c47c9a8e726f1f9876f13b3;hpb=ba0dbed4d7fe4cd1ee800a4a3402157224fd7aff diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index aeff32c..1354f2c 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -661,7 +661,7 @@ class Server(object): if not main_topic or not version or not topic: raise NbiException("URL must contain at least 'main_topic/version/topic'", HTTPStatus.METHOD_NOT_ALLOWED) - if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm"): + if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm", "nst", "nsilcm"): raise NbiException("URL main_topic '{}' not supported".format(main_topic), HTTPStatus.METHOD_NOT_ALLOWED) if version != 'v1': @@ -675,9 +675,7 @@ class Server(object): force = kwargs.pop("FORCE") else: force = False - self._check_valid_url_method(method, main_topic, version, topic, _id, item, *args) - if main_topic == "admin" and topic == "tokens": return self.token(method, _id, kwargs) @@ -705,7 +703,7 @@ class Server(object): elif main_topic == "nsilcm": engine_topic = "nsis" if topic == "nsi_lcm_op_occs": - engine_topic = "nsilcmops" + engine_topic = "nsilcmops" elif main_topic == "pdu": engine_topic = "pdus" if engine_topic == "vims": # TODO this is for backward compatibility, it will remove in the future @@ -758,14 +756,14 @@ class Server(object): outdata = {"id": _id} cherrypy.response.status = HTTPStatus.ACCEPTED.value elif topic == "netslice_instances_content": - # creates NSI + # creates NetSlice_Instance_record (NSIR) _id = self.engine.new_item(rollback, session, engine_topic, indata, kwargs, force=force) - # creates nsilcmop + self._set_location_header(main_topic, version, topic, _id) indata["lcmOperationType"] = "instantiate" indata["nsiInstanceId"] = _id - self.engine.new_item(rollback, session, "nsilcmops", indata, None) - self._set_location_header(main_topic, version, topic, _id) + self.engine.new_item(rollback, session, "nsilcmops", indata, kwargs) outdata = {"id": _id} + elif topic == "netslice_instances" and item: indata["lcmOperationType"] = item indata["nsiInstanceId"] = _id