From 1459d60ec7966fd38be44d44042f8c3f65bcdc9a Mon Sep 17 00:00:00 2001 From: delacruzramo Date: Thu, 3 Oct 2019 14:22:00 +0200 Subject: [PATCH] Fix allowed methods for administration topics Change-Id: I2a318bc3d6d6ead1c27a74652c8f2e990adc662a Signed-off-by: delacruzramo --- osm_nbi/nbi.py | 14 +++++++------- osm_nbi/resources_to_operations.yml | 18 ++---------------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index 206685d..e2419cf 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -216,42 +216,42 @@ valid_url_methods = { }, "users": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "users:", - "": {"METHODS": ("GET", "POST", "DELETE", "PATCH", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "users:id:" } }, "projects": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "projects:", - "": {"METHODS": ("GET", "DELETE", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "projects:id:"} }, "roles": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "roles:", - "": {"METHODS": ("GET", "POST", "DELETE", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "roles:id:" } }, "vims": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "vims:", - "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "vims:id:" } }, "vim_accounts": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "vim_accounts:", - "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "vim_accounts:id:" } }, "wim_accounts": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "wim_accounts:", - "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "wim_accounts:id:" } }, "sdns": {"METHODS": ("GET", "POST"), "ROLE_PERMISSION": "sdn_controllers:", - "": {"METHODS": ("GET", "DELETE", "PATCH", "PUT"), + "": {"METHODS": ("GET", "DELETE", "PATCH"), "ROLE_PERMISSION": "sdn_controllers:id:" } }, diff --git a/osm_nbi/resources_to_operations.yml b/osm_nbi/resources_to_operations.yml index 0c39fe3..523d1f8 100644 --- a/osm_nbi/resources_to_operations.yml +++ b/osm_nbi/resources_to_operations.yml @@ -166,10 +166,6 @@ resources_to_operations: "GET /admin/v1/users/": "users:id:get" - "POST /admin/v1/users/": "users:id:post" - - "PUT /admin/v1/users/": "users:id:put" - "DELETE /admin/v1/users/": "users:id:delete" "PATCH /admin/v1/users/": "users:id:patch" @@ -184,7 +180,7 @@ resources_to_operations: "GET /admin/v1/projects/": "projects:id:get" - "PUT /admin/v1/projects/": "projects:id:put" + "PATCH /admin/v1/projects/": "projects:id:patch" "DELETE /admin/v1/projects/": "projects:id:delete" @@ -198,8 +194,6 @@ resources_to_operations: "GET /admin/v1/vims/": "vims:id:get" - "PUT /admin/v1/vims/": "vims:id:put" - "DELETE /admin/v1/vims/": "vims:id:delete" "PATCH /admin/v1/vims/": "vims:id:patch" @@ -214,8 +208,6 @@ resources_to_operations: "GET /admin/v1/vim_accounts/": "vim_accounts:id:get" - "PUT /admin/v1/vim_accounts/": "vim_accounts:id:put" - "DELETE /admin/v1/vim_accounts/": "vim_accounts:id:delete" "PATCH /admin/v1/vim_accounts/": "vim_accounts:id:patch" @@ -230,8 +222,6 @@ resources_to_operations: "GET /admin/v1/sdns/": "sdn_controllers:id:get" - "PUT /admin/v1/sdns/": "sdn_controllers:id:put" - "DELETE /admin/v1/sdns/": "sdn_controllers:id:delete" "PATCH /admin/v1/sdns/": "sdn_controllers:id:patch" @@ -246,8 +236,6 @@ resources_to_operations: "GET /admin/v1/wims/": "wims:id:get" - "PUT /admin/v1/wims/": "wims:id:put" - "DELETE /admin/v1/wims/": "wims:id:delete" "PATCH /admin/v1/wims/": "wims:id:patch" @@ -262,8 +250,6 @@ resources_to_operations: "GET /admin/v1/wim_accounts/": "wim_accounts:id:get" - "PUT /admin/v1/wim_accounts/": "wim_accounts:id:put" - "DELETE /admin/v1/wim_accounts/": "wim_accounts:id:delete" "PATCH /admin/v1/wim_accounts/": "wim_accounts:id:patch" @@ -280,7 +266,7 @@ resources_to_operations: "DELETE /admin/v1/roles/": "roles:id:delete" - "PUT /admin/v1/roles/": "roles:id:put" + "PATCH /admin/v1/roles/": "roles:id:patch" ################################################################################ ##################################### PDUDs #################################### -- 2.25.1