VMware, Inc.
77
Chapter 5 Datacenter Operations
Reconfiguration
links
in
the
body
of
a
Vm
can
appear
in
two
places:
Individual
Link
elements
in
the
ovf:Item
elements
defining
cpu
and
memory
.
These
links
appear
in
the
ovf:Item
itself,
and
have
type="application/vnd.vmware.vcloud.rxml"
.
Links
to
groups
of
related
ovf:Item
elements
(disks,
network
cards,
and
media
devices).
These
links
appear
at
the
end
of
the
ovf:VirtualHardwareSection
,
and
have
type="application/vnd.vmware.vcloud.rasdItxml"
.
Retrieve or Modify the Network Connection of a Virtual Machine
Example 5
‐
13
retrieves
the
NetworkConnectionSection
configuration
of
the
Vm
shown
in
Example 5
‐
12
.
Example 5
‐
14
modifies
the
section
and
uses
the
URL
in
the
edit
link
from
that
section
to
apply
the
changes
to
the
Vm
.
Example 5-13.
Retrieve the Network Connection of a Virtual Machine
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/
Response:
200 OK
Content-Type: application/vnd.vmware.vcloud.networkconnectionxml
...
<NetworkConnectionSection ...
href="http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/" ...>
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="vAppNetwork">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>10.147.122.134</IpAddress>
<IsConnected>false</IsConnected>
<MACAddress>00:50:56:01:01:49</MACAddress>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
<Link rel="edit" type="application/vnd.vmware.vcloud.networkConnectionxml"
href="http://vcloud.example.com/api/v1.0/vApp/vm-4
networkConnectionSection/"/>
</NetworkConnectionSection>
The
modified
NetworkConnectionSection
in
the
request
body
changes
the
value
in
the
IpAddress
element.
Example 5-14.
Modify the Network Connection of a Virtual Machine
Request:
PUT "http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/
Content-type: application/vnd.vmware.vcloud.networkConnectionxml
...
<NetworkConnectionSection ...
href="http://vcloud.example.com/api/v1.0/vApp/vm-4/networkConnectionSection/" ...>
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="vAppNetwork">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>10.147.115.1</IpAddress>
<IsConnected>false</IsConnected>
<MACAddress>00:50:56:01:01:49</MACAddress>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
Содержание 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...