5.5

Table Of Contents
...
operation="Updating Virtual Application Win2K3 (12)"
...>
...
</Task>
Retrieve or Modify ProductSection Elements
ProductSection elements allow you to pass runtime information to vApps and virtual machines. The
key=value pairs in this section are made available in the OVF Environment of a powered-on vApp or virtual
machine.
A vApp or virtual machine can get runtime information from its ovf:Environment element. This read-only
element is populated with information from a ProductSection element when the vApp or virtual machine is
powered on. A Vm can use VMware Tools to read these values from its ovf:Environment. A Vm can also read
the values by mounting a special media object. To make a key=value pair available in the ovf:Environment,
add it to the appropriate ProductSection of a vApp template or powered-off vApp or virtual machine.
NOTE All ProductSection elements in a vApp template, vApp, or virtual machine are returned as members
of a ProductSectionList. You cannot retrieve or update an individual ProductSection. You must retrieve
and modify the ProductSectionList to update the individual ProductSection elements it contains.
Prerequisites
Verify that you are logged in to the vCloud API as an administrator or vApp Author.
Procedure
1 Retrieve the ProductSectionList from the vApp or virtual machine.
Use a request like this one, which targets a vApp.
GET https://vcloud.example.com/api/vApp/vapp-123/productSections
The response is a ProductSectionList element, which contains all the ProductSection elements in the
vApp, along with a Link element that contains the rel="edit" URL to use when updating the
ProductSectionList. If the vApp contains no ProductSection elements, the response contains only the
Link element.
2 Modify the retrieved ProductSectionList.
You can modify existing ProductSection elements, create new ones, or both. ProductSection has no
required contents. Unlike updates to other sections, updates to a ProductSection merge new and
existing values, subject to the following rules:
n
Property elements that are present in the existing ProductSection but not in the update are
removed.
n
Property elements that are present in the update but not in the in the existing ProductSection are
added to the ProductSection if they have a corresponding Value element.
n
If a Property element that is present in the existing ProductSection has different attributes,
qualifiers, or other details in the update, the Property in the update replaces the existing one.
n
If a Property element that is present in the existing ProductSection has no Value in the update, the
existing Property and Value remain unchanged.
3 Update the section with your modifications.
Find the Link element in the ProductSectionList where rel="edit". Make a PUT request to the URL in
that link's href attribute value, and supply the modified ProductSectionList 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.
Chapter 5 Deploying and Operating vApps
VMware, Inc. 139