Fix xml block causing docs to fail

This commit is contained in:
Daniel A. Wozniak 2019-04-19 05:42:54 +00:00 committed by Pedro Algarvio
parent 6e5768a3b5
commit 8c10f5ffa1
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -6936,45 +6936,47 @@ def add_host_to_dvs(host, username, password, vmknic_name, vmnic_name,
to sniff the SOAP stream from Powershell to our vSphere server and got
this snippet out:
<UpdateNetworkConfig xmlns="urn:vim25">
<_this type="HostNetworkSystem">networkSystem-187</_this>
<config>
<vswitch>
<changeOperation>edit</changeOperation>
<name>vSwitch0</name>
<spec>
<numPorts>7812</numPorts>
</spec>
</vswitch>
<proxySwitch>
<changeOperation>edit</changeOperation>
<uuid>73 a4 05 50 b0 d2 7e b9-38 80 5d 24 65 8f da 70</uuid>
<spec>
<backing xsi:type="DistributedVirtualSwitchHostMemberPnicBacking">
<pnicSpec><pnicDevice>vmnic0</pnicDevice></pnicSpec>
</backing>
</spec>
</proxySwitch>
<portgroup>
<changeOperation>remove</changeOperation>
<spec>
<name>Management Network</name><vlanId>-1</vlanId><vswitchName /><policy />
</spec>
</portgroup>
<vnic>
<changeOperation>edit</changeOperation>
<device>vmk0</device>
<portgroup />
<spec>
<distributedVirtualPort>
<switchUuid>73 a4 05 50 b0 d2 7e b9-38 80 5d 24 65 8f da 70</switchUuid>
<portgroupKey>dvportgroup-191</portgroupKey>
</distributedVirtualPort>
</spec>
</vnic>
</config>
<changeMode>modify</changeMode>
</UpdateNetworkConfig>
.. code-block:: xml
<UpdateNetworkConfig xmlns="urn:vim25">
<_this type="HostNetworkSystem">networkSystem-187</_this>
<config>
<vswitch>
<changeOperation>edit</changeOperation>
<name>vSwitch0</name>
<spec>
<numPorts>7812</numPorts>
</spec>
</vswitch>
<proxySwitch>
<changeOperation>edit</changeOperation>
<uuid>73 a4 05 50 b0 d2 7e b9-38 80 5d 24 65 8f da 70</uuid>
<spec>
<backing xsi:type="DistributedVirtualSwitchHostMemberPnicBacking">
<pnicSpec><pnicDevice>vmnic0</pnicDevice></pnicSpec>
</backing>
</spec>
</proxySwitch>
<portgroup>
<changeOperation>remove</changeOperation>
<spec>
<name>Management Network</name><vlanId>-1</vlanId><vswitchName /><policy />
</spec>
</portgroup>
<vnic>
<changeOperation>edit</changeOperation>
<device>vmk0</device>
<portgroup />
<spec>
<distributedVirtualPort>
<switchUuid>73 a4 05 50 b0 d2 7e b9-38 80 5d 24 65 8f da 70</switchUuid>
<portgroupKey>dvportgroup-191</portgroupKey>
</distributedVirtualPort>
</spec>
</vnic>
</config>
<changeMode>modify</changeMode>
</UpdateNetworkConfig>
The SOAP API maps closely to PyVmomi, so from there it was (relatively)
easy to figure out what Python to write.