X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fnbi.py;h=f57258fa6a1c88aee1ce8b7ccb5e2cb69dac9569;hp=502207f31de4735443e01cef3d9a49f50ecc6364;hb=8e3806cb1f4de97e7465d9da832eb1a841441cb9;hpb=a9a1fc8427db17f47ea7ff782e35d24be4094f95 diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index 502207f..f57258f 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -85,7 +85,9 @@ URL: /osm GET POST terminate O5 action O scale O5 + migrate O heal 5 + update 05 /ns_lcm_op_occs 5 5 / 5 5 5 TO BE COMPLETED 5 5 @@ -443,10 +445,18 @@ valid_url_methods = { "METHODS": ("POST",), "ROLE_PERMISSION": "ns_instances:id:instantiate:", }, + "migrate": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "ns_instances:id:migrate:", + }, "action": { "METHODS": ("POST",), "ROLE_PERMISSION": "ns_instances:id:action:", }, + "update": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "ns_instances:id:update:", + }, }, }, "ns_lcm_op_occs": { @@ -477,6 +487,31 @@ valid_url_methods = { }, } }, + "vnflcm": { + "v1": { + "vnf_instances": {"METHODS": ("GET", "POST"), + "ROLE_PERMISSION": "vnflcm_instances:", + "": {"METHODS": ("GET", "DELETE"), + "ROLE_PERMISSION": "vnflcm_instances:id:", + "scale": {"METHODS": ("POST",), + "ROLE_PERMISSION": "vnflcm_instances:id:scale:" + }, + "terminate": {"METHODS": ("POST",), + "ROLE_PERMISSION": "vnflcm_instances:id:terminate:" + }, + "instantiate": {"METHODS": ("POST",), + "ROLE_PERMISSION": "vnflcm_instances:id:instantiate:" + }, + } + }, + "vnf_lcm_op_occs": {"METHODS": ("GET",), + "ROLE_PERMISSION": "vnf_instances:opps:", + "": {"METHODS": ("GET",), + "ROLE_PERMISSION": "vnf_instances:opps:id:" + }, + }, + } + }, "nst": { "v1": { "netslice_templates_content": { @@ -1293,6 +1328,7 @@ class Server(object): "nst", "nsilcm", "nspm", + "vnflcm", ): raise NbiException( "URL main_topic '{}' not supported".format(main_topic), @@ -1347,6 +1383,9 @@ class Server(object): engine_topic = "nslcmops" if topic == "vnfrs" or topic == "vnf_instances": engine_topic = "vnfrs" + elif main_topic == "vnflcm": + if topic == "vnf_lcm_op_occs": + engine_topic = "vnflcmops" elif main_topic == "nst": engine_topic = "nsts" elif main_topic == "nsilcm": @@ -1504,6 +1543,13 @@ class Server(object): "_links": link, } cherrypy.response.status = HTTPStatus.CREATED.value + elif topic == "vnf_instances" and item: + indata["lcmOperationType"] = item + indata["vnfInstanceId"] = _id + _id, _ = self.engine.new_item(rollback, engine_session, "vnflcmops", indata, kwargs) + self._set_location_header(main_topic, version, "vnf_lcm_op_occs", _id) + outdata = {"id": _id} + cherrypy.response.status = HTTPStatus.ACCEPTED.value else: _id, op_id = self.engine.new_item( rollback,