5.5

Table Of Contents
Retrieve the Login URL and List of Supported API Versions
Every cloud has a login URL that a client can obtain by making an unauthenticated GET request to the
vCloud Director api/versions URL. The response to this request also lists vCloud API versions that the
server supports.
Procedure
1 Make an API version request to vCloud Director to obtain the login URL for the REST API.
See the request portion of “Example: Versions Request and Response,” on page 43.
2 Examine the response to find the login URLs.
Each version of the vCloud API that the server supports has its own login URL. Look for a line of the
following form:
<LoginUrl>http://vcloud.example.com/api/...</LoginUrl>
3 Use the login URL to log in to the cloud.
Example: Versions Request and Response
The api/versions request does not need to be authenticated. The response, a small subset of which is shown
here, includes a VersionInfo element for each API version that the server supports. Each VersionInfo
element contains:
n
A LoginUrl element that contains the URL to which a client can make a login request to access that
version of the vCloud API. See “Logging In,” on page 24.
n
MediaTypeMapping elements for each complex type supported by that version of the vCloud API.
Request:
GET http://vcloud.example.com/api/versions
Response:
200 OK
Content-Type: text/xml
...
<SupportedVersions
xmlns="http://www.vmware.com/vcloud/versions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.vmware.com/vcloud/versions
http://vcloud.example.com/api/versions/schema/versions.xsd">
<VersionInfo>
<Version>1.5</Version>
<LoginUrl>https://vcloud.example.com/api/login</LoginUrl>
<MediaTypeMapping>
<MediaType>application/vnd.vmware.vcloud.catalog+xml</MediaType>
<ComplexTypeName>CatalogType</ComplexTypeName>
<SchemaLocation>http://vcloud.example.com/api/v1.5/schema/master.xsd</SchemaLocation>
</MediaTypeMapping>
<MediaTypeMapping>
...
</MediaTypeMapping>
</VersionInfo>
<VersionInfo>
<Version>5.1</Version>
Chapter 3 Exploring a Cloud
VMware, Inc. 43