Getting Information About A Vdc; Instantiating The Template In The Vdc - VMware VCLOUD API 1.0 - API Programming Manual

Table of Contents

Advertisement

vCloud API Programming Guide

Getting Information About a vDC

Instantiation, deployment, and operation of a vApp all take place in the context of a vDC. The XML 
representation of a vDC object defines that context in detail. For this exercise, you need only two pieces of 
information from the vDC:
The URL that a client can use to request an instantiateVAppTemplate operation in the vDC
A list of networks to which the vApp can connect.
Example 2‐5 shows this subset of vDC contents. (For a more complete look at those contents, see Example
on page
37.)
Example 2-5. List the Contents of a vDC
Request:
GET http://vcloud.example.com/api/v1.0/vdc/5
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.vdc+xml
...
<Vdc name="ExampleVdc01" type="application/vnd.vmware.vcloud.vdc+xml"
...
<Link rel="add" type="application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml"
...
<AvailableNetworks>
<Network href="http://vcloud.example.com/api/v1.0/network/14"
<Network href="http://vcloud.example.com/api/v1.0/network/54"
</AvailableNetworks>
...
</Vdc>
The information you need is available here in two places:
An Link element containing an action URL, 
http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate. The rel attribute of this 
Link has a value of add, indicating that it implements an action that adds an object to the vDC.
A list of AvailableNetworks that includes all the networks owned by the organization that contains this 
vDC. Since we want this FTP server to be accessible on the public Internet, we will connect the vApp to 
the network named Internet.
Both these pieces of information are put to use in Example

Instantiating the Template in the vDC

To create a vApp from this template, you must bind its abstract resource requirements, such as network 
connections, storage resources, memory, and CPU capacity, to appropriate resources in the target vDC. This 
binding operation is called instantiation. Although a client can specify these bindings in detail, a simple 
instantiation, which relies on organization and vDC defaults, requires only a few pieces of information:
A name for the vApp that the request creates
The URL of the template to instantiate. In this case, the URL (retrieved in Example
http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate‐111.
24
href="http://vcloud.example.com/api/v1.0/vdc/5" ...>
href="http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate"
/>
type="application/vnd.vmware.vcloud.network+xml" name="IsolatedOrgNet"/>
type="application/vnd.vmware.vcloud.network+xml" name="Internet"/>
2‐6. 
3‐4 
2‐4) is 
VMware, Inc.

Advertisement

Table of Contents
loading

Table of Contents