vCloud API Programming Guide
24
VMware, Inc.
Getting Information About a vDC
Instantiation,
deployment,
and
operation
of
a
vApp
all
take
place
in
the
context
of
a
vDC.
The
XML
representation
of
a
vDC
object
defines
that
context
in
detail.
For
this
exercise,
you
need
only
two
pieces
of
information
from
the
vDC:
The
URL
that
a
client
can
use
to
request
an
instantiateVAppTemplate
operation
in
the
vDC
A
list
of
networks
to
which
the
vApp
can
connect.
Example 2
‐
5
shows
this
subset
of
vDC
contents.
(For
a
more
complete
look
at
those
contents,
see
Example 3
‐
4
on
page 37
.)
Example 2-5.
List the Contents of a vDC
Request:
GET http://vcloud.example.com/api/v1.0/vdc/5
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.vdc+xml
...
<Vdc name="ExampleVdc01" type="application/vnd.vmware.vcloud.vdc+xml"
href="http://vcloud.example.com/api/v1.0/vdc/5" ...>
...
<Link rel="add" type="application/vnd.vmware.vcloud.instantiateVAppTemplatxml"
href="http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate"
/>
...
<AvailableNetworks>
<Network href="http://vcloud.example.com/api/v1.0/network/14"
type="application/vnd.vmware.vcloud.xml" name="IsolatedOrgNet"/>
<Network href="http://vcloud.example.com/api/v1.0/network/54"
type="application/vnd.vmware.vcloud.xml" name="Internet"/>
</AvailableNetworks>
...
</Vdc>
The
information
you
need
is
available
here
in
two
places:
An
Link
element
containing
an
action
URL,
http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate.
The
rel
attribute
of
this
Link
has
a
value
of
add
,
indicating
that
it
implements
an
action
that
adds
an
object
to
the
vDC.
A
list
of
AvailableNetworks
that
includes
all
the
networks
owned
by
the
organization
that
contains
this
vDC.
Since
we
want
this
FTP
server
to
be
accessible
on
the
public
Internet,
we
will
connect
the
vApp
to
the
network
named
Internet
.
Both
these
pieces
of
information
are
put
to
use
in
Example 2
‐
6
.
Instantiating the Template in the vDC
To
create
a
vApp
from
this
template,
you
must
bind
its
abstract
resource
requirements,
such
as
network
connections,
storage
resources,
memory,
and
CPU
capacity,
to
appropriate
resources
in
the
target
vDC.
This
binding
operation
is
called
instantiation.
Although
a
client
can
specify
these
bindings
in
detail,
a
simple
instantiation,
which
relies
on
organization
and
vDC
defaults,
requires
only
a
few
pieces
of
information:
A
name
for
the
vApp
that
the
request
creates
The
URL
of
the
template
to
instantiate.
In
this
case,
the
URL
(retrieved
in
Example 2
‐
4
)
is
http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate
‐
111.
Содержание 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...