logger.info("request returns with status %s" % resp.status_code)
if resp.status_code == status.HTTP_200_OK:
- logger.debug("with content:%s" % req_resouce)
+ logger.debug("with content:%s" % resp.json())
pass
return resp
logger.info("request returns with status %s" % resp.status_code)
if resp.status_code == status.HTTP_200_OK:
- logger.debug("with content:%s" % req_resouce)
+ logger.debug("with content:%s" % resp.json())
pass
return resp
("container_format", "containerFormat")\r
]\r
\r
- \r
+\r
def get(self, request, vimid="", tenantid="", hypervisorid=""):\r
- logger.debug("hypervisors--get::> %s" % request.data)\r
+ logger.info("vimid, tenantid, hypervisorid = %s,%s,%s" % (vimid, tenantid, hypervisorid))\r
+ if request.data:\r
+ logger.debug("With data = %s" % request.data)\r
+ pass\r
+\r
try:\r
query = VimDriverUtils.get_query_part(request)\r
content, status_code = self.get_hypervisors(query, vimid, tenantid, hypervisorid)\r
+\r
+ logger.info("response with status = %s" % resp.status_code)\r
+\r
return Response(data=content, status=status_code)\r
except VimDriverNewtonException as e:\r
+ logger.error("response with status = %s" % e.status_code)\r
return Response(data={'error': e.content}, status=e.status_code)\r
except HttpError as e:\r
logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))\r
return Response(data={'error': str(e)},\r
status=status.HTTP_500_INTERNAL_SERVER_ERROR)\r
\r
- \r
+\r
def get_hypervisors(self, query="", vimid="", tenantid="", hypervisorid=""):\r
- logger.debug("hypervisors--get::> %s" % hypervisorid)\r
\r
req_resource = "/os-hypervisors"\r
\r
vim = VimDriverUtils.get_vim_info(vimid)\r
vim["domain"] = "Default"\r
sess = VimDriverUtils.get_session(vim, tenantid)\r
+\r
+ logger.info("making request with URI:%s" % req_resouce)\r
+\r
resp = sess.get(req_resource, endpoint_filter = self.service)\r
+\r
+ logger.info("request returns with status %s" % resp.status_code)\r
+ if resp.status_code == status.HTTP_200_OK:\r
+ logger.debug("with content:%s" % resp.json())\r
+ pass\r
+\r
content = resp.json()\r
\r
return content, resp.status_code\r