5.1

Table Of Contents
Example: Update a NetworkConfigSection
This example modifies the NetworkConfigSection that was retrieved in “Example: Retrieve a
NetworkConfigSection,” on page 108. The modifications change the FenceMode value to natRouted and add a
Features element that defines several network features that are useful to an FTP server that must be reachable
from the public Internet, but only at the FTP and SSH ports. The modifications add the following items:
n
A set of FirewallRules that allow TCP traffic to ports 21 and 22. Because these rules require you to specify
a single IP address on the inside of the firewall, the IpScope element is modified to limit the range of IP
addresses available on the vApp network to a single address. Any virtual machine that connects to the
vApp network defined in this NetworkConfigSection is given this address.
n
A NatService element that maps a routable external IP address to the internal IP address allocated to the
Vm by the vApp network. The VAppScopedVmId value in this element is taken from the VAppScopedLocalId
element of the Vm and the VmNicId value is taken from its PrimaryNetworkConnectionIndex. See
“Example: Configuration Links in a Vm Element,” on page 101.
For more information about these and other network services in vApp networks, see “Network Services in
vApp Networks,” on page 112
This request, like all request bodies derived from a response, omits the Link elements and href attributes that
were part of the retrieved NetworkConfigurationSection. It also omits the IsDeployed element of the
NetworkConfig. These elements and attributes are created by the server and are read-only. They are ignored if
you include them in a request. Read-only elements are noted in the schema reference.
Request:
PUT https://vcloud.example.com/api/vApp/vapp-7/networkConfigSection/
Content-type: application/vnd.vmware.vcloud.networkConfigSection+xml
...
<NetworkConfigSection
xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig
networkName="vAppNetwork">
<Configuration>
<IpScopes>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>10.147.56.253</Gateway>
<Netmask>255.255.255.0</Netmask>
<Dns1>10.147.115.1</Dns1>
<Dns2>10.147.115.2</Dns2>
<DnsSuffix>example.com</DnsSuffix>
<IpRanges>
<IpRange>
<StartAddress>10.147.56.1</StartAddress>
<EndAddress>10.147.56.1</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
</IpScopes>
<ParentNetwork
type="application/vnd.vmware.vcloud.network+xml"
name="Internet"
href="https://vcloud.example.com/api/network/54" />
vCloud API Programming Guide
110 VMware, Inc.