5.5

Table Of Contents
<Link
rel="upload:default"
href="https://vcloud.example.com/transfer/.../database.iso" />
</File>
</Files>
...
</Media>
PUT the media file contents to the upload:default link in the response. The procedure is the same as the one
shown in “Uploading Referenced Files,” on page 66.
The upload URL remains valid while a transfer session is in progress, and for a maximum of 60 minutes of
transfer session idle time. A system administrator can change this default value. See “Retrieve or Update
System Settings,” on page 239.
Download a Media Image
The vCloud API supports downloading media images from a catalog.
Prerequisites
Verify that the following conditions are met:
n
You are logged in as a user who has permission to download media images.
n
You know the URL of the catalog item that references the media image.
Procedure
1 Retrieve the XML representation of the catalog and examine the catalog items that it contains.
2 Retrieve the catalog item that represents the media image.
3 Use the URL in the Entity element of the CatalogItem to retrieve the Media object.
The Media element includes a Link element of the following form, where id is the id of the media image:
<Link
rel="enable"
href="https://vcloud.example.com/api/media/id/action/enableDownload"/>
4 Enable the media image for download.
Make a POST request to the action/enableDownload URL shown in Step 2. The response is a Task
element.
5 When the task completes, retrieve the media item again.
The Media object now includes a download URL for the media file.
6 Make a GET request to the download:default URL.
The media file is downloaded to the current working directory.
Example: Download a Media Image
When you download a media file, you first enable the file for download.
Request:
POST https://vcloud.example.com/api/media/254/action/enableDownload
vCloud API Programming Guide
74 VMware, Inc.