5.1

Table Of Contents
Procedure
1 Retrieve the XML representation of the service.
Use a request like this one:
GET https://vcloud.example.com/api/admin/extension/service/45
2 Examine the response to find the Link for adding API definitions.
This Link has the following form:
<vcloud:Link
rel="add"
type="application/vnd.vmware.admin.apiDefinition+xml"
href="https://vcloud.example.com/api/admin/extension/service/45/apidefinitions" />
3 Construct an ApiDefinition element.
For information about the contents of this element, see the request portion of “Example: Create an
Extension Service API Definition,” on page 304.
4 POST the ApiDefinition element to the URL described in Step 2.
Example: Create an Extension Service API Definition
This request defines an API for a backup service. The definition includes two FileDescriptor elements that
reference files available on the vendor's public Website. The entrypoint for requests to the service is the
vCloud Director API login URL.
Request:
POST https://vcloud.example.com/api/admin/extension/service/45/apidefinitions
Content-type:application/vnd.vmware.admin.apiDefinition+xml
<?xml version="1.0" encoding="UTF-8"?>
<vmext:ApiDefinition
name="Backup service version 5.1">
<Description>Backup service API</Description>
<vmext:EntryPoint>{baseUri}/login</vmext:EntryPoint>
<Namespace>org.example.vcd.backup</Namespace>
<vmext:Files>
<vmext:FileDescriptor>
<vmext:Description>Master schema definition file.</vmext:Description>
<vmext:File
href="http://example.com/backp/schema/v5.1/master.xsd" />
</vmext:FileDescriptor>
<vmext:FileDescriptor>
<vmext:Description>Schema definition file for backup devices.</vmext:Description>
<vmext:File
vCloud API Programming Guide
304 VMware, Inc.