VMware, Inc.
25
Chapter 2 Hello vCloud: A Structured REST Workflow Example
Creation
parameters
for
a
vApp
network.
A
vApp
network
defines
how
the
vApp
connects
to
an
organization
network
available
in
the
target
vDC.
For
more
information,
see
“About
vApp
Networks”
on
page 62.
The
instantiateVAppTemplate
request
in
Example 2
‐
6
supplies
these
parameters
in
the
following
places:
The
name
is
supplied
in
the
name
attribute
of
the
InstantiateVAppTemplateParams
request.
(This
request
also
provides
a
description,
which
is
optional
but
a
good
practice.)
The
template
URL
is
suppled
in
the
Source
element
The
vApp
network
is
specified
in
the
NetworkConfigSection
element.
This
specification
includes
three
parameters:
A
name
for
the
network,
supplied
in
the
name
attribute
of
the
NetworkConfigSection
element.
If
the
vApp
template
includes
an
ovf:Network
element,
the
name
you
specify
for
the
vApp
network
must
match
the
name
specified
in
that
element’s
ovf:name
attribute.
A
reference
to
the
organization
network
to
which
the
vApp
network
connects,
specified
in
the
ParentNetwork
element.
The
URL
used
here
is
one
returned
in
Example 2
‐
5
,
in
the
AvailableNetworks
element
of
the
vDC.
A
fence
mode,
specified
in
the
FenceMode
element.
A
value
of
bridged
indicates
that
the
vApp
network
is
connected
directly
to
the
organization
network.
The
target
of
the
request
is
the
instantiateVAppTemplate
URL
of
this
vDC
(see
Example 2
‐
5
).
Because
the
operation
creates
a
new
object
(a
vApp),
the
HTTP
request
type
is
POST.
Example 2-6.
Instantiating a vApp Template
Request:
POST http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate
Content-Type: application/vnd.vmware.vcloud.instantiateVAppTemplatxml
...
<InstantiateVAppTemplateParams name="Linux FTP server" xmlns="http://www.vmware.com/vcloud/v1"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" >
<Description>Example FTP Server vApp</Description>
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for vAppNetwork</ovf:Info>
<NetworkConfig networkName="vAppNetwork">
<Configuration>
<ParentNetwork href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>bridged</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<Source href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"/>
</InstantiateVAppTemplateParams>
Response:
201 Created
Content-Type: application/vnd.vmware.vcloud.vApp+xml
<VApp deployed=”false” status="0" name="Linux FTP server"
type="application/vnd.vmware.vcloud.vApp+xml"
href="http://vcloud.example.com/api/v1.0/vApp/vapp-7" ...>
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml"
href="http://vcloud.example.com/api/v1.0/vdc/5"/>
<Description>Example FTP Server vApp</Description>
<Tasks>
Содержание 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...