5.6
Table Of Contents
- vCloud Air Platform Programmer's Guide
- Contents
- About this Programmer's Guide
- About the vCloud Air Platform APIs
- The VMware APIs for Cloud Automation
- XML Namespace Identifiers
- Overview of Object Types
- Link Relationships in the Object Types
- API Versioning
- Roles for the APIs for Cloud Automation
- Authentication and Authorization
- vCloud Air Platform APIs Schema Reference
- Java Code Samples for Cloud Automation
- About the Examples in this Programmer's Guide
- Hello vCloud Air : A RESTful Workflow
- Index
serviceType="compute:type"
type="application/xml;class=vnd.vmware.vchs.compute"
href="https://vchs.vmware.com/api/vchs/compute/compute-uuid" />
</Services>
Example: Requests and Responses to Log in to Your Services
This example shows the two parts that are required for logging in to the Compute Service that you have
subscribed to with vCloud Air. The first part of the example shows the request and response for HelloUser
to log in to vCloud Air at the URL https://vchs.vmware.com/api/vchs/sessions In Request 1, the initial
POST requires you enter the Authorization header with an encoded Base64 username:password value.
The second part shows the request and response for HelloUser to pass the authorization token to obtain the
compute service list purchased for the user's company account. The service list contains one service for a
Dedicated Cloud subscription.
Request 1:
POST https://vchs.vmware.com/api/vchs/sessions
Authorization: Basic Vk13YXJlMTIzIQ==
Accept: application/xml;version=5.6
Response 1:
201 Created
Response Header: x-vchs-authorization:f1c687e31731cc9a5820d233e46ef1dfa131cb45
...
<Session
type="application/xml;class=vnd.vmware.vchs.session"
href="https://vchs.vmware.com/api/vchs/session"
xmlns="http://www.vmware.com/vchs/v5.6"
xmlns:tns=http://www.vmware.com/vchs/v5.6
xmlns:xs=http://www.w3.org/2001/XMLSchema
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance>
<Link
rel="down"
type="application/xml;class=vnd.vmware.vchs.servicelist"
href="https://vchs.vmware.com/api/vchs/services" />
<Link
rel="remove"
href="https://vchs.vmware.com/api/vchs/session" />
</Session>
Request 2:
GET https://vchs.vmware.com/api/vchs/services
Authorization: x-vchs-authorization:f1c687e31731cc9a5820d233e46ef1dfa131cb45
Accept: application/xml;version=5.6
Response 2:
200 OK
<Services
type="application/xml;class=vnd.vmware.vchs.servicelist"
href="https://vchs.vmware.com/api/vchs/services"
...>
<Service
region="US - Las Vegas"
serviceId="example-1101-130711-1"
Chapter 2 Hello vCloud Air : A RESTful Workflow
VMware, Inc. 17