vCloud API Programming Guide
50
VMware, Inc.
After
the
disableDownload
request
completes,
the
template’s
files
are
removed
from
the
transfer
server,
and
the
Link
element
that
contains
the
download:default
URL
no
longer
appears
in
the
vAppTemplate
body.
Upload a Media Image
The
vCloud
API
supports
uploading
virtual
media
such
as
CD
‐
ROM
and
floppy
disk
images.
The
workflow
for
these
procedures
is
similar
to
that
described
for
vApp
template
uploads;
the
client
POSTs
a
request
to
the
server
that
includes
information
about
a
virtual
media
item
it
intends
to
upload,
and
the
server
responds
with
an
upload
URL,
which
the
client
can
use
to
do
a
monolithic
or
ranged
PUT
of
the
file
contents.
Example 4
‐
15
shows
a
request
to
upload
a
CD
‐
ROM
image
in
ISO
format.
The
request
body
is
a
Media
element,
which
specifies
the
name,
size,
and
type
of
the
file.
Example 4-15.
Request to Upload an ISO Image
POST http://vcloud.example.com/api/v1.0/vdc/5/media
Content-Type: application/vnd.vmware.vcloud.media+xml
<Media name="database.iso" size="242131" imageType="iso" xmlns="http://www.vmware.com/vcloud/v1">
<Description>ISO database image</Description>
</Media>
The
server
returns
a
Media
representation
that
includes
a
single
File
element,
as
shown
in
Example 4
‐
16
.
The
client
responds
with
a
PUT
request,
sending
serialized
file
data
to
the
File
element’s
upload:default
URL.
Example 4
‐
6
shows
a
similar
request.
Example 4-16.
Server Response to Request to Upload an ISO Image
Content-Type: application/vnd.vmware.vcloud.media+xml
201 Created
<Media name="database.iso" size="242131" status="0" imageType="iso"
href="http://vcloud.example.com/api/v1.0/media/254"
type="application/vnd.vmware.vcloud.media+xml" ...>
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml"
href="http://vcloud.example.com/api/v1.0/vdc/5"/>
<Description>ISO database image</Description>
<Files>
<File name="database.iso" size="242131" bytesTransferred="0"
<Link rel="upload:default" href="http://vcloud.example.com/.../database.iso"/>
</File>
</Files>
</Media>
During
the
upload,
the
value
of
the
bytesTransferred
attribute
of
the
File
element
indicates
upload
progress.
When
the
upload
is
complete,
the
value
of
the
status
attribute
is
set
to
1
,
and
the
Files
element
is
no
longer
included
in
the
Media
representation.
Copying and Moving
The
vCloud
API
provides
object
‐
specific
copy
operations
for
media
images,
vApp
templates,
and
vApps.
These
operations
support
creating
a
copy
of
the
object
in
the
same
vDC
or
in
another
vDC
within
the
same
organization.
Each
copy
operation
supports
an
option
to
delete
the
source
object
after
the
copy
is
complete,
which
effectively
moves
the
source
object
to
another
vDC,
or
renames
it
within
the
same
vDC.
The
vCloud
API
does
not
include
an
explicit
move
operation.
N
OTE
Downloading
media
images
is
not
supported
in
this
release
of
Cloud
Director.
Summary of Contents for VCLOUD API 1.0 - TECHNICAL NOTE
Page 10: ...vCloud API Programming Guide 10 VMware Inc...
Page 20: ...vCloud API Programming Guide 20 VMware Inc...
Page 32: ...vCloud API Programming Guide 32 VMware Inc...
Page 90: ...vCloud API Programming Guide 90 VMware Inc...
Page 150: ...vCloud API Programming Guide 150 VMware Inc...
Page 170: ...vCloud API Programming Guide 170 VMware Inc...