X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fnbi.py;h=9b1af5f981b615b157bb6b8062539dd8c017463a;hp=fd2b3e8fd30ca0defc7af80a6d08174e74b45fd0;hb=490d019c61da7d4f0718fe030d645bf936a616f0;hpb=02e700c9eceb147f4c72c8fe18975bfaac6ec759 diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index fd2b3e8..9b1af5f 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -262,6 +262,12 @@ valid_url_methods = { "ROLE_PERMISSION": "k8sclusters:id:" } }, + "vca": {"METHODS": ("GET", "POST"), + "ROLE_PERMISSION": "vca:", + "": {"METHODS": ("GET", "DELETE", "PATCH"), + "ROLE_PERMISSION": "vca:id:" + } + }, "k8srepos": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "k8srepos:", "": {"METHODS": ("GET", "DELETE"), @@ -619,7 +625,7 @@ class Server(object): if accept: if "text/html" in accept: return html.format(data, cherrypy.request, cherrypy.response, token_info) - elif "application/yaml" in accept or "*/*" in accept or "text/plain" in accept: + elif "application/yaml" in accept or "*/*" in accept: pass elif "application/json" in accept or (cherrypy.response.status and cherrypy.response.status >= 300): cherrypy.response.headers["Content-Type"] = 'application/json; charset=utf-8' @@ -1054,12 +1060,12 @@ class Server(object): cherrypy.request.headers.get("Accept")) outdata = file elif not _id: - outdata = self.engine.get_item_list(engine_session, engine_topic, kwargs) + outdata = self.engine.get_item_list(engine_session, engine_topic, kwargs, api_req=True) else: if item == "reports": # TODO check that project_id (_id in this context) has permissions _id = args[0] - outdata = self.engine.get_item(engine_session, engine_topic, _id) + outdata = self.engine.get_item(engine_session, engine_topic, _id, True) elif method == "POST": cherrypy.response.status = HTTPStatus.CREATED.value