-
Notifications
You must be signed in to change notification settings - Fork 13
/
client_virtualwire_test.go
47 lines (37 loc) · 29.5 KB
/
client_virtualwire_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package gonsx
import (
"github.com/sky-uk/gonsx/api/virtualwire"
"github.com/stretchr/testify/assert"
"net/http"
"testing"
)
func TestClientGetAllVirtualWires(t *testing.T) {
xmlContent := `<?xml version="1.0" encoding="UTF-8"?>
<virtualWires><dataPage><pagingInfo><pageSize>20</pageSize><startIndex>0</startIndex><totalCount>9</totalCount><sortOrderAscending>true</sortOrderAscending></pagingInfo><virtualWire><objectId>virtualwire-92</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>3</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-Infrastructure-10.152.143.0/27</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-385</backingValue></vdsContextWithBacking><vdnId>5012</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>b9fd04fb-1f32-47b6-85f2-0cbe7f00f466</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-100</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.129.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-394</backingValue></vdsContextWithBacking><vdnId>5021</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>b4cd4ca0-52ea-4033-973b-6422a71bc68f</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-101</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.130.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-395</backingValue></vdsContextWithBacking><vdnId>5022</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>58c38a22-4a2b-4ca9-9066-9a818e648fb2</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-129</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.131.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-457</backingValue></vdsContextWithBacking><vdnId>5023</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>90a390cb-ccce-4c0b-bf75-9371aa3a2075</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-160</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP_management</name><description>Management VLAN</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-517</backingValue></vdsContextWithBacking><vdnId>5013</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>5833b0f4-fad6-4798-a633-12939e6f1dc6</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-166</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-lb-mgmt</name><description>LB for mgmt</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>Unused</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-529</backingValue></vdsContextWithBacking><vdnId>5024</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>80684b92-7ce4-49d3-9f35-ac2ee0263a0e</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-167</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-lb-fe</name><description>LB Front-end</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>Unused</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-530</backingValue></vdsContextWithBacking><vdnId>5025</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>83fb917d-9fcb-4392-8924-596483d7f115</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-235</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>test</name><description>test desc</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>test</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-705</backingValue></vdsContextWithBacking><vdnId>5000</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>23cee26d-6b78-4914-9f46-3996756c83b5</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-236</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>test</name><description>test desc</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>test</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-706</backingValue></vdsContextWithBacking><vdnId>5001</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>476bd3eb-7f72-427d-83b9-c2b1db9e1eef</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire></dataPage></virtualWires>`
setup(http.StatusOK, xmlContent)
defer server.Close()
api := virtualwire.NewGetAll("vdnscope-19")
nsxClient.Do(api)
assert.Len(t, api.GetResponse().DataPage.VirtualWires, 9)
assert.Equal(t, "virtualwire-160", api.GetResponse().DataPage.VirtualWires[4].ObjectID)
}
func TestClientGetAllVirtualWiresFiltered(t *testing.T) {
xmlContent := `<?xml version="1.0" encoding="UTF-8"?>
<virtualWires><dataPage><pagingInfo><pageSize>20</pageSize><startIndex>0</startIndex><totalCount>9</totalCount><sortOrderAscending>true</sortOrderAscending></pagingInfo><virtualWire><objectId>virtualwire-92</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>3</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-Infrastructure-10.152.143.0/27</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-385</backingValue></vdsContextWithBacking><vdnId>5012</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>b9fd04fb-1f32-47b6-85f2-0cbe7f00f466</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-100</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.129.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-394</backingValue></vdsContextWithBacking><vdnId>5021</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>b4cd4ca0-52ea-4033-973b-6422a71bc68f</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-101</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.130.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-395</backingValue></vdsContextWithBacking><vdnId>5022</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>58c38a22-4a2b-4ca9-9066-9a818e648fb2</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-129</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-Territory-Zero-LS-10.152.131.0/24</name><description></description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-457</backingValue></vdsContextWithBacking><vdnId>5023</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>90a390cb-ccce-4c0b-bf75-9371aa3a2075</ctrlLsUuid><macLearningEnabled>true</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-160</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP_management</name><description>Management VLAN</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>virtual wire tenant</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-517</backingValue></vdsContextWithBacking><vdnId>5013</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>5833b0f4-fad6-4798-a633-12939e6f1dc6</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-166</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-lb-mgmt</name><description>LB for mgmt</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>Unused</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-529</backingValue></vdsContextWithBacking><vdnId>5024</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>80684b92-7ce4-49d3-9f35-ac2ee0263a0e</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-167</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-lb-fe</name><description>LB Front-end</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>Unused</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-530</backingValue></vdsContextWithBacking><vdnId>5025</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>83fb917d-9fcb-4392-8924-596483d7f115</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-235</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>test</name><description>test desc</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>test</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-705</backingValue></vdsContextWithBacking><vdnId>5000</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>23cee26d-6b78-4914-9f46-3996756c83b5</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire><virtualWire><objectId>virtualwire-236</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>test</name><description>test desc</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>test</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>502</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-706</backingValue></vdsContextWithBacking><vdnId>5001</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>476bd3eb-7f72-427d-83b9-c2b1db9e1eef</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire></dataPage></virtualWires>`
setup(http.StatusOK, xmlContent)
defer server.Close()
api := virtualwire.NewGetAll("vdnscope-19")
nsxClient.Do(api)
actualTransportZone := api.GetResponse().FilterByName("OVP-lb-mgmt")
assert.Equal(t, "virtualwire-166", actualTransportZone.ObjectID)
}
func TestClientGetVirtualWire(t *testing.T) {
xmlContent := `<?xml version="1.0" encoding="UTF-8"?>
<virtualWire><objectId>virtualwire-166</objectId><objectTypeName>VirtualWire</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>2</revision><type><typeName>VirtualWire</typeName></type><name>OVP-lb-mgmt</name><description>LB for mgmt</description><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision><tenantId>Unused</tenantId><vdnScopeId>vdnscope-19</vdnScopeId><vdsContextWithBacking><switch><objectId>dvs-61</objectId><objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName><vsmUuid>4221A849-079E-D13E-6B36-068D4F1222A9</vsmUuid><nodeId>dd3b6a28-b778-4310-8803-b6eae482b2c0</nodeId><revision>503</revision><type><typeName>VmwareDistributedVirtualSwitch</typeName></type><name>vds-slu-d-ott-2x10-03</name><scope><id>datacenter-21</id><objectTypeName>Datacenter</objectTypeName><name>S57 - Slough</name></scope><clientHandle></clientHandle><extendedAttributes/><isUniversal>false</isUniversal><universalRevision>0</universalRevision></switch><mtu>1600</mtu><promiscuousMode>false</promiscuousMode><backingType>portgroup</backingType><backingValue>dvportgroup-529</backingValue></vdsContextWithBacking><vdnId>5024</vdnId><guestVlanAllowed>false</guestVlanAllowed><controlPlaneMode>UNICAST_MODE</controlPlaneMode><ctrlLsUuid>80684b92-7ce4-49d3-9f35-ac2ee0263a0e</ctrlLsUuid><macLearningEnabled>false</macLearningEnabled></virtualWire>`
setup(http.StatusOK, xmlContent)
defer server.Close()
api := virtualwire.NewGet("virtualwire-166")
nsxClient.Do(api)
actualTransportZone := api.GetResponse()
assert.Equal(t, "virtualwire-166", actualTransportZone.ObjectID)
}