5.6

Example: Requests and Responses to Create a Session for a Virtual Data
Center
This example shows the five parts (requests and responses) that are required to create a session for a virtual
data center located in a vCloud instance.
This example shows a request and response for a Dedicated Cloud service, with the auto assigned ID
3786bb05-dc9a-471b-91cd-554499d45629, that contains a reference to one virtual data center named 0001-
example-vdc-1-public-api. The compute service has UUID vchs-2 and the virtual data center has the UUID
vdc-7.
Request 1:
GET https://vchs.vmware.com/api/vchs/compute/vchs-2
Accept: application/xml;version=5.6
Response 1:
200 OK
<Compute
serviceId="example-1101-130711-1"
serviceType="compute:dedicatedcloud"
type="application/xml;class=vnd.vmware.vchs.compute"
href="https://vchs.vmware.com/api/vchs/compute/vchs-2"
...>
<Link
rel="up"
name="services"
type="application/xml;class=vnd.vmware.vchs.servicelist"
href="https://vchs.vmware.com/api/vchs/services" />
<VdcRef
status="Active"
name="0001-example-vdc-1-public-api"
type="application/xml;class=vnd.vmware.vchs.vdcref"
href="https://vchs.vmware.com/api/vchs/compute/vchs-2/vdc/vdc-7">
<Link
rel="down"
name="0001-example-vdc-1-public-api"
type="application/xml;class=vnd.vmware.vchs.vcloudsession"
href="https://vchs.vmware.com/api/vchs/compute/vchs-2/vdc/vdc-7/vcloudsession" />
</VdcRef>
</Compute>
Request 2:
GET href=https://vchs.vmware.com/api/vchs/compute/vchs-2/vdc/vdc-7
Accept: application/xml;version=5.6
Response 2:
200 OK
<Vdc
name="0001-example-vdc-1-public-api"
type="application/xml;class=vnd.vmware.vchs.vdcref"
href="https://vchs.vmware.com/api/vchs/compute/vchs-2/vdc/vdc-7"
...>
<Link
rel="down"
vCloud Air Platform Programmer's Guide
20 VMware, Inc.