summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocata/ocata/resource/views/capacity.py13
-rw-r--r--ocata/ocata/urls.py2
2 files changed, 15 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)
+
diff --git a/ocata/ocata/urls.py b/ocata/ocata/urls.py
index 6f68f255..34569968 100644
--- a/ocata/ocata/urls.py
+++ b/ocata/ocata/urls.py
@@ -58,6 +58,8 @@ urlpatterns = [
tenants.APIv1Tenants.as_view()),
url(r'^api/multicloud-ocata/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/'
'(?P<tenantid>[0-9a-zA-Z_-]{20,})/', include('ocata.requests.urlsV1')),
+ url(r'^api/multicloud-ocata/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/capacity_check/?$',
+ capacity.APIv1CapacityCheck.as_view()),
url(r'^api/multicloud-ocata/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload/?$',
infra_workload.APIv1InfraWorkload.as_view()),
url(r'^api/multicloud-ocata/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload/(?P<requri>[0-9a-zA-Z_-]*)/?$',