5.5

Table Of Contents
Procedure
1 Retrieve the XML representation of the service.
This request retrieves the XML representation of the service created in “Example: Register an Extension
Service,” on page 333:
GET https://vcloud.example.com/api/admin/extension/service/45
2 Examine the response to find the Link for adding service links.
This Link has the following form:
<vcloud:Link
rel="add"
type="application/vnd.vmware.admin.serviceLink+xml"
href="https://vcloud.example.com/api/admin/extension/service/44/links" />
3 Create a ServiceLink element that specifies the properties of the new link.
4 POST the ServiceLink element to the URL described in Step 2
See “Example: Add a Service Link,” on page 337.
Example: Add a Service Link
This request adds a ServiceLink to the service created in “Example: Register an Extension Service,” on
page 333
Request:
POST https://vcloud.example.com/api/admin/extension/service/45/links
Content-type: application/vnd.vmware.admin.serviceLink+xml
<?xml version="1.0" encoding="UTF-8"?>
<vmext:ServiceLink
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
type="application/vnd.vmware.admin.serviceLink+xml">
<vmext:LinkHref>{baseUri}vApp/vapp-{resourceId}/action/deleteBackup</vmext:LinkHref>
<vmext:MimeType>application/vnd.example.vcd-backup.createBackupParams+xml</vmext:MimeType>
<vmext:Rel>deleteBackup</vmext:Rel>
<vmext:ResourceType>application/vnd.example.vcd-backup.vApp+xml</vmext:ResourceType>
</vmext:ServiceLink>
Response:
200 OK
Content-type: application/vnd.vmware.admin.serviceLink+xml
...
<vmext:ServiceLink ...>
...
</vmext:ServiceLink>
Delete a Service Link
Delete a service link when you no longer want it to appear in the representation of an vCloud API objects, or
when you want to replace it with a new service link.
When you retrieve the list of service links associated with a service, the response is a QueryResultRecords
element in which each service link is represented as a ServiceLinkRecord element. The value of the href
attribute of a ServiceLinkRecord is a URL you can use to retrieve or delete the service link.
Chapter 11 vCloud Director Extension Services
VMware, Inc. 337