5.5

Table Of Contents
2 Compare the values of the size and the bytesTransferred attributes of each File element.
When these two values are equal, the file transfer is complete.
After all the files are uploaded, the response includes final values for the bytesTransferred attribute of each
File, and a Task that tracks the events leading up to resolution of the template with the uploaded files, as
shown in “Example: Monitoring the Progress of an Upload,” on page 67.
Example: Monitoring the Progress of an Upload
Request:
GET https://vcloud.example.com/api/vAppTemplate/vappTemplate-111
The complete VAppTemplate body is returned. This example omits most of it for clarity.
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.vAppTemplate+xml
...
<VAppTemplate
...
name="Ubuntu Template"
id="urn:vcloud:vapptemplate:111"
href="https://vcloud.example.com/api/vAppTemplate/vappTemplate-111"
type="application/vnd.vmware.vcloud.vAppTemplate+xml" ... >
...
<Files>
...
<File
size="1950489088"
bytesTransferred="500000000"
name="disk0.vmdk">
<Link
rel="upload:default"
href="https://vcloud.example.com/transfer/.../disk0.vmdk"/>
</File>
</Files>
...
</VAppTemplate>
Using Ranged PUT requests to Complete a Partial Upload
You typically need ranged PUT requests for very large uploads, especially when network bandwidth or
latency might cause the operation to time out.
If the response to an upload progress request indicates that the upload terminated before it was complete,
you can use the size and bytesTransferred values from the response to construct a ranged PUT request of
the remaining contents, as shown in “Example: Ranged PUT Request to Complete a Partial Upload,” on
page 68.
Procedure
1 Retrieve the VAppTemplate and find the File element that references the partially uploaded file.
Chapter 4 Provisioning an Organization
VMware, Inc. 67