Delete a service link when you no longer want it to appear in the representation of an VMware Cloud Director 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.

Prerequisites

This operation is restricted to system administrators.

Procedure

  1. Retrieve the XML representation of the service.
    This request retrieves the XML representation of the service created in Register an Extension Service:
    GET https://vcloud.example.com/api/admin/extension/service/45
  2. Examine the response to find the Link for listing service links.
    This Link has the following form:
    <vcloud:Link
          rel="down:serviceLinks"
          type="application/vnd.vmware.vcloud.query.records+xml"
          href="https://vcloud.example.com/api/admin/extension/service/44/links" />
  3. Make a GET request to the link described in Step 2.
  4. Examine the response to find the ServiceLinkRecord that represents the service link to delete.
  5. Make a DELETE request to the URL in the href attribute value of that ServiceLinkRecord.

Example: Delete a Service Link

Start by getting the service's list of service links.

Request:
GET https://vcloud.example.com/api/admin/extension/service/45
Response:
<?xml version="1.0" encoding="UTF-8"?>
<QueryResultRecords
   total="3"
   pageSize="25"
   page="1"
   name="serviceLink"
   type="application/vnd.vmware.vcloud.query.records+xml"
   ... >
   ...
   <ServiceLinkRecord
      service="https://vcloud.example.com/api/admin/extension/service/45"
      resourceType="application/vnd.vmware.vcloud.vApp+xml"
      rel="down"
      mimeType="application/vnd.vmware.vcloud.backupList+xml"
      linkHref="{baseUri}api/vApp/vapp-{resourceId}/backups"
      href="https://vcloud.example.com/api/admin/extension/service/link/01ca..." />
   <ServiceLinkRecord
      service="https://vcloud.example.com/api/admin/extension/service/45"
      resourceType="application/vnd.vmware.vcloud.org+xml"
      rel="down"
      mimeType="application/vnd.vmware.vcloud.backupList+xml"
      linkHref="{baseUri}org/{resourceId}"
      href="https://vcloud.example.com/api/admin/extension/service/link/a624..." />
   <ServiceLinkRecord
      service="https://vcloud.example.com/api/admin/extension/service/45"
      resourceType="application/vnd.vmware.vcloud.vApp+xml"
      rel="backup"
      mimeType="application/vnd.vmware.vcloud.createBackupParams+xml"
      linkHref="{baseUri}vApp/vapp-{resourceId}/action/backup"
      href="https://vcloud.example.com/api/admin/extension/service/link/f62e..." />
</QueryResultRecords>
Note:

Link id values are truncated in this example.

Using this information, find the ServiceLinkRecord that represents the service link you want to delete, and make a DELETE request to that URL.
DELETE https://vcloud.example.com/api/admin/extension/service/link/f62e...