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>
In
this
example,
the
ovfDescriptorUploaded
attribute
has
a
value
of
true
and
the
status
attribute
has
a
value
of
0.
If
the
descriptor
fails
validation,
the
status
is
set
to
‐
1,
and
the
template
contains
a
Task
element
whose
Error
element
indicates
the
reason
for
the
failure.
Each
of
the
File
elements
includes
an
upload
link
(
<Link rel="upload:default" ... />
)
and
several
attributes:
size
.
The
file
size,
taken
from
the
size
attribute
of
the
File
element
in
the
OVF
descriptor.
bytesTransferred
.
For
all
file
references
other
than
the
descriptor,
this
attribute
is
initially
set
to
a
value
of
0
indicating
that
the
upload
has
not
yet
begun.
In
the
File
reference
to
the
descriptor,
the
value
of
the
bytesTransferred
attribute
is
equal
to
the
value
of
the
size
attribute,
indicating
that
all
the
bytes
in
the
descriptor
have
been
transferred.
name
.
The
file
name,
taken
from
the
href
attribute
of
the
File
element
in
the
OVF
descriptor.
Including a Manifest
Some
OVF
packages
include
a
manifest
document,
which
specifies
a
checksum
for
each
file
in
the
package.
If
you
are
uploading
a
package
that
includes
a
manifest
file,
add
a
manifestRequired="true"
attribute
to
the
request
body,
as
shown
in
Example 4
‐
5
.
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.uploadVAppTemplatxml
<UploadVAppTemplateParams name="Ubuntu Template" manifestRequired="true"
xmlns="http://www.vmware.com/vcloud/v1" >
<Description>Ubuntu vApp Template</Description>
</UploadVAppTemplateParams>
When
you
specify
that
a
manifest
is
required,
the
set
of
File
elements
returned
after
you
upload
the
OVF
descriptor
includes
one
for
the
manifest
itself.
After
all
the
files
are
uploaded,
each
file
is
checked
by
the
server
to
verify
that
its
checksum
matches
the
one
stated
in
the
manifest.
If
any
checksums
do
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.
Uploading the Files
Information
from
the
server’s
response
in
Example 4
‐
3
enables
the
client
to
construct
a
series
of
PUT
requests,
one
for
each
File
in
the
list,
that
upload
the
files
referenced
by
the
template.
Each
request
specifies
an
upload
URL
and
a
content
length
in
bytes.
Example 4
‐
6
shows
an
upload
request
for
one
of
the
files
required
by
an
OVF
package.
The
upload
request
is
simply
a
few
header
lines,
followed
by
the
serialized
file
content.
Содержание VCLOUD API 1.0 - TECHNICAL NOTE
Страница 10: ...vCloud API Programming Guide 10 VMware Inc...
Страница 20: ...vCloud API Programming Guide 20 VMware Inc...
Страница 32: ...vCloud API Programming Guide 32 VMware Inc...
Страница 90: ...vCloud API Programming Guide 90 VMware Inc...
Страница 150: ...vCloud API Programming Guide 150 VMware Inc...
Страница 170: ...vCloud API Programming Guide 170 VMware Inc...
Страница 202: ...vCloud API Programming Guide 202 VMware Inc...
Страница 212: ...vCloud API Programming Guide 212 VMware Inc...