You can add a service link to an existing service.
A ServiceLink element must contain the following child elements:
1 | Retrieve the XML representation of the service. This request retrieves the XML representation of the service created in Example: Register an Extension Service: 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 |
This request adds a ServiceLink to the service created in Example: Register an Extension Service
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>
200 OK Content-type: application/vnd.vmware.admin.serviceLink+xml ... <vmext:ServiceLink ...> ... </vmext:ServiceLink>