Each name=value pair in an object's metadata is represented as a MetadataEntry element, which includes links that an administrator or the object owner can use to retrieve or update the metadata value, or delete the MetadataEntry.

Verify that you are logged in to the vCloud API endpoint as a Virtual Infrastructure Administrator or the End User who owns this object.

Retrieve the object's Metadata element. See Retrieve or Update a Metadata Element

1

Examine the retrieved Metadata element to find the MetadataEntry you want.

Each MetadataEntry contains a link of the following form, which you can use when updating the Value of the entry:

<Link
   rel="edit"
   type="application/vnd.vmware.vcloud.metadata.value+xml"
   href="https://vcloud.example.com/api/admin/object/id/metadata/DOMAIN/key-name" />

For example:

<Link
   ...
   href="https://vcloud.example.com/api/admin/org/26/metadata/SYSTEM/LOS/>
2

Retrieve or update the value.

Make a request to the URL in the value of the href attribute of the MetadataEntry that contains the Key.

To retrieve the value, make a GET request to URL in the value of the href attribute of the MetadataEntry. The response is a MetadataValue element.

To update the value, make a PUT request to the URL in the edit link described in Step 1, and supply a MetadataValue element as the request body. See .Example: Update a Metadata Value

This request updates the value of the metadata Key named PenTested from the original value of false (shown in Example: Update a Metadata Element) to a new value of true.

Request:

PUT https://vcloud.example.com/api/vApp/vapp-7/metadata/PenTested
Content-Type: application/vnd.vmware.vcloud.metadata.value+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<MetadataValue
   xmlns="http://www.vmware.com/vcloud/v1.5"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <TypedValue
      xsi:type="MetadataBooleanValue">
      <Value>true</Value>
   </TypedValue>
</MetadataValue>

The response is a task.

Response:

<Task
   xmlns="http://www.vmware.com/vcloud/v1.5"
   status="running"
   ...
   operationName="metadataUpdate"
   operation="Updating metadata for vApp (7)"
   ... >
   ...     
</Task>