2
Hello vCloud: A Structured REST
Workflow Example
This chapter presents a simple example of a structured REST workflow for discovering and deploying a
particular vApp (in this case, an FTP server with a connection to the public Internet).
This chapter includes the following topics:
"Logging In and Getting an Organization List" on page 21
"Browsing an Organization" on page 22
"Finding a vApp Template" on page 23
"Getting Information About a vDC" on page 24
"Instantiating the Template in the vDC" on page 24
"Deploying and Powering On the vApp" on page 26
"Getting Information About the vApp" on page 27
"Deleting the vApp" on page 30
"Logging Out" on page 30
Logging In and Getting an Organization List
Every vCloud has a login URL that a client can obtain by making an unauthenticated GET request to the
vCloud's versions URL, as shown in Example 8‐2 on page
be authenticated, any vCloud API workflow has to begin with a login request that supplies user credentials in
the form required by Basic HTTP authentication (MIME Base64 encoding of a string having the form
user@vcloud‐organization:password). Example
URL is http://vcloud.example.com/api/v1.0/login.
Example 2-1. Login Request and Response
Request:
POST http://vcloud.example.com/api/v1.0/login
Authorization: Basic
Response:
200 OK
Date:
request-date
x-vcloud-authorization: cn9uYmdugN8E2j96+5Lqrc3YBvFsEgDHXzyfJrJ/6bM=
Content-Type: application/vnd.vmware.vcloud.orgList+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<OrgList ... href="http://vcloud.example.com/api/v1.0/org/" ... >
<Org type="application/vnd.vmware.vcloud.org+xml" name="ExampleOrg"
VMware, Inc.
2‐1 shows a login request and response for a vCloud whose login
encoded-credentials
href="http://vcloud.example.com/api/v1.0/org/5"/>
147. Because all other vCloud API requests must
2
21