diff options
-rw-r--r-- | vio/vio/swagger/views/hypervisor/views.py | 11 | ||||
-rw-r--r-- | vio/vio/swagger/views/image/views.py | 14 | ||||
-rw-r--r-- | vio/vio/swagger/views/network/views.py | 16 |
3 files changed, 41 insertions, 0 deletions
diff --git a/vio/vio/swagger/views/hypervisor/views.py b/vio/vio/swagger/views/hypervisor/views.py index a027d7c..0f7e1f9 100644 --- a/vio/vio/swagger/views/hypervisor/views.py +++ b/vio/vio/swagger/views/hypervisor/views.py @@ -27,6 +27,17 @@ from vio.swagger import nova_utils class HostView(APIView): def get(self, request, vimid, tenantid, hostname): + if vimid == "vmware_fake": + return Response(data={ + 'vimid': vimid, + 'vimName': vimid, + 'tenantId': tenantid, + 'memory_mb': 196516, + 'name': "domain-c202.22bfc05c-da55-4ba6-ba93-08d9a067138e", + 'disk_gb': 6143, + 'cpu': 48 + }, status=status.HTTP_200_OK) + try: vim_info = extsys.get_vim_by_id(vimid) except VimDriverVioException as e: diff --git a/vio/vio/swagger/views/image/views.py b/vio/vio/swagger/views/image/views.py index 62770c7..a876529 100644 --- a/vio/vio/swagger/views/image/views.py +++ b/vio/vio/swagger/views/image/views.py @@ -28,6 +28,20 @@ from vio.pub.exceptions import VimDriverVioException class GetDeleteImageView(APIView): def get(self, request, vimid, tenantid, imageid): + if vimid == "vmware_fake": + return Response(data={ + "vimid": vimid, + "vimName": vimid, + "tenantId": tenantid, + "status": "active", + "name": "ubuntu-16.04-server-cloudimg-amd64", + "visibility": "public", + "id": "170641db-78cd-49a3-8bab-4cfa3d6ef131", + "size": 10737418240, + "imageType": "vmdk", + "containerFormat": "bare" + }, status=status.HTTP_200_OK) + try: vim_info = extsys.get_vim_by_id(vimid) vim_info['tenant'] = tenantid diff --git a/vio/vio/swagger/views/network/views.py b/vio/vio/swagger/views/network/views.py index 229e9a3..27d0f3a 100644 --- a/vio/vio/swagger/views/network/views.py +++ b/vio/vio/swagger/views/network/views.py @@ -77,6 +77,22 @@ class CreateNetworkView(APIView): class DeleteNetworkView(APIView): def get(self, request, vimid, tenantid, networkid): + if vimid == "vmware_fake": + return Response(data={ + "vimid": vimid, + "vimName": vimid, + "tenantId": tenantid, + "status": "ACTIVE", + "segmentationId": None, + "name": "oam_onap_AQYG", + "physicalNetwork": None, + "shared": False, + "routerExternal": False, + "networkType": None, + "vlanTransparent": False, + "id": "0085970f-a214-4da2-a449-75acfb813fec" + }, status=status.HTTP_200_OK) + logger.info("Enter %s, method is %s, vim_id is %s", syscomm.fun_name(), request.method, vimid) net = OperateNetwork.OperateNetwork() |