5.5

Table Of Contents
Adding or Removing Service Links
A service can add its own Link elements to the representations of vCloud API objects. You can create these
service links when you register a service. You can also add or remove the links after you register the service.
You can create multiple service links as part of registering a service. After you register a service, you can
add or remove individual links. Service links typically appear in the representations of all objects of a
specific type, but you can constrain them to appear in a particular object of that type. Service links are not
included in object representations unless the service that created them is enabled.
NOTE You cannot update a service link, but you can remove existing links and create links.
Prerequisites
Verify that you are logged in to the vCloud API as a system administrator.
Add a Service Link
You can add a service link to an existing service.
A ServiceLink element must contain the following child elements:
LinkHref
The value of href attribute of the Link. This can be any URI, and can include
the variables {baseUri} and {resourceId}. When constructing the href value
of the Link, vCloud Director replaces {baseUri} with the vCloud Director
REST API base URL, and replaces {resourceId} with the UUID portion of
the id attribute value of the resource in which the Link is inserted. The
following example might expand to the string
https://vcloud.example.com/org/17.
<LinkHref>
{baseUri}/org/{resourceId}
</LinkHref>
MimeType
The value, specified as a MIME content type, of the type attribute of the Link.
Rel
Defines the relationship of the link to the object that contains it. A
relationship can be the name of an operation on the object, a reference to a
contained or containing object, or a reference to an alternate representation of
the object. The relationship value implies the HTTP verb to use when you
use the link's href value as a request URL.
ResourceType
The object type, specified as a MIME content type, of the object in which the
Link appears.
NOTE You can constrain the Link to appear in a specific resource by including a ResourceId element in the
ServiceLink. This element contains the id of the resource in which the Link will appear. This resource must
be of the type specified in the ResourceType element of the ServiceLink.
Prerequisites
Verify that you are logged in to the vCloud API as a system administrator.
vCloud API Programming Guide
336 VMware, Inc.