VMware, Inc.
43
Chapter 4 Provisioning
Both
monolithic
and
ranged
(chunked)
PUTs
are
supported.
After
starting
an
upload,
a
client
can
make
periodic
requests
to
determine
its
progress.
After
all
the
files
are
uploaded
(and
validated
if
a
manifest
is
present),
the
server
processes
the
uploads.
When
processing
is
complete,
the
server
sets
the
value
of
the
template’s
status
attribute
to
8
,
indicating
that
the
template
is
ready
for
use.
(This
status
value
indicates
that
all
of
the
virtual
machines
in
the
template
are
powered
off.
For
more
information,
including
a
complete
list
of
possible
status
values
and
their
meanings,
see
“status”
on
page 144.)
Restrictions on Uploaded Content
This
release
of
the
vCloud
API
imposes
the
following
restrictions
on
uploaded
OVF
content:
You
can
upload
either
OVF
1.0
or
OVF
1.1
content.
OVF
1.1
packages
are
converted
to
OVF
1.0
for
download,
and
any
OVF
1.1
content
is
lost.
You
cannot
upload
a
compressed
OVF
package.
If
you
upload
an
OVF
package
in
which
any
VirtualSystem
element
has
an
ovf:id
attribute
value
that
is
longer
than
13
characters,
the
name
of
the
Vm
that
represents
the
VirtualSystem
in
the
vAppTemplate
created
by
the
upload
is
rewritten
as
the
first
13
characters
of
the
ovf:id
attribute
followed
by
three
digits.
For
example,
NewVirtualMachine1
and
NewVirtualMachine2
become
NewVirtualMa001
and
NewVirtualMa002.
Initiate the Upload
To
initiate
the
upload,
a
client
makes
an
HTTP
POST
request
specifying
a
target
vDC
and
an
uploadVAppTemplate
action.
The
request
body,
shown
in
Example 4
‐
1
,
is
an
UploadVAppTemplateParams
element.
Example 4-1.
uploadVappTemplate Request
POST http://vcloud.example.com/api/v1.0/vdc/5/action/uploadVAppTemplate
Content-Type: application/vnd.vmware.vcloud.uploadVAppTemplatxml
<UploadVAppTemplateParams name="Ubuntu Template" xmlns="http://www.vmware.com/vcloud/v1" >
<Description>Ubuntu vApp Template</Description>
</UploadVAppTemplateParams>
This
request
creates
a
new
VAppTemplate
object
in
the
target
vDC
and
returns
the
object
ʹ
s
XML
representation
in
a
response,
as
shown
in
Example 4
‐
2
.
Example 4-2.
Unresolved vAppTemplate Body with Upload URL for OVF Descriptor
201 Created
Content-Type: application/vnd.vmware.vcloud.vAppTxml
<VAppTemplate name="Ubuntu Template"
href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-268" status="0"
ovfDescriptorUploaded="false"
type="application/vnd.vmware.vcloud.vAppTxml" ... >
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml"
href="http://vcloud.example.com/api/v1.0/vdc/5"/>
...
<Description>Ubuntu vApp Template</Description>
<Files>
<File name="descriptor.ovf" bytesTransferred="0">
<Link rel="upload:default"
href="http://vcloud.example.com/transfer/.../descriptor.ovf"/>
</File>
</Files>
</VAppTemplate>
Содержание 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...