1.5
Table Of Contents
- vCloud API Programming Guide
- Contents
- vCloud API Programming Guide
- About the VMware vCloud API
- Hello vCloud: A Simplified RESTful Workflow
- Exploring a Cloud
- Provisioning an Organization with vApps, Templates, and Media
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for a Virtual Machine
- Retrieve or Update a Modifiable Section
- Update a vApp Network Configuration
- Update the NetworkConnectionSection of a Virtual Machine
- Retrieve or Modify the CPU Configuration of a Virtual Machine
- Retrieve or Modify the GuestCustomizationSection of a Virtual Machine
- Retrieve or Modify ProductSection Elements
- Retrieve or Modify Groups of Related Sections in a Virtual Machine
- Retrieve or Modify the Hard Disk Configuration of a Virtual Machine
- Creating, Provisioning, and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- Network Administration
- vDC Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Controlling Access to vApps and Catalogs
- Using vCloud API Extensions to Provision and Manage a Cloud
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- XML Representations in the vCloud API
- Index
2 Examine the response to locate the Link element that contains the URL for adding external networks to
the cloud.
This element has a rel attribute value of add and a type attribute value of
application/vnd.vmware.admin.vmwexternalnet+xml, as shown here:
<Link
type="application/vnd.vmware.admin.vmwexternalnet+xml"
rel="add"
href="https://vcloud.example.com/api/admin/extension/externalnets"/>
3 Choose a vCenter server to provide a portgroup for the network.
4 Create a VMWExternalNetwork element that specifies the properties of the external network.
These properties include the portgroup you specified in Step 3.
5 POST the VMWExternalNetwork element you created in Step 4 to the URL described in Step 2.
See the request portion of “Example: Create an External Network,” on page 181.
The server creates the external network and returns a VMWExternalNetwork element that includes the contents
you POSTed, along with a set of Link elements that you can use to access, remove, disable, or modify it. A
reference to the new external network is added to the VMWExternalNetworkReferences element of the VCloud.
The portgroup you specified is removed from the VimObjectRefList of the vCenter server.
Example: Create an External Network
This request creates an external network backed by a portgroup listed in the response portion of “Retrieve a
List of Network Resources from a vCenter Server,” on page 170.
Request:
POST https://vcloud.example.com/api/admin/extension/externalnets
Content-Type: application/vnd.vmware.admin.vmwexternalnet+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<vmext:VMWExternalNetwork
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
name="example-extnet"
type="application/vnd.vmware.admin.vmwexternalnet+xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<vcloud:Description>ExternalNet</vcloud:Description>
<vcloud:Configuration>
<vcloud:IpScope>
<vcloud:IsInherited>false</vcloud:IsInherited>
<vcloud:Gateway>10.24.64.126</vcloud:Gateway>
<vcloud:Netmask>255.255.255.192</vcloud:Netmask>
<vcloud:Dns1>10.115.120.71</vcloud:Dns1>
<vcloud:Dns2>10.6.64.29</vcloud:Dns2>
<vcloud:DnsSuffix>eng.example.com</vcloud:DnsSuffix>
</vcloud:IpScope>
<vcloud:FenceMode>isolated</vcloud:FenceMode>
</vcloud:Configuration>
<vmext:VimPortGroupRef>
<vmext:VimServerRef
href="https://vcloud.example.com/api/admin/extension/vimServer/9" />
Chapter 7 Using vCloud API Extensions to Provision and Manage a Cloud
VMware, Inc. 181