EasyManua.ls Logo

VMware VCLOUD API 1.0 - API

VMware VCLOUD API 1.0 - API
212 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
VMware, Inc. 45
Chapter 4 Provisioning
<File size="1950489088" bytesTransferred="0" name="disk0.vmdk">
<Link rel="upload:default" href="http://vcloud.example.com/transfer/.../disk0.vmdk"/>
</File>
</Files>
</VAppTemplate>
Inthisexample,theovfDescriptorUploadedattributehasavalueoftrueandthestatusattributehasa
valueof0.Ifthedescriptorfailsvalidation,thestatusissetto‐1,andthetemplatecontainsaTaskelement
whoseErrorelementindicatesthereasonforthefailure.
EachoftheFile
elementsincludesanuploadlink(<Link rel="upload:default" ... />)andseveral
attributes:
size.Thefilesize,takenfromthesizeattributeoftheFileelementintheOVFdescriptor.
bytesTransferred.Forallfilereferencesotherthanthedescriptor,thisattributeisinitiallysettoavalueof
0indicatingthattheuploadhasnotyetbegun.IntheFilereferencetothedescriptor,thevalueofthe
bytesTransferredattributeisequaltothevalueofthesizeattribute,indicating
thatallthebytesinthe
descriptorhavebeentransferred.
name.Thefilename,takenfromthehrefattributeoftheFileelementintheOVFdescriptor.
Including a Manifest
SomeOVFpackagesincludeamanifestdocument,whichspecifiesachecksumforeachfileinthepackage.If
youareuploadingapackagethatincludesamanifestfile,addamanifestRequired="true"attributetothe
requestbody,asshowninExample 45.
Example 4-5. uploadVappTemplate Request for an OVF Package That Includes a Manifest
POST http://vcloud.example.com/api/v1.0/vdc/5/action/uploadVAppTemplate
Content-Type: application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml
<UploadVAppTemplateParams name="Ubuntu Template" manifestRequired="true"
xmlns="http://www.vmware.com/vcloud/v1" >
<Description>Ubuntu vApp Template</Description>
</UploadVAppTemplateParams>
Whenyouspecifythatamanifestisrequired,thesetofFileelementsreturnedafteryouuploadtheOVF
descriptorincludesoneforthemanifestitself.Afterallthefilesareuploaded,eachfileischeckedbytheserver
toverifythatitschecksummatchestheonestatedinthemanifest.
Ifanychecksumsdonotmatch,the
template’sstatusattributeissetto‐1andthetemplatecontainsaTaskelementwhoseErrorelement
indicatesthereasonforthefailure.
Uploading the Files
InformationfromtheserversresponseinExample 43enablestheclienttoconstructaseriesofPUTrequests,
oneforeachFileinthelist,thatuploadthefilesreferencedbythetemplate.Eachrequestspecifiesanupload
URLandacontentlengthinbytes.
Example 46showsanuploadrequest
foroneofthefilesrequiredbyanOVFpackage.Theuploadrequestis
simplyafewheaderlines,followedbytheserializedfilecontent.

Table of Contents

Related product manuals