+valid_query_string = ("ADMIN", "SET_PROJECT", "FORCE", "PUBLIC")
+# ^ Contains possible administrative query string words:
+# ADMIN=True(by default)|Project|Project-list: See all elements, or elements of a project
+# (not owned by my session project).
+# PUBLIC=True(by default)|False: See/hide public elements. Set/Unset a topic to be public
+# FORCE=True(by default)|False: Force edition/deletion operations
+# SET_PROJECT=Project|Project-list: Add/Delete the topic to the projects portfolio
+
+valid_url_methods = {
+ # contains allowed URL and methods, and the role_permission name
+ "admin": {
+ "v1": {
+ "tokens": {
+ "METHODS": ("GET", "POST", "DELETE"),
+ "ROLE_PERMISSION": "tokens:",
+ "<ID>": {"METHODS": ("GET", "DELETE"), "ROLE_PERMISSION": "tokens:id:"},
+ },
+ "users": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "users:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "users:id:",
+ },
+ },
+ "projects": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "projects:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "projects:id:",
+ },
+ },
+ "roles": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "roles:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "roles:id:",
+ },
+ },
+ "vims": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vims:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "vims:id:",
+ },
+ },
+ "vim_accounts": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vim_accounts:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "vim_accounts:id:",
+ },
+ },
+ "wim_accounts": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "wim_accounts:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "wim_accounts:id:",
+ },
+ },
+ "sdns": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "sdn_controllers:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "sdn_controllers:id:",
+ },
+ },
+ "k8sclusters": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "k8sclusters:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "k8sclusters:id:",
+ },
+ },
+ "vca": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vca:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "vca:id:",
+ },
+ },
+ "k8srepos": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "k8srepos:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "k8srepos:id:",
+ },
+ },
+ "osmrepos": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "osmrepos:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "osmrepos:id:",
+ },
+ },
+ "domains": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "domains:",
+ },
+ }
+ },
+ "pdu": {
+ "v1": {
+ "pdu_descriptors": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "pduds:",
+ "<ID>": {
+ "METHODS": ("GET", "POST", "DELETE", "PATCH", "PUT"),
+ "ROLE_PERMISSION": "pduds:id:",
+ },
+ },
+ }
+ },
+ "nsd": {
+ "v1": {
+ "ns_descriptors_content": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "nsds:",
+ "<ID>": {
+ "METHODS": ("GET", "PUT", "DELETE"),
+ "ROLE_PERMISSION": "nsds:id:",
+ },
+ },
+ "ns_descriptors": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "nsds:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"),
+ "ROLE_PERMISSION": "nsds:id:",
+ "nsd_content": {
+ "METHODS": ("GET", "PUT"),
+ "ROLE_PERMISSION": "nsds:id:content:",
+ },
+ "nsd": {
+ "METHODS": ("GET",), # descriptor inside package
+ "ROLE_PERMISSION": "nsds:id:content:",
+ },
+ "artifacts": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "nsds:id:nsd_artifact:",
+ "*": None,
+ },
+ },
+ },
+ "pnf_descriptors": {
+ "TODO": ("GET", "POST"),
+ "<ID>": {
+ "TODO": ("GET", "DELETE", "PATCH"),
+ "pnfd_content": {"TODO": ("GET", "PUT")},
+ },
+ },
+ "subscriptions": {
+ "TODO": ("GET", "POST"),
+ "<ID>": {"TODO": ("GET", "DELETE")},
+ },
+ }
+ },
+ "vnfpkgm": {
+ "v1": {
+ "vnf_packages_content": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vnfds:",
+ "<ID>": {
+ "METHODS": ("GET", "PUT", "DELETE"),
+ "ROLE_PERMISSION": "vnfds:id:",
+ },
+ },
+ "vnf_packages": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vnfds:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE", "PATCH"), # GET: vnfPkgInfo
+ "ROLE_PERMISSION": "vnfds:id:",
+ "package_content": {
+ "METHODS": ("GET", "PUT"), # package
+ "ROLE_PERMISSION": "vnfds:id:",
+ "upload_from_uri": {
+ "METHODS": (),
+ "TODO": ("POST",),
+ "ROLE_PERMISSION": "vnfds:id:upload:",
+ },
+ },
+ "vnfd": {
+ "METHODS": ("GET",), # descriptor inside package
+ "ROLE_PERMISSION": "vnfds:id:content:",
+ },
+ "artifacts": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "vnfds:id:vnfd_artifact:",
+ "*": None,
+ },
+ "action": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "vnfds:id:action:",
+ },
+ },
+ },
+ "subscriptions": {
+ "TODO": ("GET", "POST"),
+ "<ID>": {"TODO": ("GET", "DELETE")},
+ },
+ "vnfpkg_op_occs": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "vnfds:vnfpkgops:",
+ "<ID>": {"METHODS": ("GET",), "ROLE_PERMISSION": "vnfds:vnfpkgops:id:"},
+ },
+ }
+ },
+ "nslcm": {
+ "v1": {
+ "ns_instances_content": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "ns_instances:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "ns_instances:id:",
+ },
+ },
+ "ns_instances": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "ns_instances:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "ns_instances:id:",
+ "heal": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "ns_instances:id:heal:",
+ },
+ "scale": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "ns_instances:id:scale:",
+ },
+ "terminate": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "ns_instances:id:terminate:",
+ },
+ "instantiate": {
+ "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:",
+ },
+ "verticalscale": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "ns_instances:id:verticalscale:",
+ },
+ },
+ },
+ "ns_lcm_op_occs": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "ns_instances:opps:",
+ "<ID>": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "ns_instances:opps:id:",
+ "cancel": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "ns_instances:opps:cancel:",
+ },
+ },
+ },
+ "vnfrs": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "vnf_instances:",
+ "<ID>": {"METHODS": ("GET",), "ROLE_PERMISSION": "vnf_instances:id:"},
+ },
+ "vnf_instances": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "vnf_instances:",
+ "<ID>": {"METHODS": ("GET",), "ROLE_PERMISSION": "vnf_instances:id:"},
+ },
+ "subscriptions": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "ns_subscriptions:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "ns_subscriptions:id:",
+ },
+ },
+ }
+ },
+ "vnflcm": {
+ "v1": {
+ "vnf_instances": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vnflcm_instances:",
+ "<ID>": {
+ "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:",
+ "<ID>": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "vnf_instances:opps:id:",
+ },
+ },
+ "subscriptions": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "vnflcm_subscriptions:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "vnflcm_subscriptions:id:",
+ },
+ },
+ }
+ },
+ "nst": {
+ "v1": {
+ "netslice_templates_content": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "slice_templates:",
+ "<ID>": {
+ "METHODS": ("GET", "PUT", "DELETE"),
+ "ROLE_PERMISSION": "slice_templates:id:",
+ },
+ },
+ "netslice_templates": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "slice_templates:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "TODO": ("PATCH",),
+ "ROLE_PERMISSION": "slice_templates:id:",
+ "nst_content": {
+ "METHODS": ("GET", "PUT"),
+ "ROLE_PERMISSION": "slice_templates:id:content:",
+ },
+ "nst": {
+ "METHODS": ("GET",), # descriptor inside package
+ "ROLE_PERMISSION": "slice_templates:id:content:",
+ },
+ "artifacts": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "slice_templates:id:content:",
+ "*": None,
+ },
+ },
+ },
+ "subscriptions": {
+ "TODO": ("GET", "POST"),
+ "<ID>": {"TODO": ("GET", "DELETE")},
+ },
+ }
+ },
+ "nsilcm": {
+ "v1": {
+ "netslice_instances_content": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "slice_instances:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "slice_instances:id:",
+ },
+ },
+ "netslice_instances": {
+ "METHODS": ("GET", "POST"),
+ "ROLE_PERMISSION": "slice_instances:",
+ "<ID>": {
+ "METHODS": ("GET", "DELETE"),
+ "ROLE_PERMISSION": "slice_instances:id:",
+ "terminate": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "slice_instances:id:terminate:",
+ },
+ "instantiate": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "slice_instances:id:instantiate:",
+ },
+ "action": {
+ "METHODS": ("POST",),
+ "ROLE_PERMISSION": "slice_instances:id:action:",
+ },
+ },
+ },
+ "nsi_lcm_op_occs": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "slice_instances:opps:",
+ "<ID>": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "slice_instances:opps:id:",
+ },
+ },
+ }
+ },
+ "nspm": {
+ "v1": {
+ "pm_jobs": {
+ "<ID>": {
+ "reports": {
+ "<ID>": {
+ "METHODS": ("GET",),
+ "ROLE_PERMISSION": "reports:id:",
+ }
+ }
+ },
+ },
+ },
+ },
+ "nsfm": {
+ "v1": {
+ "alarms": {
+ "METHODS": ("GET", "PATCH"),
+ "ROLE_PERMISSION": "alarms:",
+ "<ID>": {
+ "METHODS": ("GET", "PATCH"),
+ "ROLE_PERMISSION": "alarms:id:",
+ },
+ }
+ },
+ },
+}