diff options
author | Bin Yang <bin.yang@windriver.com> | 2018-08-14 07:42:55 +0000 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2018-08-14 07:42:55 +0000 |
commit | 2e99e50a4e623f9b1c95f13ae68e3a4deee42cb2 (patch) | |
tree | fcbf2a5325b8d91d23191f24861f7e65252cf065 /windriver/titanium_cloud/vesagent/vesagent_ctrl.py | |
parent | adeadd2b361a0612e289b5a8dd85de9b1d041193 (diff) |
API upgrading for vesagent
Change-Id: I7613c2856e37736f2410de656bb7ae52ac4786e1
Issue-ID: MULTICLOUD-297
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'windriver/titanium_cloud/vesagent/vesagent_ctrl.py')
-rw-r--r-- | windriver/titanium_cloud/vesagent/vesagent_ctrl.py | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/windriver/titanium_cloud/vesagent/vesagent_ctrl.py b/windriver/titanium_cloud/vesagent/vesagent_ctrl.py index d93ccc22..39c36581 100644 --- a/windriver/titanium_cloud/vesagent/vesagent_ctrl.py +++ b/windriver/titanium_cloud/vesagent/vesagent_ctrl.py @@ -412,6 +412,7 @@ class VesAgentCtrlV1(VesAgentCtrl): self._logger = logger self.proxy_prefix = settings.MULTICLOUD_PREFIX + def get(self, request, cloud_owner="", cloud_region_id=""): ''' :param request: @@ -422,6 +423,34 @@ class VesAgentCtrlV1(VesAgentCtrl): self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) self._logger.debug("with META: %s" % request.META) - #temp realization for API upgrading only, assume cloud_owner does not contains "_" , refactor it later vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) return super(VesAgentCtrlV1,self).get(request, vimid) + + + def post(self, request, cloud_owner="", cloud_region_id=""): + ''' + wrapper for inherited API with VIM ID + :param request: + :param cloud_owner: + :param cloud_region_id: + :return: + ''' + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + self._logger.debug("with META: %s, with data: %s" % (request.META, request.data)) + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(VesAgentCtrlV1,self).post(request, vimid) + + + def delete(self, request, cloud_owner="", cloud_region_id=""): + ''' + wrapper of inherited API with VIM ID + :param request: + :param cloud_owner: + :param cloud_region_id: + :return: + ''' + self._logger.info("cloud_owner,cloud_region_id: %s,%s" % (cloud_owner,cloud_region_id)) + self._logger.debug("with META: %s" % request.META) + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(VesAgentCtrlV1,self).delete(request, vimid) + |