Modified vcd unit tests as per latest pyvcloud changes 00/6200/2
authorkasar <pkasar@vmware.com>
Thu, 24 May 2018 08:51:18 +0000 (01:51 -0700)
committerkasar <pkasar@vmware.com>
Mon, 28 May 2018 11:22:58 +0000 (04:22 -0700)
Change-Id: Id3d39169948bbc6c5933d5955cef02cf3cd5b177
Signed-off-by: kasar <pkasar@vmware.com>
osm_ro/tests/test_vimconn_vmware.py
osm_ro/tests/test_vimconn_vmware_xml_response.py

index a4ebb5c..2c40bd3 100755 (executable)
 
 from osm_ro.vimconn_vmware import vimconnector
 from osm_ro.vimconn import vimconnUnexpectedResponse,vimconnNotFoundException
-from pyvcloud.vcloudair import VCA,VCS
-from pyvcloud.vapp import VAPP
-from pyvcloud import Http
-from pyvcloud.schema.vcd.v1_5.schemas.vcloud import vdcType,networkType,catalogType, \
-                                                    vAppType,taskType
+from pyvcloud.vcd.client import Client
+from lxml import etree as lxmlElementTree
+from pyvcloud.vcd.org import Org
+from pyvcloud.vcd.vdc import VDC
+from pyvcloud.vcd.vapp import VApp
 import unittest
 import mock
 import test_vimconn_vmware_xml_response as xml_resp
 
+__author__ = "Prakash Kasar"
+
 class TestVimconn_VMware(unittest.TestCase):
     def setUp(self):
         config = { "admin_password": "admin",
@@ -41,20 +43,12 @@ class TestVimconn_VMware(unittest.TestCase):
                   "nsx_password": "nsx",
                   "nsx_manager":"https://test-nsx" }
 
-        self.vca = VCA(host='test',
-                       username='user',
-                       service_type='standalone',
-                       version='5.9',
-                       verify=False,
-                       log=False)
-
-        self.session = VCS('https://test/api/session',
-                                               'test',
-                                               'test',
-                                                 None,
-                          'https://test/api/org/a93c',
-                          'https://test/api/org/a93c',
-                                        version='5.9')
+        self.client = Client('test', verify_ssl_certs=False)
+
+        # get vcd org object
+        org_resp = xml_resp.org_xml_response
+        get_org = lxmlElementTree.fromstring(org_resp) 
+        self.org = Org(self.client, resource=get_org)
 
         self.vim = vimconnector(uuid='12354',
                                  name='test',
@@ -66,79 +60,100 @@ class TestVimconn_VMware(unittest.TestCase):
 
     @mock.patch.object(vimconnector,'get_vdc_details')
     @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(VCA,'get_networks')
-    def test_get_network_not_found(self,get_networks, connect, get_vdc_details):
-        vdc_xml_resp = xml_resp.vdc_xml_response
+    @mock.patch.object(vimconnector,'perform_request')
+    def test_get_network_not_found(self, perform_request, connect, get_vdc_details):
+        """
+        Testcase to get network with invalid network id
+        """   
         # created vdc object
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc_xml_resp = xml_resp.vdc_xml_response
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
+
         # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
-        self.vim.vca = self.vim.connect()
-        network_xml_resp = xml_resp.network_xml_response
-        networks = networkType.parseString(network_xml_resp, True)
-        (self.vim.vca).get_networks.return_value = [networks]
+        get_vdc_details.return_value = self.org, vdc
+        self.vim.client = self.vim.connect()
+        perform_request.return_value.status_code = 200
+        perform_request.return_value.content = xml_resp.vdc_xml_response
+
         # call to VIM connector method with invalid id
         self.assertRaises(vimconnNotFoundException,self.vim.get_network,'mgmt-net')
+
+    @mock.patch.object(vimconnector,'perform_request')
     @mock.patch.object(vimconnector,'get_vdc_details')
     @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(VCA,'get_networks')
-    def test_get_network(self,get_networks, connect, get_vdc_details):
+    def test_get_network(self, connect, get_vdc_details, perform_request):
+        """
+        Testcase to get network with valid network id
+        """
         net_id = '5c04dc6d-6096-47c6-b72b-68f19013d491'
-        vdc_xml_resp = xml_resp.vdc_xml_response
         # created vdc object
-        vdc = vdcType.parseString(vdc_xml_resp,True)
-        # created network object
-        network_xml_resp = xml_resp.network_xml_response
-        networks = networkType.parseString(network_xml_resp, True)
-        # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
-        self.vim.vca = self.vim.connect()
+        vdc_xml_resp = xml_resp.vdc_xml_response
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
+
         # assumed return value from VIM connector
-        (self.vim.vca).get_networks.return_value = [networks]
+        get_vdc_details.return_value = self.org, vdc
+        self.vim.client = self.vim.connect()
+        perform_request.side_effect = [mock.Mock(status_code = 200,
+                                       content = xml_resp.vdc_xml_response),
+                                       mock.Mock(status_code = 200,
+                                       content = xml_resp.network_xml_response)]
         # call to VIM connector method with network_id
         result = self.vim.get_network(net_id)
+
         # assert verified expected and return result from VIM connector
         self.assertEqual(net_id, result['id'])
 
+    @mock.patch.object(vimconnector,'perform_request')
     @mock.patch.object(vimconnector,'get_vdc_details')
     @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(VCA,'get_networks')
-    def test_get_network_list_not_found(self,get_networks, connect, get_vdc_details):
+    def test_get_network_list_not_found(self, connect, get_vdc_details, perform_request):
+        """
+        Testcase to get list of available networks by invalid network id 
+        """
         vdc_xml_resp = xml_resp.vdc_xml_response
+        network_xml_resp = xml_resp.network_xml_response
         # created vdc object
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
+
         # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
-        self.vim.vca = self.vim.connect()
+        get_vdc_details.return_value = self.org, vdc
+        self.vim.client = self.vim.connect()
+        perform_request.return_value.status_code = 200
+        perform_request.return_value.content = network_xml_resp
 
-        network_xml_resp = xml_resp.network_xml_response
-        networks = networkType.parseString(network_xml_resp, True)
-        (self.vim.vca).get_networks.return_value = [networks]
         # call to VIM connector method with network_id
         result = self.vim.get_network_list({'id':'45hdfg-345nb-345'})
 
         # assert verified expected and return result from VIM connector
         self.assertEqual(list(), result)
 
+    @mock.patch.object(vimconnector,'perform_request')
     @mock.patch.object(vimconnector,'get_vdc_details')
     @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(VCA,'get_networks')
-    def test_get_network_list(self,get_networks, connect, get_vdc_details):
+    def test_get_network_list(self, connect, get_vdc_details, perform_request):
+        """
+        Testcase to get list of available networks by valid network id
+        """ 
+        #import pdb;pdb.set_trace() ## Not working  
         vdc_xml_resp = xml_resp.vdc_xml_response
         net_id = '5c04dc6d-6096-47c6-b72b-68f19013d491'
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        # created vdc object
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
         # created network object
         network_xml_resp = xml_resp.network_xml_response
-        networks = networkType.parseString(network_xml_resp, True)
-        # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
-        self.vim.vca = self.vim.connect()
         # assumed return value from VIM connector
-        (self.vim.vca).get_networks.return_value = [networks]
+        get_vdc_details.return_value = self.org, vdc
+        self.vim.client = self.vim.connect()
+        perform_request.side_effect = [mock.Mock(status_code = 200,
+                                       content = xml_resp.vdc_xml_response),
+                                       mock.Mock(status_code = 200,
+                                       content = network_xml_resp)]
+        perform_request.reset_mock()
+        perform_request() 
 
         # call to VIM connector method with network_id
         result = self.vim.get_network_list({'id': net_id})
+
         # assert verified expected and return result from VIM connector
         for item in result:
             self.assertEqual(item.get('id'), net_id)
@@ -147,21 +162,30 @@ class TestVimconn_VMware(unittest.TestCase):
 
     @mock.patch.object(vimconnector,'create_network_rest')
     def test_new_network(self, create_network_rest):
+        """
+        Testcase to create new network by passing network name and type
+        """
+        # create network reposnse 
         create_net_xml_resp = xml_resp.create_network_xml_response
         net_name = 'Test_network'
         net_type = 'bridge'
         # assumed return value from VIM connector
         create_network_rest.return_value = create_net_xml_resp
-        # call to VIM connector method with network_id
+        # call to VIM connector method with network name and type
         result = self.vim.new_network(net_name, net_type)
+
         # assert verified expected and return result from VIM connector
         self.assertEqual(result, 'df1956fa-da04-419e-a6a2-427b6f83788f')
 
     @mock.patch.object(vimconnector, 'create_network_rest')
     def test_new_network_not_created(self, create_network_rest):
+        """
+        Testcase to create new network by assigning empty xml data  
+        """
         # assumed return value from VIM connector
         create_network_rest.return_value = """<?xml version="1.0" encoding="UTF-8"?>
                                               <OrgVdcNetwork></OrgVdcNetwork>"""
+                                           
 
         # assert verified expected and return result from VIM connector
         self.assertRaises(vimconnUnexpectedResponse,self.vim.new_network,
@@ -170,23 +194,30 @@ class TestVimconn_VMware(unittest.TestCase):
 
     @mock.patch.object(vimconnector, 'connect')
     @mock.patch.object(vimconnector, 'get_network_action')
-    @mock.patch.object(vimconnector, 'connect_as_admin')
     @mock.patch.object(vimconnector, 'delete_network_action')
-    def test_delete_network(self, delete_network_action, connect_as_admin, get_network_action, connect):
+    def test_delete_network(self, delete_network_action, get_network_action, connect):
+        """
+        Testcase to delete network by network id  
+        """
+        net_uuid = '0a55e5d1-43a2-4688-bc92-cb304046bf87'
+        # delete network response 
         delete_net_xml_resp = xml_resp.delete_network_xml_response
+
         # assumed return value from VIM connector
-        connect.return_value = self.vca
-        self.vim.vca = self.vim.connect()
+        self.vim.client = self.vim.connect()
         get_network_action.return_value = delete_net_xml_resp
-        connect_as_admin.return_value = self.vca
         delete_network_action.return_value = True
         # call to VIM connector method with network_id
-        result = self.vim.delete_network('0a55e5d1-43a2-4688-bc92-cb304046bf87')
+        result = self.vim.delete_network(net_uuid)
+
         # assert verified expected and return result from VIM connector
-        self.assertEqual(result, '0a55e5d1-43a2-4688-bc92-cb304046bf87')
+        self.assertEqual(result, net_uuid)
 
     @mock.patch.object(vimconnector, 'get_vcd_network')
     def test_delete_network_not_found(self, get_vcd_network):
+        """
+        Testcase to delete network by invalid network id  
+        """
         # assumed return value from VIM connector
         get_vcd_network.return_value = False
         # assert verified expected and return result from VIM connector
@@ -194,73 +225,97 @@ class TestVimconn_VMware(unittest.TestCase):
                                     '2a23e5d1-42a2-0648-bc92-cb508046bf87')
 
     def test_get_flavor(self):
+        """
+        Testcase to get flavor data  
+        """
         flavor_data = {'a646eb8a-95bd-4e81-8321-5413ee72b62e': {'disk': 10,
                                                                 'vcpus': 1,
                                                                'ram': 1024}}
         vimconnector.flavorlist = flavor_data
         result = self.vim.get_flavor('a646eb8a-95bd-4e81-8321-5413ee72b62e')
+
         # assert verified expected and return result from VIM connector
         self.assertEqual(result, flavor_data['a646eb8a-95bd-4e81-8321-5413ee72b62e'])
 
     def test_get_flavor_not_found(self):
+        """
+        Testcase to get flavor data with invalid id 
+        """
         vimconnector.flavorlist = {}
         # assert verified expected and return result from VIM connector
         self.assertRaises(vimconnNotFoundException,self.vim.get_flavor,
                                 'a646eb8a-95bd-4e81-8321-5413ee72b62e')
 
     def test_new_flavor(self):
+        """
+        Testcase to create new flavor data
+        """
         flavor_data = {'disk': 10, 'vcpus': 1, 'ram': 1024}
         result = self.vim.new_flavor(flavor_data)
         # assert verified expected and return result from VIM connector
         self.assertIsNotNone(result)
 
     def test_delete_flavor(self):
+        """
+        Testcase to delete flavor data  
+        """
         flavor_data = {'2cb3dffb-5c51-4355-8406-28553ead28ac': {'disk': 10,
                                                                 'vcpus': 1,
                                                                'ram': 1024}}
         vimconnector.flavorlist = flavor_data
         # return value from VIM connector
         result = self.vim.delete_flavor('2cb3dffb-5c51-4355-8406-28553ead28ac')
+
         # assert verified expected and return result from VIM connector
         self.assertEqual(result, '2cb3dffb-5c51-4355-8406-28553ead28ac')
 
     @mock.patch.object(vimconnector,'connect_as_admin')
-    @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(Http,'get')
-    @mock.patch.object(VCS,'get_vcloud_headers')
-    def test_delete_image_not_found(self, get_vcloud_headers, get, connect, connect_as_admin):
-        # assumed return value from VIM connector
-        connect.return_value = self.vca
-        self.vim.vca = self.vim.connect()
+    @mock.patch.object(vimconnector,'perform_request')
+    def test_delete_image_not_found(self, perform_request, connect_as_admin):
+        """
+        Testcase to delete image by invalid image id  
+        """
+        # creating conn object
+        self.vim.client = self.vim.connect_as_admin()
+
         # assumed return value from VIM connector
-        connect_as_admin.return_value = self.vca
-        self.vca.host = connect_as_admin.return_value.host
-        self.vca.vcloud_session = self.session
-        get_vcloud_headers.return_value = {'Accept':'application/*+xml;version=5.9',
-                       'x-vcloud-authorization': '638bfee6cb5f435abc3480f480817254'}
-        get_vcloud_headers.return_value = self.vca.vcloud_session.get_vcloud_headers()
+        perform_request.side_effect = [mock.Mock(status_code = 200,
+                                       content = xml_resp.delete_catalog_xml_response),
+                                       mock.Mock(status_code = 201,
+                                       content = xml_resp.delete_catalog_item_xml_response)
+                                       ]
+
         # assert verified expected and return result from VIM connector
         self.assertRaises(vimconnNotFoundException, self.vim.delete_image, 'invali3453')
 
+    @mock.patch.object(vimconnector,'get_vdc_details')
     @mock.patch.object(vimconnector,'connect')
-    @mock.patch.object(VCA,'get_catalogs')
-    def test_get_image_list(self, get_catalogs, connect):
-        catalog1 = xml_resp.catalog1_xml_response
-        catalog2 = xml_resp.catalog2_xml_response
-
-        catalogs = [catalogType.parseString(cat, True) for cat in catalog1, catalog2]
-        connect.return_value = self.vca
-        self.vim.vca = self.vim.connect()
+    @mock.patch.object(Org,'list_catalogs')
+    def test_get_image_list(self, list_catalogs, connect, get_vdc_details):
+        """
+        Testcase to get image list by valid image id
+        """
+        # created vdc object
+        vdc_xml_resp = xml_resp.vdc_xml_response
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
+        self.vim.client = self.vim.connect()
+
         # assumed return value from VIM connector
-        self.vim.vca.get_catalogs.return_value = catalogs
-        result = self.vim.get_image_list({'id': '32ccb082-4a65-41f6-bcd6-38942e8a3829'})
+        get_vdc_details.return_value = self.org, vdc
+        list_catalogs.return_value = [{'isShared': 'false', 'numberOfVAppTemplates': '1', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2017-10-15T02:03:59.403-07:00', 'id': '34925a30-0f4a-4018-9759-0d6799063b51', 'name': 'Ubuntu_1nic'}, {'isShared': 'false', 'numberOfVAppTemplates': '1', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'orgadmin', 'numberOfMedia': '1', 'creationDate': '2018-02-15T02:16:58.300-08:00', 'id': '4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a', 'name': 'cirros034'}, {'isShared': 'true', 'numberOfVAppTemplates': '1', 'orgName': 'Org3', 'isPublished': 'true', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2018-01-26T02:09:12.387-08:00', 'id': 'b139ed82-7ca4-49fb-9882-5f841f59c890', 'name': 'Ubuntu_plugtest-1'}, {'isShared': 'true', 'numberOfVAppTemplates': '1', 'orgName': 'Org2', 'isPublished': 'false', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2017-06-18T21:33:16.430-07:00', 'id': 'b31e6973-86d2-404b-a522-b16846d099dc', 'name': 'Ubuntu_Cat'}, {'isShared': 'false', 'numberOfVAppTemplates': '1', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'orgadmin', 'numberOfMedia': '0', 'creationDate': '2018-02-15T22:26:28.910-08:00', 'id': 'c3b56180-f980-4256-9109-a93168d73ff2', 'name': 'de4ffcf2ad21f1a5d0714d6b868e2645'}, {'isShared': 'false', 'numberOfVAppTemplates': '0', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2017-08-23T05:54:56.780-07:00', 'id': 'd0eb0b02-718d-42e0-b889-56575000b52d', 'name': 'Test_Cirros'}, {'isShared': 'false', 'numberOfVAppTemplates': '0', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2017-03-08T21:25:05.923-08:00', 'id': 'd3fa3df2-b311-4571-9138-4c66541d7f46', 'name': 'cirros_10'}, {'isShared': 'false', 'numberOfVAppTemplates': '0', 'orgName': 'Org3', 'isPublished': 'false', 'ownerName': 'system', 'numberOfMedia': '0', 'creationDate': '2017-07-12T22:45:20.537-07:00', 'id': 'd64b2617-ea4b-4b90-910b-102c99dd2031', 'name': 'Ubuntu16'}, {'isShared': 'true', 'numberOfVAppTemplates': '1', 'orgName': 'Org3', 'isPublished': 'true', 'ownerName': 'system', 'numberOfMedia': '1', 'creationDate': '2017-10-14T23:52:37.260-07:00', 'id': 'e8d953db-8dc9-46d5-9cab-329774cd2ad9', 'name': 'Ubuntu_no_nic'}]
+        result = self.vim.get_image_list({'id': '4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a'})
+
         # assert verified expected and return result from VIM connector
         for item in result:
-            self.assertEqual(item['id'], '32ccb082-4a65-41f6-bcd6-38942e8a3829')
+            self.assertEqual(item['id'], '4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a')
 
     @mock.patch.object(vimconnector,'get_vapp_details_rest')
     @mock.patch.object(vimconnector,'get_vdc_details')
     def test_get_vminstance(self, get_vdc_details, get_vapp_details_rest):
+        """
+        Testcase to get vminstance by valid vm id
+        """
         vapp_info = {'status': '4',
                    'acquireMksTicket': {'href': 'https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/screen/action/acquireMksTicket',
                    'type': 'application/vnd.vmware.vcloud.mksTicket+xml', 'rel': 'screen:acquireMksTicket'},
@@ -289,9 +344,9 @@ class TestVimconn_VMware(unittest.TestCase):
                    'deployed': 'true'} 
         # created vdc object
         vdc_xml_resp = xml_resp.vdc_xml_response
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
         # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
+        get_vdc_details.return_value = self.org, vdc
         get_vapp_details_rest.return_value = vapp_info
 
         result = self.vim.get_vminstance('47d12505-5968-4e16-95a7-18743edb0c8b')
@@ -299,52 +354,88 @@ class TestVimconn_VMware(unittest.TestCase):
         self.assertEqual(result['status'], 'ACTIVE')
         self.assertEqual(result['hostId'], '47d12505-5968-4e16-95a7-18743edb0c8b')
 
-    @mock.patch.object(VCA,'get_vapp')
+
     @mock.patch.object(vimconnector,'connect')
     @mock.patch.object(vimconnector,'get_namebyvappid')
     @mock.patch.object(vimconnector,'get_vdc_details')
-    def test_delete_vminstance(self, get_vdc_details, get_namebyvappid, connect, vapp):
+    @mock.patch.object(VDC,'get_vapp')
+    @mock.patch.object(VApp,'power_off')
+    @mock.patch.object(VApp,'undeploy')
+    @mock.patch.object(VDC,'delete_vapp')
+    @mock.patch.object(Client,'get_task_monitor')
+    def test_delete_vminstance(self, get_task_monitor, delete_vapp,
+                                               undeploy, poweroff,
+                                         get_vapp, get_vdc_details,
+                                        get_namebyvappid, connect):
+        """
+        Testcase to delete vminstance by valid vm id
+        """
         vm_id = '4f6a9b49-e92d-4935-87a1-0e4dc9c3a069'
         vm_name = 'Test1_vm-69a18104-8413-4cb8-bad7-b5afaec6f9fa'
         # created vdc object
         vdc_xml_resp = xml_resp.vdc_xml_response
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
+
         # assumed return value from VIM connector
-        connect.return_value = self.vca
-        self.vim.vca = self.vim.connect()
+        self.vim.client = self.vim.connect()
+        get_vdc_details.return_value = self.org, vdc 
         get_namebyvappid.return_name = vm_name
-        vapp.return_value = None
+
+        vapp_resp = xml_resp.vapp_xml_response
+        vapp = lxmlElementTree.fromstring(vapp_resp) 
+        get_vapp.return_value = vapp
+        
+        power_off_resp = xml_resp.poweroff_task_xml
+        power_off = lxmlElementTree.fromstring(power_off_resp)
+        poweroff.return_value = power_off
+
+        status_resp = xml_resp.status_task_xml 
+        status = lxmlElementTree.fromstring(status_resp)
+        self.vim.connect.return_value.get_task_monitor.return_value.wait_for_success.return_value = status
+
         # call to VIM connector method
         result = self.vim.delete_vminstance(vm_id)
+
         # assert verified expected and return result from VIM connector
         self.assertEqual(result, vm_id)
 
     @mock.patch.object(vimconnector,'get_network_id_by_name')
     @mock.patch.object(vimconnector,'get_vm_pci_details')
-    @mock.patch.object(VCA,'get_vapp')
+    @mock.patch.object(VDC,'get_vapp')
     @mock.patch.object(vimconnector,'connect')
     @mock.patch.object(vimconnector,'get_namebyvappid')
     @mock.patch.object(vimconnector,'get_vdc_details')
-    def test_refresh_vms_status(self, get_vdc_details, get_namebyvappid, connect,
-                                                    get_vapp, get_vm_pci_details,
-                                                         get_network_id_by_name):
-        headers = {'Accept':'application/*+xml;version=5.9',
-                       'x-vcloud-authorization': '638bfee6cb5f435abc3480f480817254'}
-        vm_id = '05e6047b-6938-4275-8940-22d1ea7245b8'
+    @mock.patch.object(vimconnector,'perform_request')
+    @mock.patch.object(VApp,'get_all_vms')
+    def test_refresh_vms_status(self, get_all_vms, perform_request, get_vdc_details,
+                                                          get_namebyvappid, connect,
+                                                       get_vapp, get_vm_pci_details,
+                                                            get_network_id_by_name):
+        """
+        Testcase to refresh vms status by valid vm id
+        """ 
+        vm_id = '53a529b2-10d8-4d56-a7ad-8182acdbe71c'
 
-        vapp_resp = xml_resp.vapp_xml_response
         # created vdc object
         vdc_xml_resp = xml_resp.vdc_xml_response
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)    
         # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
-        connect.return_value = self.vca
+        self.vim.client = self.vim.connect()
+        get_vdc_details.return_value = self.org, vdc
 
-        self.vim.vca = self.vim.connect()
         get_namebyvappid.return_value = 'Test1_vm-69a18104-8413-4cb8-bad7-b5afaec6f9fa'
         get_vm_pci_details.return_value = {'host_name': 'test-esx-1.corp.local', 'host_ip': '12.19.24.31'}
-        get_vapp.return_value = VAPP(vAppType.parseString(vapp_resp, True), headers, False)
+        vapp_resp = xml_resp.vapp_xml_response
+        vapp = lxmlElementTree.fromstring(vapp_resp)
+        get_vapp.return_value = vapp 
         get_network_id_by_name.return_value = '47d12505-5968-4e16-95a7-18743edb0c8b'
+
+        vm_resp = xml_resp.vm_xml_response
+        vm_list = lxmlElementTree.fromstring(vm_resp)
+        get_all_vms.return_value = vm_list
+          
+        perform_request.return_value.status_code = 200
+        perform_request.return_value.content = vm_resp
         # call to VIM connector method
         result = self.vim.refresh_vms_status([vm_id])
         for attr in result[vm_id]:
@@ -373,25 +464,64 @@ class TestVimconn_VMware(unittest.TestCase):
             if attr == 'status':
                 self.assertEqual(result[net_id][attr], 'ACTIVE')
 
-    @mock.patch.object(VCA,'block_until_completed')
-    @mock.patch.object(VCA,'get_vapp')
+    @mock.patch.object(VDC,'get_vapp')
     @mock.patch.object(vimconnector,'connect')
     @mock.patch.object(vimconnector,'get_namebyvappid')
     @mock.patch.object(vimconnector,'get_vdc_details')
-    def test_action_vminstance(self, get_vdc_details, get_namebyvappid, connect, get_vapp, block):
-        task_resp = xml_resp.task_xml
+    def test_action_vminstance(self, get_vdc_details, get_namebyvappid,
+                                                               connect,
+                                                             get_vapp):
+        """
+        Testcase for action vm instance by vm id
+        """
+        task_resp = xml_resp.poweroff_task_xml
         vm_id = '05e6047b-6938-4275-8940-22d1ea7245b8'
         # created vdc object
         vdc_xml_resp = xml_resp.vdc_xml_response
-        vdc = vdcType.parseString(vdc_xml_resp,True)
+        vdc = lxmlElementTree.fromstring(vdc_xml_resp)
         # assumed return value from VIM connector
-        get_vdc_details.return_value = vdc
+        get_vdc_details.return_value = self.org, vdc
         get_namebyvappid.return_value = 'Test1_vm-69a18104-8413-4cb8-bad7-b5afaec6f9fa'
-        connect.return_value = self.vca
-        self.vim.vca = self.vim.connect()
-        get_vapp.return_value.undeploy.return_value = taskType.parseString(task_resp, True)
-        block.return_value = True
+        self.vim.client = self.vim.connect()
+        power_off_resp = xml_resp.poweroff_task_xml
+        power_off = lxmlElementTree.fromstring(power_off_resp) 
+        get_vapp.return_value.undeploy.return_value = power_off
+
+        status_resp = xml_resp.status_task_xml
+        status = lxmlElementTree.fromstring(status_resp)
+        self.vim.connect.return_value.get_task_monitor.return_value.wait_for_success.return_value = status
+
         # call to VIM connector method
         result = self.vim.action_vminstance(vm_id,{'shutdown': None})
+
+        # assert verified expected and return result from VIM connector
+        self.assertEqual(result, vm_id)
+
+    @mock.patch.object(vimconnector,'get_org')
+    def test_get_tenant_list(self, get_org):
+        """
+        Test case for get tenant list     
+        """
+        org_dict = {'catalogs': {'4c4fdb5d-0c7d-4fee-9efd-cb061f327a01': '80d8488f67ba1de98b7f485fba6abbd2', '1b98ca02-b0a6-4ca7-babe-eadc0ae59677': 'Ubuntu', 'e7f27dfe-14b7-49e1-918e-173bda02683a': '834bdd1f28fd15dcbe830456ec58fbca', '9441ee69-0486-4438-ac62-8d8082c51302': 'centos', 'e660cce0-47a6-4315-a5b9-97a39299a374': 'cirros01', '0fd96c61-c3d1-4abf-9a34-0dff8fb65743': 'cirros034', '1c703be3-9bd2-46a2-854c-3e678d5cdda8': 'Ubuntu_plugtest-1', 'bc4e342b-f84c-41bd-a93a-480f35bacf69': 'Cirros', '8a206fb5-3ef9-4571-9bcc-137615f4d930': '255eb079a62ac155e7f942489f14b0c4'}, 'vdcs': {'e6436c6a-d922-4b39-9c1c-b48e766fce5e': 'osm', '3852f762-18ae-4833-a229-42684b6e7373': 'cloud-1-vdc'}, 'networks': {'e203cacd-9320-4422-9be0-12c7def3ab56': 'testing_lNejr37B-38e4ca67-1e26-486f-ad2f-f14bb099e068', 'a6623349-2bef-4367-9fda-d33f9ab927f8': 'Vlan_3151', 'adf780cb-358c-47c2-858d-ae5778ccaf17': 'testing_xwBultc-99b8a2ae-c091-4dd3-bbf7-762a51612385', '721f9efc-11fe-4c13-936d-252ba0ed93c8': 'testing_tLljy8WB5e-a898cb28-e75b-4867-a22e-f2bad285c144', '1512d97a-929d-4b06-b8af-cf5ac42a2aee': 'Managment', 'd9167301-28af-4b89-b9e0-09f612e962fa': 'testing_prMW1VThk-063cb428-eaee-44b8-9d0d-df5fb77a5b4d', '004ae853-f899-43fd-8981-7513a3b40d6b': 'testing_RTtKVi09rld-fab00b16-7996-49af-8249-369c6bbfa02d'}}
+        tenant_name = 'osm'
+        get_org.return_value = org_dict
+
+        # call to VIM connector method  
+        results = self.vim.get_tenant_list({'name' : tenant_name})
+        # assert verified expected and return result from VIM connector  
+        for result in results: 
+            self.assertEqual(tenant_name,result['name'])
+
+    @mock.patch.object(vimconnector,'get_org')
+    def test_get_tenant_list_negative(self, get_org):
+        """
+        Test case for get tenant list negative
+        """
+        org_dict = {'vdcs': {}}
+        tenant_name = 'testosm'
+        get_org.return_value = org_dict
+
+        # call to VIM connector method
+        results = self.vim.get_tenant_list({'name' : tenant_name})
         # assert verified expected and return result from VIM connector
-        self.assertEqual(result, None)
+        self.assertEqual(results, [])
index 4179324..2e82d02 100644 (file)
@@ -99,33 +99,33 @@ vdc_xml_response = """<?xml version="1.0" encoding="UTF-8"?>
         </Vdc>"""\r
 \r
 network_xml_response = """<?xml version="1.0" encoding="UTF-8"?>\r
-            <OrgVdcNetwork xmlns="http://www.vmware.com/vcloud/v1.5" status="1" name="testing_6XXftDTroat1-03b18565-de01-4154-af51-8dbea42f0d84" id="urn:vcloud:network:5c04dc6d-6096-47c6-b72b-68f19013d491" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491" type="application/vnd.vmware.vcloud.orgVdcNetwork+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
-            <Link rel="up" href="https://localhost/api/vdc/2584137f-6541-4c04-a2a2-e56bfca14c69" type="application/vnd.vmware.vcloud.vdc+xml"/>\r
-            <Link rel="down" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
-            <Link rel="down" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491/allocatedAddresses/" type="application/vnd.vmware.vcloud.allocatedNetworkAddress+xml"/>\r
-            <Description>Openmano created</Description>\r
-            <Configuration>\r
-            <IpScopes>\r
-            <IpScope>\r
-            <IsInherited>true</IsInherited>\r
-            <Gateway>12.169.24.23</Gateway>\r
-            <Netmask>255.255.255.0</Netmask>\r
-            <Dns1>12.169.24.102</Dns1>\r
-            <DnsSuffix>corp.local</DnsSuffix>\r
-            <IsEnabled>true</IsEnabled>\r
-            <IpRanges>\r
-            <IpRange>\r
-            <StartAddress>12.169.24.115</StartAddress>\r
-            <EndAddress>12.169.241.150</EndAddress>\r
-            </IpRange>\r
-            </IpRanges>\r
-            </IpScope>\r
-            </IpScopes>\r
-            <FenceMode>bridged</FenceMode>\r
-            <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>\r
-            </Configuration>\r
-            <IsShared>false</IsShared>\r
-            </OrgVdcNetwork>"""\r
+             <OrgVdcNetwork xmlns="http://www.vmware.com/vcloud/v1.5" status="1" name="testing_6XXftDTroat1-03b18565-de01-4154-af51-8dbea42f0d84" id="urn:vcloud:network:5c04dc6d-6096-47c6-b72b-68f19013d491" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491" type="application/vnd.vmware.vcloud.orgVdcNetwork+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+             <Link rel="up" href="https://localhost/api/vdc/2584137f-6541-4c04-a2a2-e56bfca14c69" type="application/vnd.vmware.vcloud.vdc+xml"/>\r
+             <Link rel="down" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
+             <Link rel="down" href="https://localhost/api/network/5c04dc6d-6096-47c6-b72b-68f19013d491/allocatedAddresses/" type="application/vnd.vmware.vcloud.allocatedNetworkAddress+xml"/>\r
+             <Description>Openmano created</Description>\r
+             <Configuration>\r
+             <IpScopes>\r
+             <IpScope>\r
+             <IsInherited>true</IsInherited>\r
+             <Gateway>12.169.24.23</Gateway>\r
+             <Netmask>255.255.255.0</Netmask>\r
+             <Dns1>12.169.24.102</Dns1>\r
+             <DnsSuffix>corp.local</DnsSuffix>\r
+             <IsEnabled>true</IsEnabled>\r
+             <IpRanges>\r
+             <IpRange>\r
+             <StartAddress>12.169.24.115</StartAddress>\r
+             <EndAddress>12.169.241.150</EndAddress>\r
+             </IpRange>\r
+             </IpRanges>\r
+             </IpScope>\r
+             </IpScopes>\r
+             <FenceMode>bridged</FenceMode>\r
+             <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>\r
+             </Configuration>\r
+             <IsShared>false</IsShared>\r
+             </OrgVdcNetwork>"""\r
 \r
 delete_network_xml_response = """<?xml version="1.0" encoding="UTF-8"?>\r
             <OrgVdcNetwork xmlns="http://www.vmware.com/vcloud/v1.5" status="1" name="testing_negjXxdlB-7fdcf9f3-de32-4ae6-b9f9-fb725a80a74f" id="urn:vcloud:network:0a55e5d1-43a2-4688-bc92-cb304046bf87" href="https://localhost/api/network/0a55e5d1-43a2-4688-bc92-cb304046bf87" type="application/vnd.vmware.vcloud.orgVdcNetwork+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
@@ -292,5 +292,336 @@ vapp_xml_response = """<?xml version="1.0" encoding="UTF-8"?>
 <Link rel="down" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
 <Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/><Link rel="down" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/media" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/><Link rel="down" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/><Link rel="down" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/></ovf:VirtualHardwareSection><ovf:OperatingSystemSection xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" ovf:id="94" vcloud:type="application/vnd.vmware.vcloud.operatingSystemSection+xml" vmw:osType="ubuntu64Guest" vcloud:href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/operatingSystemSection/"><ovf:Info>Specifies the operating system installed</ovf:Info><ovf:Description>Ubuntu Linux (64-bit)</ovf:Description><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/operatingSystemSection/" type="application/vnd.vmware.vcloud.operatingSystemSection+xml"/></ovf:OperatingSystemSection><NetworkConnectionSection href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml" ovf:required="false"><ovf:Info>Specifies the available VM network connections</ovf:Info><PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex><NetworkConnection needsCustomization="false" network="testing_T6nODiW4-68f68d93-0350-4d86-b40b-6e74dedf994d">    <NetworkConnectionIndex>0</NetworkConnectionIndex>    <IpAddress>12.19.21.20</IpAddress>    <IsConnected>true</IsConnected>    <MACAddress>00:50:56:01:12:a2</MACAddress>    <IpAddressAllocationMode>DHCP</IpAddressAllocationMode></NetworkConnection><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml"/></NetworkConnectionSection><GuestCustomizationSection href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" ovf:required="false"><ovf:Info>Specifies Guest OS Customization Settings</ovf:Info><Enabled>true</Enabled><ChangeSid>false</ChangeSid><VirtualMachineId>47d12505-5968-4e16-95a7-18743edb0c8b</VirtualMachineId><JoinDomainEnabled>false</JoinDomainEnabled><UseOrgSettings>false</UseOrgSettings><AdminPasswordEnabled>false</AdminPasswordEnabled><AdminPasswordAuto>true</AdminPasswordAuto><AdminAutoLogonEnabled>false</AdminAutoLogonEnabled><AdminAutoLogonCount>0</AdminAutoLogonCount><ResetPasswordRequired>false</ResetPasswordRequired><ComputerName>Ubuntu-vm-001</ComputerName><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml"/></GuestCustomizationSection><RuntimeInfoSection xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" vcloud:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" vcloud:href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/runtimeInfoSection"><ovf:Info>Specifies Runtime info</ovf:Info><VMWareTools version="2147483647"/></RuntimeInfoSection><SnapshotSection href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/snapshotSection" type="application/vnd.vmware.vcloud.snapshotSection+xml" ovf:required="false"><ovf:Info>Snapshot information section</ovf:Info></SnapshotSection><DateCreated>2017-09-21T01:15:53.863-07:00</DateCreated><VAppScopedLocalId>Ubuntu-vm</VAppScopedLocalId><ovfenv:Environment xmlns:ns11="http://www.vmware.com/schema/ovfenv" ovfenv:id="" ns11:vCenterId="vm-7833"><ovfenv:PlatformSection>    <ovfenv:Kind>VMware ESXi</ovfenv:Kind>    <ovfenv:Version>6.0.0</ovfenv:Version>    <ovfenv:Vendor>VMware, Inc.</ovfenv:Vendor>    <ovfenv:Locale>en</ovfenv:Locale></ovfenv:PlatformSection><ovfenv:PropertySection>    <ovfenv:Property ovfenv:key="vCloud_UseSysPrep" ovfenv:value="None"/>    <ovfenv:Property ovfenv:key="vCloud_bitMask" ovfenv:value="1"/>    <ovfenv:Property ovfenv:key="vCloud_bootproto_0" ovfenv:value="dhcp"/>    <ovfenv:Property ovfenv:key="vCloud_computerName" ovfenv:value="Ubuntu-vm-001"/>    <ovfenv:Property ovfenv:key="vCloud_macaddr_0" ovfenv:value="00:50:56:01:12:a2"/>    <ovfenv:Property ovfenv:key="vCloud_markerid" ovfenv:value="c743cbe8-136e-4cf8-9e42-b291646b8058"/>    <ovfenv:Property ovfenv:key="vCloud_numnics" ovfenv:value="1"/>    <ovfenv:Property ovfenv:key="vCloud_primaryNic" ovfenv:value="0"/>    <ovfenv:Property ovfenv:key="vCloud_reconfigToken" ovfenv:value="246124151"/>    <ovfenv:Property ovfenv:key="vCloud_resetPassword" ovfenv:value="0"/></ovfenv:PropertySection><ve:EthernetAdapterSection xmlns:ve="http://www.vmware.com/schema/ovfenv" xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1">    <ve:Adapter ve:mac="00:50:56:01:12:a2" ve:network="DPG-MGMT-3151" ve:unitNumber="7"/></ve:EthernetAdapterSection></ovfenv:Environment><VmCapabilities href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml"><Link rel="edit" href="https://localhost/api/vApp/vm-47d12505-5968-4e16-95a7-18743edb0c8b/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml"/><MemoryHotAddEnabled>false</MemoryHotAddEnabled><CpuHotAddEnabled>false</CpuHotAddEnabled></VmCapabilities><StorageProfile href="https://localhost/api/vdcStorageProfile/950701fb-2b8a-4808-80f1-27d1170a2bfc" name="*" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/></Vm></Children></VApp>"""\r
 \r
-task_xml = """<?xml version="1.0" encoding="UTF-8"?>\r
-        <Task xmlns="http://www.vmware.com/vcloud/v1.5" cancelRequested="false" expiryTime="2017-12-22T23:18:23.040-08:00" operation="Powering Off Virtual Application Test1_vm-f370dafc-4aad-4415-bad9-68509dda67c9(f26ebf0a-f675-4622-83a6-64c6401769ac)" operationName="vappPowerOff" serviceNamespace="com.vmware.vcloud" startTime="2017-09-23T23:18:23.040-07:00" status="queued" name="task" id="urn:vcloud:task:26975b6e-310e-4ed9-914e-ba7051eaabcb" href="https://localhost/api/task/26975b6e-310e-4ed9-914e-ba7051eaabcb" type="application/vnd.vmware.vcloud.task+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd"><Owner href="https://localhost/api/vApp/vapp-f26ebf0a-f675-4622-83a6-64c6401769ac" name="Test1_vm-f370dafc-4aad-4415-bad9-68509dda67c9" type="application/vnd.vmware.vcloud.vApp+xml"/><User href="https://localhost/api/admin/user/f7b6beba-96db-4674-b187-675ed1873c8c" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/><Organization href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" name="Org3" type="application/vnd.vmware.vcloud.org+xml"/><Details/></Task>"""\r
+poweroff_task_xml = """<?xml version="1.0" encoding="UTF-8"?>\r
+                <Task xmlns="http://www.vmware.com/vcloud/v1.5" cancelRequested="false" expiryTime="2017-12-22T23:18:23.040-08:00" operation="Powering Off Virtual Application Test1_vm-f370dafc-4aad-4415-bad9-68509dda67c9(f26ebf0a-f675-4622-83a6-64c6401769ac)" operationName="vappPowerOff" serviceNamespace="com.vmware.vcloud" startTime="2017-09-23T23:18:23.040-07:00" status="queued" name="task" id="urn:vcloud:task:26975b6e-310e-4ed9-914e-ba7051eaabcb" href="https://localhost/api/task/26975b6e-310e-4ed9-914e-ba7051eaabcb" type="application/vnd.vmware.vcloud.task+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+               <Owner href="https://localhost/api/vApp/vapp-f26ebf0a-f675-4622-83a6-64c6401769ac" name="Test1_vm-f370dafc-4aad-4415-bad9-68509dda67c9" type="application/vnd.vmware.vcloud.vApp+xml"/>\r
+               <User href="https://localhost/api/admin/user/f7b6beba-96db-4674-b187-675ed1873c8c" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/>\r
+               <Organization href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" name="Org3" type="application/vnd.vmware.vcloud.org+xml"/>\r
+               <Details/>\r
+               </Task>"""\r
+\r
+org_xml_response = """<Org xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Org3" id="urn:vcloud:org:2cb3dffb-5c51-4355-8406-28553ead28ac" href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" type="application/vnd.vmware.vcloud.org+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Link rel="down" href="https://localhost/api/vdc/216648ae-1b91-412b-b821-e4c301ff27d2" name="osm" type="application/vnd.vmware.vcloud.vdc+xml"/>\r
+<Link rel="down" href="https://localhost/api/vdc/2584137f-6541-4c04-a2a2-e56bfca14c69" name="Org3-VDC-PVDC1" type="application/vnd.vmware.vcloud.vdc+xml"/>\r
+<Link rel="down" href="https://localhost/api/vdc/414fdda9-3556-478c-a496-2deeec39cd30" name="osm1" type="application/vnd.vmware.vcloud.vdc+xml"/>\r
+<Link rel="down" href="https://localhost/api/tasksList/2cb3dffb-5c51-4355-8406-28553ead28ac" type="application/vnd.vmware.vcloud.tasksList+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a" name="cirros034" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/4b94b67e-c2c6-49ec-b46c-3f35ba45ca4a/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/34925a30-0f4a-4018-9759-0d6799063b51" name="Ubuntu_1nic" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/34925a30-0f4a-4018-9759-0d6799063b51/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/34925a30-0f4a-4018-9759-0d6799063b51/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d3fa3df2-b311-4571-9138-4c66541d7f46" name="cirros_10" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d3fa3df2-b311-4571-9138-4c66541d7f46/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/d3fa3df2-b311-4571-9138-4c66541d7f46/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d0eb0b02-718d-42e0-b889-56575000b52d" name="Test_Cirros" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d0eb0b02-718d-42e0-b889-56575000b52d/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/d0eb0b02-718d-42e0-b889-56575000b52d/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/c3b56180-f980-4256-9109-a93168d73ff2" name="de4ffcf2ad21f1a5d0714d6b868e2645" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/c3b56180-f980-4256-9109-a93168d73ff2/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/c3b56180-f980-4256-9109-a93168d73ff2/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/b139ed82-7ca4-49fb-9882-5f841f59c890" name="Ubuntu_plugtest-1" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/b139ed82-7ca4-49fb-9882-5f841f59c890/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/b139ed82-7ca4-49fb-9882-5f841f59c890/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/e8d953db-8dc9-46d5-9cab-329774cd2ad9" name="Ubuntu_no_nic" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/e8d953db-8dc9-46d5-9cab-329774cd2ad9/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/e8d953db-8dc9-46d5-9cab-329774cd2ad9/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/b31e6973-86d2-404b-a522-b16846d099dc" name="Ubuntu_Cat" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/b31e6973-86d2-404b-a522-b16846d099dc/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d64b2617-ea4b-4b90-910b-102c99dd2031" name="Ubuntu16" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/d64b2617-ea4b-4b90-910b-102c99dd2031/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/d64b2617-ea4b-4b90-910b-102c99dd2031/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="add" href="https://localhost/api/admin/org/2cb3dffb-5c51-4355-8406-28553ead28ac/catalogs" type="application/vnd.vmware.admin.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/090ffa68-9be6-4d74-af45-9a071544a633" name="default.cirros_ns.cirros_nsd_vld1-73a7d683-af17-49ff-95d3-72f8feb25537" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/17f3a12f-16f8-44a1-99e9-9a0122a7ac41" name="default.ass.management-3979591d-ea4e-4254-b4c4-4052107e4aca" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/326aee79-4f5c-439c-8ead-1bbfa42d2e51" name="default.Testvm11.management-fe46ba91-3b36-4964-9ad2-e91b475b3d23" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/420c24c7-89e9-49e5-ba6d-d21bfb9af94b" name="cirros_nsd_vld1-ea8aec47-0a6c-4fdb-814f-7a743e31407a" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/42cba4fd-7baa-4f53-bda0-b36dada672d0" name="default.cirros_ns.cirros_nsd_vld1-44dff01a-2bdb-4096-a916-7e9826bfa401" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/4ae9fec5-7ed0-4d5e-b0f3-f5289bdf6471" name="default.cirros_ns.cirros_nsd_vld1-9f547589-37b7-4d7d-8890-8d3dd479ff5b" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/4b2ecfa9-6a70-4fe4-9d79-b3f74df91e85" name="default.cirros_ns.cirros_nsd_vld1-43852bce-6109-4949-b63a-deec9d7daab2" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/693f72af-ae42-42e5-956e-25723628bf26" name="default.cirros_ns.cirros_nsd_vld1-8cd70d26-ba81-4a04-aa82-67a994b3e21c" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/6d9fbd4c-f0b9-4033-a13f-a7c8990b01de" name="default.vcd.management-f05b9ad3-7480-4ee6-ab8d-92b1f3c0b265" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/6e3e9f57-cee4-433a-883b-0bbe9760e99d" name="default" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/7787cdd7-9577-4966-ba72-8fbbff5d2553" name="default.cirros_ns.cirros_nsd_vld1-ab1f2288-ff59-488c-af02-c8d5e34e0847" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/7fa723e3-cd6c-4680-9522-e644eb31a188" name="default.cirros_ns.cirros_nsd_vld1-285865bb-736c-4b3d-8618-d755928daf5c" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/9030a222-4562-43a0-abc6-aa60c7c1aae0" name="default.cirros_ns.cirros_nsd_vld1-57248151-de72-4313-a84f-b090d8c3feb8" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/a4bd508c-1325-41b0-8c25-61cb7b83cde7" name="default.cirros_ns.cirros_nsd_vld1-491dfb8d-6b4b-41ab-b3e8-a5148e110bba" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/a719292f-0a7f-4e03-a346-183f23f3e60c" name="default.cirros_ns.cirros_nsd_vld1-7ba57204-eed1-4dc8-8698-60a71bbae715" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/a73574ef-16d4-4357-adbf-a0997eb5eb75" name="default.cirros_ns.cirros_nsd_vld1-4430f367-3fc8-4367-9bf1-96dbc244abe6" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/a94e9ba0-e959-47d6-87c0-70e8cb1b485a" name="default.cirros_ns.cirros_nsd_vld1-c56c51c5-e5a8-44fe-9d36-1f2cbd9a7137" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/ab88a587-ff82-4fa7-8225-c0e3eddbf6e6" name="cirros_nsd_vld1-0ed4b7e9-dd56-4f8b-b92f-829b9de95f66" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/b141d722-c96b-4ac5-90da-3d407d376431" name="cirros_nsd_vld1-ad2ebea3-7a0b-4995-91bb-c16bc6fd4b0e" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/c4d61fd6-4d1e-446c-949f-9eb42e0ccc63" name="default.cirros_ns.cirros_nsd_vld1-021a0669-1833-4a0b-a782-30ceed2cca7a" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/cd466f6f-fdc5-404a-9136-320aaa9e3c16" name="default.cirros_ns.cirros_nsd_vld1-22e6962e-6488-47ad-bfad-41bc599abfcd" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/cde04227-8f87-4956-b1f1-9f1be1241b8b" name="default.cirros_ns.cirros_nsd_vld1-629da038-a216-48c5-9ae2-aa4d5dea057c" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/e9812bec-ded8-423d-9807-354adc5720aa" name="default.cirros_ns.cirros_nsd_vld1-ba7fcc4f-fa76-49b1-8fa0-2b0791141fdd" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/eec8ef17-e379-4e40-a743-4ecec6afe616" name="cirros_nsd_vld1-aa9832d6-7d7a-4ac9-be56-cd171063818b" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/ef16d51c-3a54-4eea-bc15-9aa1e92b140f" name="default.cirros_ns.cirros_nsd_vld1-fe7170ad-0b0a-491d-b585-4de31e758ad7" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/f1554f21-4a7b-40be-9a34-a1b640c13398" name="default.Test21.cirros_nsd_vld1-c8f2b860-6794-4c8e-9a5b-3f107f23bbc4" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/fcbbf40a-6578-4054-b496-f10504b94b21" name="default.cirros_ns.cirros_nsd_vld1-a3021c0f-a0fe-413d-9067-cb9182e1f614" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/1fd6421e-929a-4576-bc19-a0c48aea1969" name="default" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/41b8a539-6927-4ec4-a411-aedae8129c45" name="test001.vld2-name-e34e32fd-6d3f-4d24-9d29-e8dab46e515a" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/437258c7-a221-48cd-b889-d24b2fc15087" name="Mgmt-Network-3151" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/bfd56159-9178-4021-a5d8-9ec050569b0c" name="test001.net_internal_name-34602686-3619-4356-98e9-27f6e13e84ad" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/08a0276e-d0fb-4223-92ae-003857ccd38f" name="pytest-09/20/17-05:26:01-cirros_nsd.cirros_nsd_vld1-d6688412-e82a-4cf7-aa77-400beb70dbbf" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/294f2cba-9a81-49c5-bb73-fdaa6644c6ec" name="pytest-09/20/17-03:47:31-cirros_nsd.cirros_nsd_vld1-bd7e8e04-d075-4851-b550-0cf9737c7c8d" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/network/d660e25b-8049-4e8f-a4b8-6811465197d7" name="Ns1.mgmt-dee74b34-51a5-4caa-aafe-d0c896e53828" type="application/vnd.vmware.vcloud.orgNetwork+xml"/>\r
+<Link rel="down" href="https://localhost/api/supportedSystemsInfo/" type="application/vnd.vmware.vcloud.supportedSystemsInfo+xml"/>\r
+<Link rel="down" href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
+<Link rel="down" href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac/hybrid" type="application/vnd.vmware.vcloud.hybridOrg+xml"/>\r
+<Link rel="alternate" href="https://localhost/api/admin/org/2cb3dffb-5c51-4355-8406-28553ead28ac" type="application/vnd.vmware.admin.organization+xml"/>\r
+<Link rel="down" href="https://localhost/api/vdcTemplates" type="application/vnd.vmware.admin.vdcTemplates+xml"/>\r
+<Link rel="instantiate" href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac/action/instantiate" type="application/vnd.vmware.vcloud.instantiateVdcTemplateParams+xml"/>\r
+<Description/><FullName>Organization 3</FullName>\r
+</Org>\r
+"""\r
+\r
+delete_catalog_xml_response = """<?xml version="1.0" encoding="UTF-8"?>\n<Catalog xmlns="http://www.vmware.com/vcloud/v1.5" name="80d8488f67ba1de98b7f485fba6abbd2" id="urn:vcloud:catalog:f3bf3733-465b-419f-b675-52f91d18edbb" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb" type="application/vnd.vmware.vcloud.catalog+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Link rel="up" href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" type="application/vnd.vmware.vcloud.org+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
+<Link rel="add" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/catalogItems" type="application/vnd.vmware.vcloud.catalogItem+xml"/>\r
+<Link rel="add" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/upload" type="application/vnd.vmware.vcloud.media+xml"/>\r
+<Link rel="add" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/upload" type="application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml"/>\r
+<Link rel="copy" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/copy" type="application/vnd.vmware.vcloud.copyOrMoveCatalogItemParams+xml"/>\r
+<Link rel="move" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/move" type="application/vnd.vmware.vcloud.copyOrMoveCatalogItemParams+xml"/>\r
+<Link rel="add" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/captureVApp" type="application/vnd.vmware.vcloud.captureVAppParams+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/controlAccess/" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Link rel="controlAccess" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/>\r
+<Description>80d8488f67ba1de98b7f485fba6abbd2</Description>\r
+<CatalogItems>\r
+    <CatalogItem href="https://localhost/api/catalogItem/8a984fdd-d2cb-4d58-a739-2ea12560aded" id="8a984fdd-d2cb-4d58-a739-2ea12560aded" name="80d8488f67ba1de98b7f485fba6abbd2" type="application/vnd.vmware.vcloud.catalogItem+xml"/>\r
+</CatalogItems>\r
+<IsPublished>\r
+    false\r
+</IsPublished>\r
+<DateCreated>2017-09-24T02:30:23.623-07:00</DateCreated>\r
+<VersionNumber>2</VersionNumber>\r
+</Catalog>"""\r
+\r
+delete_catalog_item_xml_response = """<?xml version="1.0" encoding="UTF-8"?>\r
+<CatalogItem xmlns="http://www.vmware.com/vcloud/v1.5" size="0" name="80d8488f67ba1de98b7f485fba6abbd2" id="urn:vcloud:catalogitem:8a984fdd-d2cb-4d58-a739-2ea12560aded" href="https://localhost/api/catalogItem/8a984fdd-d2cb-4d58-a739-2ea12560aded" type="application/vnd.vmware.vcloud.catalogItem+xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Link rel="up" href="https://localhost/api/catalog/f3bf3733-465b-419f-b675-52f91d18edbb" type="application/vnd.vmware.vcloud.catalog+xml"/>\r
+<Link rel="down" href="https://localhost/api/catalogItem/8a984fdd-d2cb-4d58-a739-2ea12560aded/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
+<Link rel="edit" href="https://localhost/api/catalogItem/8a984fdd-d2cb-4d58-a739-2ea12560aded" type="application/vnd.vmware.vcloud.catalogItem+xml"/>\r
+<Link rel="remove" href="https://localhost/api/catalogItem/8a984fdd-d2cb-4d58-a739-2ea12560aded"/>    <Description>medial_file_name vApp Template</Description>\r
+<Entity href="https://localhost/api/vAppTemplate/vappTemplate-2731194b-637a-45f5-8e6d-dc65690302f7" name="80d8488f67ba1de98b7f485fba6abbd2" type="application/vnd.vmware.vcloud.vAppTemplate+xml"/>   <DateCreated>2017-09-24T02:30:26.380-07:00</DateCreated>\r
+<VersionNumber>1</VersionNumber>\r
+</CatalogItem>"""\r
+\r
+undeploy_task_xml = """<Task xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" cancelRequested="false" expiryTime="2018-07-17T23:53:10.781-07:00" operation="Stopping Virtual Application Test1_vm-5e6dbb30-41ea-4290-951d-6ce2a7412d46(86d9dd50-9c07-4fc5-84ce-aefb5de7b8ed)" operationName="vappUndeployPowerOff" serviceNamespace="com.vmware.vcloud" startTime="2018-04-18T23:53:10.781-07:00" status="queued" name="task" id="urn:vcloud:task:5ca0a79f-c025-47b9-9f20-b6a04fd67ea3" href="https://localhost/api/task/5ca0a79f-c025-47b9-9f20-b6a04fd67ea3" type="application/vnd.vmware.vcloud.task+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Owner href="https://localhost/api/vApp/vapp-86d9dd50-9c07-4fc5-84ce-aefb5de7b8ed" name="Test1_vm-5e6dbb30-41ea-4290-951d-6ce2a7412d46" type="application/vnd.vmware.vcloud.vApp+xml"/>\r
+<User href="https://localhost/api/admin/user/f7b6beba-96db-4674-b187-675ed1873c8c" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/>\r
+<Organization href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" name="Org3" type="application/vnd.vmware.vcloud.org+xml"/>\r
+<Details/>\r
+</Task>\r
+"""\r
+\r
+delete_task_xml = """<Task xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" cancelRequested="false" expiryTime="2018-07-17T23:54:11.696-07:00" operation="Deleting Virtual Application Test1_vm-5e6dbb30-41ea-4290-951d-6ce2a7412d46(86d9dd50-9c07-4fc5-84ce-aefb5de7b8ed)" operationName="vdcDeleteVapp" serviceNamespace="com.vmware.vcloud" startTime="2018-04-18T23:54:11.696-07:00" status="queued" name="task" id="urn:vcloud:task:f0399f4e-ddd5-4050-959f-5970ba0a63e6" href="https://localhost/api/task/f0399f4e-ddd5-4050-959f-5970ba0a63e6" type="application/vnd.vmware.vcloud.task+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Owner href="https://localhost/api/vApp/vapp-86d9dd50-9c07-4fc5-84ce-aefb5de7b8ed" name="Test1_vm-5e6dbb30-41ea-4290-951d-6ce2a7412d46" type="application/vnd.vmware.vcloud.vApp+xml"/>\r
+<User href="https://localhost/api/admin/user/f7b6beba-96db-4674-b187-675ed1873c8c" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/>\r
+<Organization href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" name="Org3" type="application/vnd.vmware.vcloud.org+xml"/>\r
+<Details/>\r
+</Task>"""\r
+\r
+status_task_xml = """<Task xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" cancelRequested="false" endTime="2018-04-19T01:24:46.643-07:00" expiryTime="2018-07-18T01:24:39.363-07:00" operation="Powered Off Virtual Application Test1_vm-fa13aee3-fb79-456f-8ce9-17f029ec4324(e9765c7a-b0de-4663-9db9-028bf0031f4d)" operationName="vappPowerOff" serviceNamespace="com.vmware.vcloud" startTime="2018-04-19T01:24:39.363-07:00" status="success" name="task" id="urn:vcloud:task:17ebe394-b419-4612-ab55-cad3000d780a" href="https://localhost/api/task/17ebe394-b419-4612-ab55-cad3000d780a" type="application/vnd.vmware.vcloud.task+xml" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd">\r
+<Owner href="https://localhost/api/vApp/vapp-e9765c7a-b0de-4663-9db9-028bf0031f4d" name="Test1_vm-fa13aee3-fb79-456f-8ce9-17f029ec4324" type="application/vnd.vmware.vcloud.vApp+xml"/>\r
+<User href="https://localhost/api/admin/user/f7b6beba-96db-4674-b187-675ed1873c8c" name="orgadmin" type="application/vnd.vmware.admin.user+xml"/>\r
+<Organization href="https://localhost/api/org/2cb3dffb-5c51-4355-8406-28553ead28ac" name="Org3" type="application/vnd.vmware.vcloud.org+xml"/>\r
+<Details/>\r
+</Task>\r
+"""\r
+\r
+vm_xml_response = """<?xml version="1.0" encoding="UTF-8"?>\r
+<Vm xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" needsCustomization="false" nestedHypervisorEnabled="false" deployed="true" status="4" name="Ubuntu_no_nic" id="urn:vcloud:vm:53a529b2-10d8-4d56-a7ad-8182acdbe71c" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c" type="application/vnd.vmware.vcloud.vm+xml" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://localhost/api/v1.5/schema/master.xsd http://www.vmware.com/schema/ovf http://www.vmware.com/schema/ovf http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd http://schemas.dmtf.org/ovf/environment/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8027_1.1.0.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd">\r
+<Link rel="power:powerOff" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/power/action/powerOff"/>\r
+<Link rel="power:reboot" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/power/action/reboot"/>    <Link rel="power:reset" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/power/action/reset"/>\r
+<Link rel="power:shutdown" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/power/action/shutdown"/>\r
+<Link rel="power:suspend" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/power/action/suspend"/> <Link rel="undeploy" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/action/undeploy" type="application/vnd.vmware.vcloud.undeployVAppParams+xml"/>\r
+<Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c" type="application/vnd.vmware.vcloud.vm+xml"/>\r
+<Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/metadata" type="application/vnd.vmware.vcloud.metadata+xml"/>\r
+<Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/productSections/" type="application/vnd.vmware.vcloud.productSections+xml"/>\r
+<Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/metrics/current" type="application/vnd.vmware.vcloud.metrics.currentUsageSpec+xml"/>\r
+<Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/metrics/historic" type="application/vnd.vmware.vcloud.metrics.historicUsageSpec+xml"/>\r
+<Link rel="metrics" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/metrics/current" type="application/vnd.vmware.vcloud.metrics.currentUsageSpec+xml"/>\r
+<Link rel="metrics" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/metrics/historic" type="application/vnd.vmware.vcloud.metrics.historicUsageSpec+xml"/>\r
+<Link rel="screen:thumbnail" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/screen"/>\r
+<Link rel="screen:acquireTicket" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/screen/action/acquireTicket"/>\r
+<Link rel="screen:acquireMksTicket" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/screen/action/acquireMksTicket" type="application/vnd.vmware.vcloud.mksTicket+xml"/>\r
+<Link rel="media:insertMedia" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/media/action/insertMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"/>\r
+<Link rel="media:ejectMedia" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/media/action/ejectMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"/>\r
+<Link rel="disk:attach" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/disk/action/attach" type="application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml"/>\r
+<Link rel="disk:detach" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/disk/action/detach" type="application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml"/>\r
+<Link rel="installVmwareTools" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/action/installVMwareTools"/>\r
+<Link rel="customizeAtNextPowerOn" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/action/customizeAtNextPowerOn"/>\r
+<Link rel="snapshot:create" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/action/createSnapshot" type="application/vnd.vmware.vcloud.createSnapshotParams+xml"/>\r
+<Link rel="reconfigureVm" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/action/reconfigureVm" name="Ubuntu_no_nic" type="application/vnd.vmware.vcloud.vm+xml"/>\r
+<Link rel="up" href="https://localhost/api/vApp/vapp-5a5ca3da-3826-4fe4-83c5-c018ad1765fa" type="application/vnd.vmware.vcloud.vApp+xml"/>\r
+<Description/>\r
+<ovf:VirtualHardwareSection xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" ovf:transport="" vcloud:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" vcloud:href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/">\r
+<ovf:Info>Virtual hardware requirements</ovf:Info>\r
+<ovf:System>\r
+<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>\r
+<vssd:InstanceID>0</vssd:InstanceID>\r
+<vssd:VirtualSystemIdentifier>Ubuntu_no_nic</vssd:VirtualSystemIdentifier>\r
+<vssd:VirtualSystemType>vmx-11</vssd:VirtualSystemType>\r
+</ovf:System><ovf:Item>\r
+<rasd:Address>00:50:56:01:14:1a</rasd:Address>\r
+<rasd:AddressOnParent>0</rasd:AddressOnParent>\r
+<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>\r
+<rasd:Connection vcloud:ipAddressingMode="DHCP" vcloud:ipAddress="172.16.27.72" vcloud:primaryNetworkConnection="true">testing_6SNBKa9pz62P-63e13553-ebf9-4518-a33d-6ea922a6d2ce</rasd:Connection>\r
+<rasd:Description>Vmxnet3 ethernet adapter on "testing_6SNBKa9pz62P-63e13553-ebf9-4518-a33d-6ea922a6d2ce"\r
+</rasd:Description><rasd:ElementName>Network adapter 0</rasd:ElementName>\r
+<rasd:InstanceID>1</rasd:InstanceID>\r
+<rasd:ResourceSubType>VMXNET3</rasd:ResourceSubType>\r
+<rasd:ResourceType>10</rasd:ResourceType></ovf:Item><ovf:Item>\r
+<rasd:Address>0</rasd:Address><rasd:Description>SCSI Controller</rasd:Description>\r
+<rasd:ElementName>SCSI Controller 0</rasd:ElementName>\r
+<rasd:InstanceID>2</rasd:InstanceID>\r
+<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>\r
+<rasd:ResourceType>6</rasd:ResourceType></ovf:Item><ovf:Item>\r
+<rasd:AddressOnParent>0</rasd:AddressOnParent>\r
+<rasd:Description>Hard disk</rasd:Description>\r
+<rasd:ElementName>Hard disk 1</rasd:ElementName>\r
+<rasd:HostResource vcloud:storageProfileHref="https://localhost/api/vdcStorageProfile/950701fb-2b8a-4808-80f1-27d1170a2bfc" vcloud:busType="6" vcloud:busSubType="lsilogic" vcloud:capacity="10240" vcloud:storageProfileOverrideVmDefault="false"/>      <rasd:InstanceID>2000</rasd:InstanceID>\r
+<rasd:Parent>2</rasd:Parent><rasd:ResourceType>17</rasd:ResourceType>\r
+<rasd:VirtualQuantity>10737418240</rasd:VirtualQuantity>\r
+<rasd:VirtualQuantityUnits>byte</rasd:VirtualQuantityUnits>\r
+</ovf:Item><ovf:Item><rasd:Address>1</rasd:Address>\r
+<rasd:Description>IDE Controller</rasd:Description>\r
+<rasd:ElementName>IDE Controller 1</rasd:ElementName>\r
+<rasd:InstanceID>3</rasd:InstanceID>\r
+<rasd:ResourceType>5</rasd:ResourceType>\r
+</ovf:Item><ovf:Item><rasd:AddressOnParent>0</rasd:AddressOnParent>\r
+<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>\r
+<rasd:Description>CD/DVD Drive</rasd:Description>\r
+<rasd:ElementName>CD/DVD Drive 1</rasd:ElementName><rasd:HostResource/>\r
+<rasd:InstanceID>3002</rasd:InstanceID>\r
+<rasd:Parent>3</rasd:Parent>\r
+<rasd:ResourceType>15</rasd:ResourceType></ovf:Item><ovf:Item>\r
+<rasd:AddressOnParent>0</rasd:AddressOnParent>\r
+<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>\r
+<rasd:Description>Floppy Drive</rasd:Description>\r
+<rasd:ElementName>Floppy Drive 1</rasd:ElementName>\r
+<rasd:HostResource/><rasd:InstanceID>8000</rasd:InstanceID>\r
+<rasd:ResourceType>14</rasd:ResourceType>\r
+</ovf:Item>\r
+<ovf:Item vcloud:type="application/vnd.vmware.vcloud.rasdItem+xml" vcloud:href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/cpu">\r
+<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>\r
+<rasd:Description>Number of Virtual CPUs</rasd:Description>\r
+<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>\r
+<rasd:InstanceID>4</rasd:InstanceID>\r
+<rasd:Reservation>0</rasd:Reservation>\r
+<rasd:ResourceType>3</rasd:ResourceType>\r
+<rasd:VirtualQuantity>1</rasd:VirtualQuantity>\r
+<rasd:Weight>0</rasd:Weight>\r
+<vmw:CoresPerSocket ovf:required="false">1</vmw:CoresPerSocket>\r
+<Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/></ovf:Item>\r
+<ovf:Item vcloud:type="application/vnd.vmware.vcloud.rasdItem+xml" vcloud:href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/memory">\r
+<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>\r
+<rasd:Description>Memory Size</rasd:Description>\r
+<rasd:ElementName>1024 MB of memory</rasd:ElementName>\r
+<rasd:InstanceID>5</rasd:InstanceID>\r
+<rasd:Reservation>0</rasd:Reservation>\r
+<rasd:ResourceType>4</rasd:ResourceType>\r
+<rasd:VirtualQuantity>1024</rasd:VirtualQuantity>\r
+<rasd:Weight>0</rasd:Weight>\r
+<Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>\r
+        </ovf:Item>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/" type="application/vnd.vmware.vcloud.virtualHardwareSection+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/cpu" type="application/vnd.vmware.vcloud.rasdItem+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/memory" type="application/vnd.vmware.vcloud.rasdItem+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/disks" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/media" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/networkCards" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="down" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/virtualHardwareSection/serialPorts" type="application/vnd.vmware.vcloud.rasdItemsList+xml"/>\r
+    </ovf:VirtualHardwareSection>\r
+    <ovf:OperatingSystemSection xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" ovf:id="94" vcloud:type="application/vnd.vmware.vcloud.operatingSystemSection+xml" vmw:osType="ubuntu64Guest" vcloud:href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/operatingSystemSection/">\r
+        <ovf:Info>Specifies the operating system installed</ovf:Info>\r
+        <ovf:Description>Ubuntu Linux (64-bit)</ovf:Description>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/operatingSystemSection/" type="application/vnd.vmware.vcloud.operatingSystemSection+xml"/>\r
+    </ovf:OperatingSystemSection>\r
+    <NetworkConnectionSection href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml" ovf:required="false">\r
+        <ovf:Info>Specifies the available VM network connections</ovf:Info>\r
+        <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>\r
+        <NetworkConnection needsCustomization="false" network="testing_6SNBKa9pz62P-63e13553-ebf9-4518-a33d-6ea922a6d2ce">\r
+            <NetworkConnectionIndex>0</NetworkConnectionIndex>\r
+            <IpAddress>172.16.27.72</IpAddress>\r
+            <IsConnected>true</IsConnected>\r
+            <MACAddress>00:50:56:01:14:1a</MACAddress>\r
+            <IpAddressAllocationMode>DHCP</IpAddressAllocationMode>\r
+            <NetworkAdapterType>VMXNET3</NetworkAdapterType>\r
+        </NetworkConnection>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml"/>\r
+    </NetworkConnectionSection>  \r
+    <NetworkConnectionSection href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml" ovf:required="false">\r
+        <ovf:Info>Specifies the available VM network connections</ovf:Info>\r
+        <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>\r
+        <NetworkConnection needsCustomization="false" network="testing_6SNBKa9pz62P-63e13553-ebf9-4518-a33d-6ea922a6d2ce">\r
+            <NetworkConnectionIndex>0</NetworkConnectionIndex>\r
+            <IpAddress>172.16.27.72</IpAddress>\r
+            <IsConnected>true</IsConnected>\r
+            <MACAddress>00:50:56:01:14:1a</MACAddress>\r
+            <IpAddressAllocationMode>DHCP</IpAddressAllocationMode>\r
+        </NetworkConnection>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/networkConnectionSection/" type="application/vnd.vmware.vcloud.networkConnectionSection+xml"/>\r
+    </NetworkConnectionSection>\r
+    <GuestCustomizationSection href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" ovf:required="false">\r
+        <ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>\r
+        <Enabled>true</Enabled>\r
+        <ChangeSid>false</ChangeSid>\r
+        <VirtualMachineId>53a529b2-10d8-4d56-a7ad-8182acdbe71c</VirtualMachineId>\r
+        <JoinDomainEnabled>false</JoinDomainEnabled>\r
+        <UseOrgSettings>false</UseOrgSettings>\r
+        <AdminPasswordEnabled>false</AdminPasswordEnabled>\r
+        <AdminPasswordAuto>true</AdminPasswordAuto>\r
+        <AdminAutoLogonEnabled>false</AdminAutoLogonEnabled>\r
+        <AdminAutoLogonCount>0</AdminAutoLogonCount>\r
+        <ResetPasswordRequired>false</ResetPasswordRequired>\r
+        <ComputerName>Ubuntunonic-001</ComputerName>\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/guestCustomizationSection/" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml"/>\r
+    </GuestCustomizationSection>\r
+    <RuntimeInfoSection xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" vcloud:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" vcloud:href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/runtimeInfoSection">\r
+        <ovf:Info>Specifies Runtime info</ovf:Info>\r
+        <VMWareTools version="2147483647"/>\r
+    </RuntimeInfoSection>\r
+    <SnapshotSection href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/snapshotSection" type="application/vnd.vmware.vcloud.snapshotSection+xml" ovf:required="false">\r
+        <ovf:Info>Snapshot information section</ovf:Info>\r
+    </SnapshotSection>\r
+    <DateCreated>2018-04-19T04:19:28.150-07:00</DateCreated>\r
+    <VAppScopedLocalId>Ubuntu_no_nic</VAppScopedLocalId>\r
+    <ovfenv:Environment xmlns:ns11="http://www.vmware.com/schema/ovfenv" ovfenv:id="" ns11:vCenterId="vm-8971">\r
+        <ovfenv:PlatformSection>\r
+<ovfenv:Kind>VMware ESXi</ovfenv:Kind>\r
+<ovfenv:Version>6.0.0</ovfenv:Version>\r
+<ovfenv:Vendor>VMware, Inc.</ovfenv:Vendor>\r
+<ovfenv:Locale>en</ovfenv:Locale>\r
+        </ovfenv:PlatformSection>\r
+        <ovfenv:PropertySection>\r
+<ovfenv:Property ovfenv:key="vCloud_UseSysPrep" ovfenv:value="None"/>\r
+<ovfenv:Property ovfenv:key="vCloud_bitMask" ovfenv:value="1"/>\r
+<ovfenv:Property ovfenv:key="vCloud_bootproto_0" ovfenv:value="dhcp"/>\r
+<ovfenv:Property ovfenv:key="vCloud_computerName" ovfenv:value="Ubuntunonic-001"/>\r
+<ovfenv:Property ovfenv:key="vCloud_macaddr_0" ovfenv:value="00:50:56:01:14:1a"/>\r
+<ovfenv:Property ovfenv:key="vCloud_markerid" ovfenv:value="ec8b90ea-cb5d-43b4-8910-91380ff29d97"/>\r
+<ovfenv:Property ovfenv:key="vCloud_numnics" ovfenv:value="1"/>\r
+<ovfenv:Property ovfenv:key="vCloud_primaryNic" ovfenv:value="0"/>\r
+<ovfenv:Property ovfenv:key="vCloud_reconfigToken" ovfenv:value="132681259"/>\r
+<ovfenv:Property ovfenv:key="vCloud_resetPassword" ovfenv:value="0"/>\r
+        </ovfenv:PropertySection>\r
+        <ve:EthernetAdapterSection xmlns:ve="http://www.vmware.com/schema/ovfenv" xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1">\r
+<ve:Adapter ve:mac="00:50:56:01:14:1a" ve:network="DPG-MGMT-3151" ve:unitNumber="7"/>\r
+   \r
+        </ve:EthernetAdapterSection>\r
+    </ovfenv:Environment>\r
+    <VmCapabilities href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml">\r
+        <Link rel="edit" href="https://localhost/api/vApp/vm-53a529b2-10d8-4d56-a7ad-8182acdbe71c/vmCapabilities/" type="application/vnd.vmware.vcloud.vmCapabilitiesSection+xml"/>\r
+        <MemoryHotAddEnabled>false</MemoryHotAddEnabled>\r
+        <CpuHotAddEnabled>false</CpuHotAddEnabled>\r
+    </VmCapabilities>\r
+    <StorageProfile href="https://localhost/api/vdcStorageProfile/950701fb-2b8a-4808-80f1-27d1170a2bfc" name="*" type="application/vnd.vmware.vcloud.vdcStorageProfile+xml"/>\r
+</Vm>"""\r