5.5

Table Of Contents
Uploading Referenced Files
You can use a PUT request to upload each file that the vApp template references.
Prerequisites
n
Verify that you uploaded the OVF descriptor. See “Uploading the OVF Descriptor,” on page 63.
n
Retrieve the upload URLs for all files in the package. See “Retrieving Additional Upload URLs,” on
page 64.
Procedure
1 Find the upload:default URL for the file you want to upload.
2 Use the upload:default URL to construct a PUT request for the file.
The request specifies an upload URL and a content length in bytes. See “Example: Uploading File
Data,” on page 66.
After all the files are uploaded, the vApp template is complete, and has a status attribute value of 8. If the
upload included a manifest file, the server checks each file in the upload to verify that its checksum matches
the one stated in the manifest. If a checksum does not match, the template’s status attribute is set to -1 and
the template contains a Task element whose Error element indicates the reason for the failure.
Example: Uploading File Data
This example shows an upload request for one of the files that an OVF package requires. The upload request
is a Content-Length header followed by the serialized file content.
Request:
PUT https://vcloud.example.com/transfer/.../disk0.vmdk
Content-length: 1950489088
...serialized contents of file disk0.vmdk...
EOF
Response:
200 OK
Monitoring the Progress of an Upload
After you initiate the upload of a file referenced by a vApp template, you can monitor the progress of the
upload by periodically retrieving the vApp template and checking the value of the file's bytesTransferred
attribute.
To monitor the progress of an upload, you can watch the bytesTransferred attribute of the file. Each File
element in the template includes a bytesTransferred attribute whose value indicates the number of bytes
that the server received.
Prerequisites
Verify that you initiated the upload of a file referenced by the vApp template.
Procedure
1 Make a GET request specifying the URL of the vApp template.
See the request portion of “Example: Monitoring the Progress of an Upload,” on page 67.
vCloud API Programming Guide
66 VMware, Inc.