VMware, Inc.
51
Chapter 4 Provisioning
When
you
move
an
object
by
copying
it
and
deleting
its
source,
an
intermediate
object
is
created
in
the
target
vDC,
as
part
of
the
following
sequence
of
events.
1
The
source
object
is
coped
to
an
intermediate
object
whose
name
is
a
combination
of
the
object
name
and
a
UUID.
2
The
source
object
is
deleted.
3
The
intermediate
object
is
renamed
with
the
name
specified
for
the
target
object
in
the
copy
request.
Copy or Move a Media Image
The
cloneMedia
request
makes
a
copy
of
the
media
image
referenced
in
the
Source
element
of
the
request
body.
The
request
specifies
a
new
name
and,
optionally,
a
new
description
for
the
copy.
The
request
can
optionally
include
an
IsSourceDelete
element
whose
value
specifies
whether
the
source
media
image
is
deleted
after
the
copy
is
complete.
If
IsSourceDelete
is
missing
from
the
request
body
or
present
with
a
value
of
false
,
the
source
object
remains
in
place
after
the
copy
is
complete.
Setting
IsSourceDelete
to
true
effectively
moves
the
media
image.
Example 4
‐
17
copies
the
virtual
media
image
referenced
by
http://vcloud.example.com/api/v1.0/media/254
to
the
vDC
referenced
by
http://vcloud.example.com/api/v1.0/vdc/5
and
provides
a
new
name
and
description
for
the
copy.
The
source
image
remains
in
place
after
the
copy
is
complete.
Example 4-17.
Copy a Virtual Media Image
Request:
POST http://vcloud.example.com/api/v1.0/vdc/5/action/cloneMedia
Content-Type: application/vnd.vmware.vcloud.cloneMedixml
<CloneMediaParams name="databse-backup.iso" xmlns="http://www.vmware.com/vcloud/v1">
<Description>This is a backup copy of the ISO database image</Description>
<Source href="http://vcloud.example.com/api/v1.0/media/254"/>
</CloneMediaParams>
Response:
201 Created
...
<Media name="database-backup.iso" size="242131" status="0" imageType="iso"
href="http://vcloud.example.com/api/v1.0/media/277"
type="application/vnd.vmware.vcloud.media+xml" ...>
<Link rel="up" href="http://vcloud.example.com/api/v1.0/vdc/5"/>
<Description>This is a backup copy of the ISO database image</Description>
<Tasks>
<Task ... operation="Busy Media File cloned(277)" ... >
...
</Task>
</Tasks>
</Media>
Copy or Move a vApp Template
The
cloneVAppTemplate
request
makes
a
copy
of
the
vApp
template
referenced
in
the
Source
element
of
the
request
body.
The
request
specifies
a
new
name
and,
optionally,
a
new
description
for
the
copy.
The
request
can
optionally
include
an
IsSourceDelete
element
whose
value
specifies
whether
the
source
vApp
template
is
deleted
after
the
copy
is
complete.
If
IsSourceDelete
is
missing
from
the
request
body
or
present
with
a
value
of
false
,
the
source
object
remains
in
place
after
the
copy
is
complete.
Setting
IsSourceDelete
to
true
effectively
moves
the
vApp
template.
Example 4
‐
18
moves
the
vApp
template
referenced
by
http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate
‐
111
to
the
vDC
referenced
by
http://vcloud.example.com/api/v1.0/vdc/5.
Because
the
IsSourceDelete
element
in
the
request
body
contains
a
value
of
true,
the
source
vApp
template
is
removed
after
the
copy
is
complete.
Содержание 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...