1.5
Table Of Contents
- vCloud API Programming Guide
- Contents
- vCloud API Programming Guide
- About the VMware vCloud API
- Hello vCloud: A Simplified RESTful Workflow
- Exploring a Cloud
- Provisioning an Organization with vApps, Templates, and Media
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for a Virtual Machine
- Retrieve or Update a Modifiable Section
- Update a vApp Network Configuration
- Update the NetworkConnectionSection of a Virtual Machine
- Retrieve or Modify the CPU Configuration of a Virtual Machine
- Retrieve or Modify the GuestCustomizationSection of a Virtual Machine
- Retrieve or Modify ProductSection Elements
- Retrieve or Modify Groups of Related Sections in a Virtual Machine
- Retrieve or Modify the Hard Disk Configuration of a Virtual Machine
- Creating, Provisioning, and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- Network Administration
- vDC Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Controlling Access to vApps and Catalogs
- Using vCloud API Extensions to Provision and Manage a Cloud
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- XML Representations in the vCloud API
- Index
Retrieve or Update a Metadata Value
Each
name
=
value
pair in an object's metadata is represented as a MetadataEntry element, which includes links
that a system administrator or object owner can use to retrieve or update the metadata value, or delete the
MetadataEntry.
Prerequisites
n
Verify that you are logged in as a system administrator or the object owner.
n
Retrieve the object's Metadata element. See “Retrieve or Update a Metadata Element,” on page 196
Procedure
1 Examine the retrieved Metadata element to find the Key you want.
Each key name is defined by the content of a Key element.
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 modify the Key contents, you must update the entire Metadata element. See “Retrieve or Update a
Metadata Element,” on page 196.)
n
To retrieve the value, make a GET request to the URL. The response is a MetadataValue element.
n
To update the value, make a PUT request to the URL and supply a MetadataValue element as the
request body. See .“Example: Update a Metadata Value,” on page 199
NOTE If you know the name of a key (the content of a Key element), you can construct a URL to retrieve
its value by appending the key name to the object's metadata URL. The key name is case-sensitive. Any
special characters it contains must be appropriately escaped in the URL. See “vCloud API Object Metadata
Contents,” on page 195.
Example: Update a Metadata Value
This request updates the value of the metadata Key named LOS from the original value of bronze (shown in
“Example: Update a Metadata Element,” on page 197) to a new value of silver. The response is a task.
Request:
PUT https://vcloud.example.com/api/admin/org/26/metadata/LOS
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">
<Value>silver</Value>
</MetadataValue>
Response:
<Task
xmlns="http://www.vmware.com/vcloud/v1.5"
status="running"
...
operationName="metadataUpdate"
Chapter 8 Working With Object Metadata
VMware, Inc. 199