VMware, Inc. 71
Chapter 5 Datacenter Operations
To modify a section
1 RetrievethevApporvApptemplateandexaminetheresponsetofindthesectionthatyouwantto
modify.
2 RetrievethesectionbymakingaGETrequesttothesection’seditlink(aLinkelementinthesection
whererel="edit").
3Modifythesectionasneeded.
4PUTthemodifiedsectiontothe
section’seditlink.NotethatsectioneditURLs,unlikemostotherURLs
presentedbythevCloudAPI,endwitha/character.
Retrieve or Modify the NetworkConfigSection of a vApp Template
Example 5‐10retrievesavApp’snetworkconfiguration(NetworkConfigSection).Example 5‐11modifiesthe
sectionandappliesthechanges.ChangestotheStartupSectionorLeaseSettingsSectioncanusethe
sameprocedure.
Example 5-10. Retrieve vApp Network Configuration
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/
Response:
200 OK
Content-type: application/vnd.vmware.vcloud.networkConfigSection+xml
...
<NetworkConfigSection href="http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/"
ovf:required="false">
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml"
href="http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/"/>
<NetworkConfig networkName="vAppNetwork">
<Configuration>
<IpScope>
<IsInherited>true</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.255</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
<ParentNetwork type="application/vnd.vmware.vcloud.network+xml" name="Internet"
href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>bridged</FenceMode>
</Configuration>
<IsDeployed>false</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
ThemodifiedNetworkConfigSectionintherequestbodyinExample 5‐11changestheFenceModevalueto
natRoutedandaddsaFeatureselementthatdefinesseveralnetworkfeaturesusefultoanFTPserverthat
mustbereachablefromthepublicInternet,butonlyattheFTPportandtheSSHport.
N
OTESectionsthatdonothaveaLinkwhererel="edit"cannotbemodified.