diff options
-rw-r--r-- | kilo/kilo/requests/views/limits.py | 11 | ||||
-rw-r--r-- | kilo/kilo/swagger/multivim.network.swagger.json | 2 | ||||
-rw-r--r-- | newton/newton/requests/views/limits.py | 11 | ||||
-rw-r--r-- | newton/newton/swagger/multivim.network.swagger.json | 2 |
4 files changed, 24 insertions, 2 deletions
diff --git a/kilo/kilo/requests/views/limits.py b/kilo/kilo/requests/views/limits.py index 2cddfb42..fce584f3 100644 --- a/kilo/kilo/requests/views/limits.py +++ b/kilo/kilo/requests/views/limits.py @@ -34,6 +34,10 @@ class Limits(APIView): 'interface': 'public', 'region_name': 'RegionOne'} + service_volume = {'service_type': 'volumev2', + 'interface': 'public', + 'region_name': 'RegionOne'} + def get(self, request, vimid="", tenantid=""): logger.debug("Limits--get::> %s" % request.data) try: @@ -60,6 +64,13 @@ class Limits(APIView): content = resp.json() content_all.update(content['quota']) + #now get volume limits + # prepare request resource to vim instance + req_resouce = "/limits" + resp = sess.get(req_resouce, endpoint_filter=self.service_volume) + content = resp.json() + content_all.update(content['limits']['absolute']) + return Response(data=content_all, status=resp.status_code) except VimDriverKiloException as e: return Response(data={'error': e.content}, status=e.status_code) diff --git a/kilo/kilo/swagger/multivim.network.swagger.json b/kilo/kilo/swagger/multivim.network.swagger.json index 92794d64..fb8524bc 100644 --- a/kilo/kilo/swagger/multivim.network.swagger.json +++ b/kilo/kilo/swagger/multivim.network.swagger.json @@ -51,7 +51,7 @@ } ], "responses": { - "200": { + "201": { "description": "successful operation", "schema": { "$ref": "#/definitions/VimNetworkInfo" diff --git a/newton/newton/requests/views/limits.py b/newton/newton/requests/views/limits.py index 16c7f72a..33e4af3a 100644 --- a/newton/newton/requests/views/limits.py +++ b/newton/newton/requests/views/limits.py @@ -34,6 +34,10 @@ class Limits(APIView): 'interface': 'public', 'region_name': 'RegionOne'} + service_volume = {'service_type': 'volumev2', + 'interface': 'public', + 'region_name': 'RegionOne'} + def get(self, request, vimid="", tenantid=""): logger.debug("Limits--get::> %s" % request.data) try: @@ -60,6 +64,13 @@ class Limits(APIView): content = resp.json() content_all.update(content['quota']) + #now get volume limits + # prepare request resource to vim instance + req_resouce = "/limits" + resp = sess.get(req_resouce, endpoint_filter=self.service_volume) + content = resp.json() + content_all.update(content['limits']['absolute']) + return Response(data=content_all, status=resp.status_code) except VimDriverNewtonException as e: return Response(data={'error': e.content}, status=e.status_code) diff --git a/newton/newton/swagger/multivim.network.swagger.json b/newton/newton/swagger/multivim.network.swagger.json index 92794d64..fb8524bc 100644 --- a/newton/newton/swagger/multivim.network.swagger.json +++ b/newton/newton/swagger/multivim.network.swagger.json @@ -51,7 +51,7 @@ } ], "responses": { - "200": { + "201": { "description": "successful operation", "schema": { "$ref": "#/definitions/VimNetworkInfo" |