X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=NG-RO%2Fosm_ng_ro%2Fro_main.py;h=376c087ee894ef10f162e51fe9d577eebf40ffe3;hb=refs%2Fchanges%2F93%2F12293%2F5;hp=30acd2b6100132a56f7f4db542a828346a863591;hpb=8658c2cd33bcea66c9b99aabb0825071c5c42df0;p=osm%2FRO.git diff --git a/NG-RO/osm_ng_ro/ro_main.py b/NG-RO/osm_ng_ro/ro_main.py index 30acd2b6..376c087e 100644 --- a/NG-RO/osm_ng_ro/ro_main.py +++ b/NG-RO/osm_ng_ro/ro_main.py @@ -83,6 +83,30 @@ valid_url_methods = { }, "ns": { "v1": { + "rebuild": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "rebuild:", + "": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "rebuild:id:", + }, + }, + "start": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "start:", + "": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "start:id:", + }, + }, + "stop": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "stop:", + "": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "stop:id:", + }, + }, "deploy": { "METHODS": ("GET",), "ROLE_PERMISSION": "deploy:", @@ -119,6 +143,16 @@ valid_url_methods = { }, }, }, + "verticalscale": { + "": { + "METHODS": ("POST"), + "ROLE_PERMISSION": "verticalscale:id:", + "": { + "METHODS": ("GET",), + "ROLE_PERMISSION": "verticalscale:id:id:", + }, + }, + }, } }, } @@ -170,9 +204,13 @@ class Server(object): "deploy:id:delete": self.ns.delete, "deploy:id:id:get": self.ns.status, "deploy:id:id:cancel:post": self.ns.cancel, + "rebuild:id:post": self.ns.rebuild_start_stop, + "start:id:post": self.ns.rebuild_start_stop, + "stop:id:post": self.ns.rebuild_start_stop, "recreate:id:post": self.ns.recreate, "recreate:id:id:get": self.ns.recreate_status, "migrate:id:post": self.ns.migrate, + "verticalscale:id:post": self.ns.verticalscale, } def _format_in(self, kwargs): @@ -816,7 +854,7 @@ def _start_service(): elif k1 == "tools": # update [/] configuration engine_config["/"]["tools." + k2.replace("_", ".")] = yaml.safe_load(v) - elif k1 in ("message", "database", "storage", "authentication"): + elif k1 in ("message", "database", "storage", "authentication", "period"): engine_config[k1][k2] = yaml.safe_load(v) except Exception as e: