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 Modify Groups of Related Sections in a Virtual Machine
The vCloud API provides links that you can use to retrieve or update groups of sections that define related
hardware items such as disks, media devices, and network cards in a Vm element.
As shown in “Example: Configuration Links in a Vm Element,” on page 90, Link elements for disks, media
devices, and network cards are grouped at the end of the VirtualHardwareSection. These links have content
type application/vnd.vmware.vcloud.rasdItemsList+xml, and reference a RasdItemsList element in the
VirtualHardwareSection of a Vm. The vCloud API uses the RasdItemsList element to aggregate related elements
in a VirtualHardwareSection. This approach simplifies retrieval and modification of Item elements that are
typically viewed or modified as a group.
Prerequisites
Verify that you are logged in as a system administrator or the object owner.
Procedure
1 Retrieve the RasdItemsList from a Vm.
Make a GET request to the URL in the link where type="application/vnd.vmware.vcloud.rasdItemsList
+xml" and rel="down". See “Example: Retrieve the Hard Disks and Controllers in a Virtual Machine,” on
page 105.
2 Modify the items in the retrieved list.
Modified sections must contain all required elements, even if you are not changing their values. Because
optional elements revert to default values if they are omitted or empty, it is a best practice to include
optional elements in updates. Link elements and href attributes from responses do not need to be included
in modified sections. Some elements and attributes might be read-only. See the schema reference for
details.
3 Update the sections with your modifications.
Make a PUT request to the URL in the link where type="application/vnd.vmware.vcloud.rasdItemsList
+xml" and rel="edit", and supply the modified section as the request body.
The response to this request is a Task element that tracks the update operation. When the task is complete,
the section is updated.
Example: Retrieve the Hard Disks and Controllers in a Virtual Machine
This example uses the virtualHardwareSection/disks link shown in “Example: Configuration Links in a Vm
Element,” on page 90 to retrieve the list of hard disks and hard disk controllers for a virtual machine.
Request:
GET https://vcloud.example.com/api/vApp/vm-4/virtualHardwareSection/disks
Response:
Content-Type: application/vnd.vmware.vcloud.rasdItemsList+xml
...
<RasdItemsList
xmlns="http://www.vmware.com/vcloud/v1.5"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-
schema/2/CIM_ResourceAllocationSettingData"
type="application/vnd.vmware.vcloud.rasdItemsList+xml"
href="https://vcloud.example.com/api/vApp/vm-4/virtualHardwareSection/disks" ... >
<Link
rel="edit"
Chapter 5 Deploying and Operating vApps
VMware, Inc. 105