vCloud API Programming Guide
100 VMware, Inc.
Add a Network to an Organization
Anadministratorcanusetherel="add"linkfornetworksinanAdminOrgbodytoaddanetworktothe
organization.Example 6‐10doesthisbymakingaPOSTrequesttothenetworkslinkreturnedinExample 6‐4.
ThecontentoftheFenceModeelementintherequestbodyspecifiesthatorganization
networkisbridgedto
itsParentNetwork,whosehrefvaluewasretrievedfromoneoftheNetworkelementsintheresponsein
Example 6‐2.
Example 6-10. Add a Network to an Organization
Request:
POST http://vcloud.example.com/api/v1.0/admin/org/26/networks
Content-Type: application/vnd.vmware.admin.network+xml
...
<OrgNetwork name="Internet" xmlns="http://www.vmware.com/vcloud/v1">
<Description>Bridged to the public Internet</Description>
<Configuration>
<ParentNetwork type="application/vnd.vmware.admin.network+xml"
name="ExternalNetwork-VC1"
href="http://vcloud.example.com/api/v1.0/admin/network/7"/>
<FenceMode>bridged</FenceMode>
</Configuration>
</OrgNetwork>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.network+xm
...
<OrgNetwork xmlns="http://www.vmware.com/vcloud/v1" name="Internet"
type="application/vnd.vmware.admin.network+xml"
href="http://vcloud.example.com/api/v1.0/admin/network/54" ...>
<Link rel="alternate" type="application/vnd.vmware.vcloud.network+xml"
href="http://vcloud.example.com/api/v1.0/network/54"/>
<Link rel="edit" type="application/vnd.vmware.admin.network+xml"
href="http://vcloud.example.com/api/v1.0/admin/network/54"/>
<Link rel="remove" href="http://vcloud.example.com/api/v1.0/admin/network/54"/>
<Link rel="up" type="application/vnd.vmware.admin.organization+xml"
href="http://vcloud.example.com/api/v1.0//org/26"/>
<Description>Bridged to the public Internet</Description>
<Tasks>
<Task ... operation="Creating Network Internet (2)" ... >
...
</Task>
</Tasks>
<Configuration>
<IpScope>
<IsInherited>true</IsInherited>
<Gateway>10.147.122.190</Gateway>
<Netmask>255.255.255.192</Netmask>
<Dns1>10.115.120.71</Dns1>
<DnsSuffix>example.com</DnsSuffix>
<IpRanges>
<IpRange>
<StartAddress>10.147.122.129</StartAddress>
<EndAddress>10.147.122.189</EndAddress>
</IpRange>
</IpRanges>
<AllocatedIpAddresses/>
</IpScope>
NOTEANetworkPoolelementmustbeincludedintherequestwhencreatingnetworkwhoseFenceModeis
natRoutedorisolated.