1.5
Table Of Contents
- vCloud API Programming Guide
- Contents
- vCloud API Programming Guide
- About the VMware vCloud API
- Hello vCloud: A Simplified RESTful Workflow
- Exploring a Cloud
- Provisioning an Organization with vApps, Templates, and Media
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for a Virtual Machine
- Retrieve or Update a Modifiable Section
- Update a vApp Network Configuration
- Update the NetworkConnectionSection of a Virtual Machine
- Retrieve or Modify the CPU Configuration of a Virtual Machine
- Retrieve or Modify the GuestCustomizationSection of a Virtual Machine
- Retrieve or Modify ProductSection Elements
- Retrieve or Modify Groups of Related Sections in a Virtual Machine
- Retrieve or Modify the Hard Disk Configuration of a Virtual Machine
- Creating, Provisioning, and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- Network Administration
- vDC Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Controlling Access to vApps and Catalogs
- Using vCloud API Extensions to Provision and Manage a Cloud
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- XML Representations in the vCloud API
- Index
8 Displaying the Virtual Machine Console on page 37
After a vApp is powered on, you can retrieve a screen ticket from one of its virtual machines. You use
that ticket with the VMRC browser plug-in to gain access to the console of the virtual machine.
9 Delete the vApp on page 38
To delete the vApp, power it off, undeploy it, and then use an HTTP DELETE request to delete the vApp
object.
10 Log Out on page 39
To log out and terminate a vCloud API session, delete the Session you created when you logged in.
Logging In
vCloud Director requires API requests to be authenticated. The first step in any RESTful workflow is to obtain
an authentication token.
Every cloud has a login URL that a client can obtain by making an unauthenticated GET request to the
vCloud Director api/versions URL. See “Retrieve the Login URL and List of Supported API Versions,” on
page 42. Because all other vCloud API requests must be authenticated, any vCloud API workflow must begin
with a login request that supplies user credentials in the form that Basic HTTP authentication requires.
For information about how to create a login request and view the response, see “Example: Login Request and
Response,” on page 25.
Prerequisites
Verify that the following conditions are met:
n
You know the username and password of the system administrator or a member of one of the organizations
in the cloud. The Hello vCloud workflow requires you to log in as a user who has permission to create
and operate vApps.
n
You have access to an organization in which at least one vDC was created and provisioned with a network.
For more information about setting up an organization to support the Hello vCloud workflow, see
Chapter 6, “Creating, Provisioning, and Managing Organizations,” on page 109.
n
The organization contains a catalog in which at least one vApp template is available. For more information
about adding a vApp template to a catalog, see Chapter 4, “Provisioning an Organization with vApps,
Templates, and Media,” on page 53.
Procedure
1 Make an API versions request to vCloud Director to obtain the login URL for the REST API.
2 Use the login URL to create a login session.
POST a request to this URL that includes your username, password, and organization name in a MIME
Base64 encoding. See “Example: Login Request and Response,” on page 25.
3 Examine the response.
The response code indicates whether the request succeeded, or how it failed.
A successful login request returns an authentication token that you can use in subsequent requests. It also
returns a Session element, which contains one or more Link elements, each of which provides a URL that you
can use to explore a subset of objects in the cloud. If you log in as a system administrator or organization
administrator, this list includes multiple links. See “Example: Create a Login Session,” on page 44. Otherwise,
the list typically includes a link of type application/vnd.vmware.vcloud.orgList+xml, as shown in the response
portion of “Example: Login Request and Response,” on page 25. You can use this link to find out more about
your organization and the objects it contains.
For more information about the other links in the Session element, see “Create a Login Session,” on
page 44.
vCloud API Programming Guide
24 VMware, Inc.