vCloud API Programming Guide for Service Providers

This guide covers version 29.0 of the vCloud API, which corresponds to this release of VMware vCloud Director. It is designed for developers building RESTful clients to interact with and extend the capabilities of vCloud Director.

Guide Version History

We revise this guide with each release of VMware vCloud Director. The vCloud API version number increments whenever its types or operations change.

Note: We may deprecate an API version if a newer version supports an equivalent feature set. We strongly recommend against using deprecated APIs, as support for them may be removed in a future release.

Revision History

Revision Date

Description

Release Vehicle

Status

25 SEP 2017

API Version 29.0

vCloud Director 9.0

supported

21 FEB 2017

API Version 27.0

vCloud Director 8.20

supported

26 MAY 2016

API Version 20.0

vCloud Director 8.10

supported

N/A

API Version 19.0

vCloud Air Compute Service

deprecated

N/A

API Version 18.0

vCloud Air Compute Service

deprecated

25 JAN 2016

API Version 17.0

vCloud Air Compute Service

supported

N/A

API Version 16.0

vCloud Air Compute Service

deprecated

15 DEC 2015

API Version 14.0

vCloud Air Compute Service

deprecated

21 SEP 2015

API Version 13.0

vCloud Air Compute Service

supported

22 AUG 2015

API Version 12.0

vCloud Air Compute Service

deprecated

10 JUL 2015

API Version 11.0

vCloud Air Compute Service

deprecated

10 SEP 2015

API Version 9.0

vCloud Director 8.0, vCloud Air Compute Service

supported

15 APR 2015

API Version 7.0.

vCloud Air Compute Service

deprecated

16 MAR 2015

API Version 6.0

vCloud Air Compute Service

deprecated

13 JAN 2015

API Version 5.11

vCloud Air Compute Service

deprecated

24 OCT 2014

API Version 5.10

vCloud Air Compute Service

deprecated

19 SEP 2014

API Version 5.9

vCloud Air Compute Service

deprecated

05 SEP 2014

API Version 5.8

vCloud Air Compute Service

deprecated

01 AUG 2014

API Version 5.7.

vCloud Air Compute Service

deprecated

07 OCT 2014

API Version 5.6

vCloud Director 5.6

supported

19 SEP 2013

API Version 5.5

vCloud Director 5.5

supported

10 SEP 2012

API Version 5.1

vCloud Director 5.1

Deprecated. Unsupported after vCloud Director 9.0.

01 SEP 2011

API Version 1.5

vCloud Director 1.5

Deprecated. Unsupported after vCloud Director 9.0.

30 AUG 2010

API Version 1.0

vCloud Director 1.0

not supported

14 APR 2010

API Version 0.9

N/A

not supported

Who Should Use This Guide

This guide is for software developers who create VMware Ready cloud services, including interactive clients for vCloud Director. To get the most from this guide, you should be familiar with:

  • REST principles and stateless architecture

  • The Open Virtualization Format (OVF) specification

  • VMware virtual machine technology

  • Common web technologies like XML and HTTP

Related Resources

  • vCloud API Schema Reference: Find comprehensive reference material for all elements, types, requests, and operations in the vCloud API, including schema definition files. Access the schema at https://code.vmware.com.

Introduction to the VMware vCloud API

The VMware vCloud API enables developers to build interactive clients for VMware vCloud Director using a RESTful style. Clients communicate with servers over HTTP by exchanging XML representations of vCloud objects.

  • Use HTTP GET to retrieve an object.

  • Use HTTP POST and PUT to create or modify an object.

  • Use HTTP DELETE to remove an object.

Hello vCloud: A Simplified RESTful Workflow

This example walks through a basic workflow to discover and deploy a vApp (for instance, an FTP server). The process involves exchanging XML representations of objects over HTTPS.

These examples assume you have access to an organization with a vApp template and a network that supports public Internet connections. The workflow is flexible and can adapt to different templates and cloud capabilities.

Prerequisites

To run the "Hello vCloud" samples, ensure you meet these conditions:

  • You have user credentials with the vApp Author privilege set (or equivalent).

  • Your organization has at least one Virtual Data Center (VDC) with a network. For details, see Managing an Organisation.

  • A catalog in your organization contains at least one vApp template. For details, see Deploying an Organisation.

Procedure

1

Log In

Start an API session by requesting a Session object. Include your credentials in the Authorization header as required by your identity provider. The response includes an authorization token for all subsequent requests.

2

Find a Catalog and a VDC

Before deploying a vApp, you must identify a source vApp template in a catalog and a target VDC for deployment.

3

Retrieve Catalog Contents

Send a GET request to the catalog's URL to retrieve a list of its vApp templates and media images.

4

Retrieve a Catalog Item

Examine the catalog list and select an item based on its name and type attributes. Retrieve the item to get its description and a reference to the underlying object.

5

Retrieve Deployment Information From the VDC

To deploy the template, you must specify both a target VDC and a VDC network for the vApp to connect to.

6

Deploy the vApp

Create a vApp by instantiating the template. This process binds the template's abstract resource requirements (like network, storage, memory, and CPU) to concrete resources in the target VDC.

7

Get vApp Information

After instantiation, the server returns the URL of the new vApp. Use a GET request on this URL to retrieve information for connecting to, modifying, and operating the vApp.

8

Display the Virtual Machine Console

Once the vApp is powered on, you can retrieve a screen ticket from any of its virtual machines. Use this ticket with the VMware HTML Console SDK to access the VM console from a browser.

9

Undeploy and Delete the vApp

After you undeploy and power off the vApp, you can delete it by sending an HTTP DELETE request to the vApp object's URL.

10

Log Out

End your vCloud API session by deleting the Session object you created during login.

Exploring the Cloud

You can browse cloud containers like organizations, catalogs, and VDCs using HTTP GET requests. The responses contain metadata about the container and link elements with href attributes pointing to the objects it contains.

This process, known as sequential discovery, lets you navigate the API hierarchically. You can start browsing from the entry points listed in the Session element returned after a successful login. The available entries depend on your rights and privileges.

Related links: 

Create a vCloud API session
Retrieve a List of Accessible Organizations

Retrieve an Administrative View of a Cloud
Retrieve a List of vSphere Platform Operations and Objects for a Cloud
XML Representations in the vCloud API

 

Organization Initialization

The vCloud API provides several methods to make vApp templates, vApps, media images, and independent disks available to users.

The vCloud Director Transfer Service manages file transfers, using temporary storage. The API distinguishes between:

  • Download: Transferring content from the client system to vCloud Director (initiated with a POST request).

  • Upload: Transferring content from vCloud Director to the client (initiated with a GET request).

Downloaded vApp templates and media images become available as catalog items.

Beyond uploads, you can provision resources using these operations:

  • Clone: The cloneVApp operation copies a vApp within a VDC. You can optionally delete the source to effectively move or rename it.

  • Capture: The captureVApp operation creates a vApp template from an existing vApp and places it in a catalog.

  • Import: A system administrator can import a virtual machine from vCenter Server as a vApp or vApp template, adding it to a catalog or downloading it as an OVF package.

  • Accept: The system can automatically discover vCenter VMs in resource pools backing a VDC. Administrators can make these VMs available for adoption by organization members.

  • Subscribe: Organizations with the right permissions can create catalogs with external subscriptions, pulling content from another vCloud Director instance or any site implementing the VMware Content Subscription Protocol.

You can also create independent disks within a VDC and connect them to any virtual machine in that VDC.

Related links 

Deploying and Using vApps and Virtual Machines

A vApp is a container for one or more virtual machines, specifying their detailed configuration and network connections. The vCloud API provides programmatic access to self-service operations for creating, configuring, deploying, and managing vApps.

The vApp Lifecycle

A vApp progresses through several states:

  1. OVF Package: The distribution format for vApps.

  2. vApp Template: Created when you upload an OVF package to a catalog.

  3. Undeployed vApp: Created when you instantiate a template without deploying it.

  4. Deployed vApp: A fully instantiated vApp, ready to be powered on and managed. Instantiation can include deployment, power-on, or both.

The initial configuration of a vApp is defined by its source OVF package. Once you create a vApp, you can reconfigure it. Note that these changes are lost when you delete the vApp, unless you first capture the vApp as a new template.

About OVF

The Open Virtualization Format (OVF) is a key standard:

  • It is a widely supported format for distributing virtual appliances.

  • Vendor tools simplify OVF creation and conversion from existing VMs.

  • It can express complex relationships between virtual devices in enterprise applications.

  • Its extensibility allows ISVs to introduce new features without changing the vCloud API.

We recommend that administrators and advanced users familiarize themselves with the OVF standard. You can find the full specification on the DMTF website.

Note: The vCloud API does not support the single-file OVA archive format for upload or download.

State diagram illustrating how an uploaded OVF package becomes a vApp template, and an instantiated template becomes a vApp

About Instantiation

Instantiation is the process of creating a vApp from a vApp template. It binds the template's abstract resource requirements to the concrete resources available in a VDC. You can specify instantiation parameters to modify the virtual hardware configuration, including network connections, of the resulting VMs.

Related Links:

 
 
 

Have you tried Cloud4U services? Not yet?

Visit Website

Try for free

  • 68 Users Found This Useful
Was this answer helpful?

Related Articles

How to access VMware Cloud Director via the vCloud API

Overview To perform some tasks in a CLOUD4Y environment, you may need to access VMware Cloud...

Changing EDGE settings with the vCloud API

Getting Started This tutorial shows how to receive, modify and send XML blocks representing the...

Changing Advanced Edge Gateway Settings via API Using PowerShell 7

This guide demonstrates how to modify Advanced Edge Gateway settings through the API using...

vCloud Director API for NSX: Programmers’ Guide

The vCloud Director API for NSX acts as a proxy, allowing vCloud API clients to send requests to...