diff options
author | Huang Haibin <haibin.huang@intel.com> | 2018-10-15 15:22:03 +0800 |
---|---|---|
committer | Huang Haibin <haibin.huang@intel.com> | 2018-10-15 15:24:15 +0800 |
commit | c7c2c8ac37599655d114a500dfc00aee5d06b48a (patch) | |
tree | fdd71ba57a56674ef2ee8df92efc743d450dd85b /ocata/ocata/resource/views | |
parent | 2ed2f20baa3506804bbdc4516939fad2d7d37487 (diff) |
Upgrade capacity v1 for ocata
Change-Id: I07882e864baa81d4bbc640bcc0652ff69aeff862
Issue-ID: MULTICLOUD-378
Signed-off-by: Huang Haibin <haibin.huang@intel.com>
Diffstat (limited to 'ocata/ocata/resource/views')
-rw-r--r-- | ocata/ocata/resource/views/capacity.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ocata/ocata/resource/views/capacity.py b/ocata/ocata/resource/views/capacity.py index eaf7912f..b9d263e2 100644 --- a/ocata/ocata/resource/views/capacity.py +++ b/ocata/ocata/resource/views/capacity.py @@ -134,3 +134,16 @@ class CapacityCheck(APIView): return Response(data={'result': hasEnoughResource, 'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) +class APIv1CapacityCheck(CapacityCheck): + + def __init__(self): + super(APIv1CapacityCheck, self).__init__() + # self._logger = logger + + def post(self, request, cloud_owner="", cloud_region_id=""): + self._logger.info("vimid, data> %s,%s, %s" % (cloud_owner, cloud_region_id, request.data)) + self._logger.debug("META> %s" % request.META) + + vimid = extsys.encode_vim_id(cloud_owner, cloud_region_id) + return super(APIv1CapacityCheck, self).post(request, vimid) + |