The VMware Cloud Director API supports downloading media images from a catalog.
Prerequisites
Verify that the following conditions are met:
- You are logged in as a user who has permission to download media images.
- You know the URL of the catalog item that references the media image.
Procedure
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
Response:
202 Accepted Content-Type: application/vnd.vmware.vcloud.task+xml ... <Task ... operation="Enabling download of Media database.iso (254)" ... > ... </Task>The Task in the response tracks the creation of the downloadable image. When the task completes, retrieve the Media element again.
GET https://vcloud.example.com/api/media/254
The Media object now includes a download URL for the media file.
<Media ... > ... <Files> <File name="database.iso" bytesTransferred="0"> <Link rel="download:default" href="https://vcloud.example.com/transfer/.../database.iso" /> </File> </Files> ... </Media>
The download 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.