Use of PATCH method instead of PUT for projects 32/8232/19
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 22 Nov 2019 21:18:09 +0000 (22:18 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 28 Nov 2019 21:34:37 +0000 (22:34 +0100)
This applies to projects, users, roles, vims, wims
and sdncontrollers

Change-Id: I81badf6f4117d26c8a8f613336dba520377f9612
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
osmclient/sol005/project.py
osmclient/sol005/role.py
osmclient/sol005/sdncontroller.py
osmclient/sol005/user.py
osmclient/sol005/vim.py
osmclient/sol005/wim.py

index fe0f23c..19a27c3 100644 (file)
@@ -64,7 +64,7 @@ class Project(object):
         """
         self._client.get_token()
         proj = self.get(project)
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase, proj['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase, proj['_id']),
                                              postfields_dict=project_changes)
         # print('HTTP CODE: {}'.format(http_code))
         # print('RESP: {}'.format(resp))
index faa381b..01f3bc3 100644 (file)
@@ -143,7 +143,7 @@ class Role(object):
         if not new_role_obj["permissions"]:
             del new_role_obj["permissions"]
 
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase, role_obj['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase, role_obj['_id']),
                                              postfields_dict=new_role_obj)
         # print('HTTP CODE: {}'.format(http_code))
         # print('RESP: {}'.format(resp))
index 690fa07..4f3ced4 100644 (file)
@@ -88,7 +88,7 @@ class SdnController(object):
         self._client.get_token()
         sdnc = self.get(name)
         sdnc_id_for_wait = self._get_id_for_wait(name)
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase,sdnc['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase,sdnc['_id']),
                                        postfields_dict=sdn_controller)
         # print('HTTP CODE: {}'.format(http_code))
         # print('RESP: {}'.format(resp))
index 689d359..64d5c69 100644 (file)
@@ -140,7 +140,7 @@ class User(object):
         if not update_user:
             raise ClientException("At least something should be changed.")
 
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase, myuser['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase, myuser['_id']),
                                              postfields_dict=update_user)
         # print('HTTP CODE: {}'.format(http_code))
         # print('RESP: {}'.format(resp))
index 421f8a5..1af7cc7 100644 (file)
@@ -126,7 +126,7 @@ class Vim(object):
                 vim_config['sdn-port-mapping'] = yaml.safe_load(f.read())
         vim_account['config'] = vim_config
         #vim_account['config'] = json.dumps(vim_config)
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase,vim['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase,vim['_id']),
                                        postfields_dict=vim_account)
         # print('HTTP CODE: {}'.format(http_code))
         # print('RESP: {}'.format(resp))
index c2ada69..943ceb4 100644 (file)
@@ -118,7 +118,7 @@ class Wim(object):
                 wim_config['wim_port_mapping'] = yaml.safe_load(f.read())
         wim_account['config'] = wim_config
         #wim_account['config'] = json.dumps(wim_config)
-        http_code, resp = self._http.put_cmd(endpoint='{}/{}'.format(self._apiBase,wim['_id']),
+        http_code, resp = self._http.patch_cmd(endpoint='{}/{}'.format(self._apiBase,wim['_id']),
                                        postfields_dict=wim_account)
         #print('HTTP CODE: {}'.format(http_code))
         #print('RESP: {}'.format(resp))