1.5

Table Of Contents
2 Examine the response, which always includes an HTTP response code and usually includes a body. In the
vCloud API, a response body is an XML representation of an object, including elements and attributes
that represent object properties, links that implement operations on the object or provide references to
contained or containing objects and, if the object is being created or modified, an embedded task object
that tracks the progress of the creation or modification. The response also includes an HTTP response
code, which indicates whether the request succeeded or failed, and might be accompanied by a URL that
points to a location from which you can retrieve additional information.
These operations can repeat, in this order, for as long as necessary.
vCloud API REST Requests
To retrieve object representations, clients make HTTP requests to object references. The server supplies these
references as href attribute values in responses to GET requests.
Every cloud has a well-known URL from which an unauthenticated user can retrieve a list of vCloud API
versions that the server supports. Each version has its own login URL. A system administrator can use that
URL to authenticate to the cloud by logging in to the System organization. An authenticated user can discover
other vCloud API URLs by making GET requests to URLs retrieved from the login response, and the URLs
contained in responses to those requests. See Chapter 3, “Exploring a Cloud,” on page 41.
Requests are typically categorized in terms of the type of requested operation: create, retrieve, update, and
delete. This sequence of verbs is often abbreviated with the acronym CRUD.
Table 1-2. CRUD Operations Summary
Operation Type HTTP Verb Operation Summary
Create POST Creates a new object.
Retrieve GET Retrieves the representation of an
existing object.
Update PUT Modifies an existing object.
Delete DELETE Deletes an existing object.
Authentication
HTTP communications between a vCloud API client and server are secured with SSL. The vCloud API also
implements Basic HTTP Authentication, as defined by RFC 2617, which enables a client to authenticate
individual HTTP requests by including an authentication header in the request. See “Logging In,” on
page 24.
Request Headers
The following HTTP headers are typically included in vCloud API requests:
Accept
All requests must include an HTTP Accept header that designates the XML
namespace in which to process the request. The following header indicates that
the request is to be processed in the vCloud API 1.5 namespace:
Accept: application/*+xml;version=1.5
Accept-Encoding
By default, vCloud Director returns response content as uncompressed XML.
Compressing the response can improve performance, especially when the
response is large and network bandwidth is a factor. To request a response to
be returned as compressed XML, include the following header:
Accept-Encoding: gzip
vCloud API Programming Guide
16 VMware, Inc.