/<subscriptionId> 5 X
/pdu/v1
- /pdu_descriptor O O
+ /pdu_descriptors O O
/<id> O O O O
/admin/v1
"<ID>": {"METHODS": ("GET", "POST", "DELETE", "PATCH", "PUT")}
},
"projects": {"METHODS": ("GET", "POST"),
- "<ID>": {"METHODS": ("GET", "DELETE")}
+ # Added PUT to allow Project Name modification
+ "<ID>": {"METHODS": ("GET", "DELETE", "PUT")}
},
+ "roles": {"METHODS": ("GET", "POST"),
+ "<ID>": {"METHODS": ("GET", "POST", "DELETE")}
+ },
"vims": {"METHODS": ("GET", "POST"),
"<ID>": {"METHODS": ("GET", "DELETE", "PATCH", "PUT")}
},
},
}
},
+ "nspm": {
+ "v1": {
+ "pm_jobs": {
+ "<ID>": {
+ "reports": {
+ "<ID>": {"METHODS": ("GET")}
+ }
+ },
+ },
+ },
+ },
}
def _format_in(self, kwargs):
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", "pdu", "nst", "nsilcm"):
+ if main_topic not in ("admin", "vnfpkgm", "nsd", "nslcm", "pdu", "nst", "nsilcm", "nspm"):
raise NbiException("URL main_topic '{}' not supported".format(main_topic),
HTTPStatus.METHOD_NOT_ALLOWED)
if version != 'v1':
engine_topic = topic
if topic == "subscriptions":
engine_topic = main_topic + "_" + topic
- if item:
+ if item and topic != "pm_jobs":
engine_topic = item
if main_topic == "nsd":
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
elif not _id:
outdata = self.engine.get_item_list(session, engine_topic, kwargs)
else:
+ if item == "reports":
+ # TODO check that project_id (_id in this context) has permissions
+ _id = args[0]
outdata = self.engine.get_item(session, engine_topic, _id)
elif method == "POST":
if topic in ("ns_descriptors_content", "vnf_packages_content", "netslice_templates_content"):
indata["nsiInstanceId"] = _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