VMware, Inc.
71
Chapter 5 Datacenter Operations
To modify a section
1
Retrieve
the
vApp
or
vApp
template
and
examine
the
response
to
find
the
section
that
you
want
to
modify.
2
Retrieve
the
section
by
making
a
GET
request
to
the
section’s
edit
link
(a
Link
element
in
the
section
where
rel="edit")
.
3
Modify
the
section
as
needed.
4
PUT
the
modified
section
to
the
section’s
edit
link.
Note
that
section
edit
URLs,
unlike
most
other
URLs
presented
by
the
vCloud
API,
end
with
a
/
character.
Retrieve or Modify the NetworkConfigSection of a vApp Template
Example 5
‐
10
retrieves
a
vApp’s
network
configuration
(
NetworkConfigSection
).
Example 5
‐
11
modifies
the
section
and
applies
the
changes.
Changes
to
the
StartupSection
or
LeaseSettingsSection
can
use
the
same
procedure.
Example 5-10.
Retrieve vApp Network Configuration
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/
Response:
200 OK
Content-type: application/vnd.vmware.vcloud.networkConfigxml
...
<NetworkConfigSection href="http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/"
ovf:required="false">
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigxml"
href="http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/"/>
<NetworkConfig networkName="vAppNetwork">
<Configuration>
<IpScope>
<IsInherited>true</IsInherited>
<Gateway>10.147.56.253</Gateway>
<Netmask>255.255.255.0</Netmask>
<Dns1>10.147.115.1</Dns1>
<Dns2>10.147.115.2</Dns2>
<DnsSuffix>example.com</DnsSuffix>
<IpRanges>
<IpRange>
<StartAddress>10.147.56.1</StartAddress>
<EndAddress>10.147.56.255</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
<ParentNetwork type="application/vnd.vmware.vcloud.xml" name="Internet"
href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>bridged</FenceMode>
</Configuration>
<IsDeployed>false</IsDeployed>
</NetworkConfig>
</NetworkConfigSection>
The
modified
NetworkConfigSection
in
the
request
body
in
Example 5
‐
11
changes
the
FenceMode
value
to
natRouted
and
adds
a
Features
element
that
defines
several
network
features
useful
to
an
FTP
server
that
must
be
reachable
from
the
public
Internet,
but
only
at
the
FTP
port
and
the
SSH
port.
N
OTE
Sections
that
do
not
have
a
Link
where
rel="edit"
cannot
be
modified.
Содержание 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...