Create An External Network - VMware VCLOUD API 1.0 - API Programming Manual

Table of Contents

Advertisement

Example 7-21. Remove a vDC
Request:
DELETE http://vcloud.example.com/api/v1.0/admin/extension/providervdc/43
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ... operation="Deleting Provider Virtual Datacenter (43)" ...>
...
</Task>

Create an External Network

A system administrator can use the rel="add" link for externalnets in a VMWExtension element to add an 
external network to a vCloud. Example
returned in Example
vCenter portgroup that supports the new external network.
N
   You must use the VMware vSphere API to obtain the values you need to populate the 
OTE
VimPortGroupRef element.
Example 7-22. Create an External Network
Request:
POST http://vcloud.example.com/api/v1.0/admin/extension/externalnets
Content-Type: application/vnd.vmware.admin.vmwexternalnet+xml
...
<vmext:VMWExternalNetwork xmlns:vmext="http://www.vmware.com/vcloud/extension/v1"
<vcloud:Description>Portgroup-25 on VC-100</vcloud:Description>
<vcloud:Configuration>
<vcloud:IpScope>
<vcloud:IsInherited>false</vcloud:IsInherited>
<vcloud:Gateway>10.147.58.253</vcloud:Gateway>
<vcloud:Netmask>255.255.255.0</vcloud:Netmask>
<vcloud:Dns1>10.147.115.1</vcloud:Dns1>
<vcloud:Dns2>10.147.115.2</vcloud:Dns2>
<vcloud:DnsSuffix>eng.vmware.com</vcloud:DnsSuffix>
<vcloud:IpRanges>
</vcloud:IpRanges>
</vcloud:IpScope>
<vcloud:FenceMode>isolated</vcloud:FenceMode>
</vcloud:Configuration>
<vmext:VimPortGroupRef>
<vmext:VimServerRef type="application/vnd.vmware.admin.vmwvserver+xml"
<vmext:MoRef>dvportgroup-25</vmext:MoRef>
<vmext:VimObjectType>NETWORK</vmext:VimObjectType>
</vmext:VimPortGroupRef>
</vmext:VMWExternalNetwork>
VMware, Inc.
7‐22 does this by making a POST request to the externalnets link 
7‐1. The content of the VimPortGroupRef element in the request body specifies that 
xmlns:vcloud="http://www.vmware.com/vcloud/v1" name="ExternalNet-VC100">
<vcloud:IpRange>
<vcloud:StartAddress>10.147.58.1</vcloud:StartAddress>
<vcloud:EndAddress>10.147.58.100</vcloud:EndAddress>
</vcloud:IpRange>
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100"/>
Chapter 7 VMware vSphere Platform Operations
133

Advertisement

Table of Contents
loading

Table of Contents