vCloud API Programming Guide
78
VMware, Inc.
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ... operation="Updating Virtual Application Linux FTP server (7)" ...>
...
</Task>
Retrieve or Modify the CPU Configuration of a Virtual Machine
Example 5
‐
15
retrieves
the
CPU
configuration
of
the
Vm
shown
in
Example 5
‐
12
.
Example 5
‐
16
modifies
the
section
and
uses
the
URL
in
the
edit
link
from
that
section
to
apply
the
changes
to
the
Vm
.
Example 5-15.
Retrieve the CPU Configuration of a Virtual Machine
Request:
GET http://vcloud.example.com/api/v1.0/vApp/vm-4/virtualHardwareSection/cpu
Response:
200 OK
Content-type: application/vnd.vmware.vcloud.rxml
...
<Item xmlns="http://www.vmware.com/vcloud/v1"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/
CIM_ResourceAllocationSettingData" ... >
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
</Item>
The
modified
Item
in
the
request
body
adds
a
second
CPU
to
the
Vm
by
changing
the
rasd:VirtualQuantity
value
of
the
Item
to
2
.
Example 5-16.
Modify the CPU Configuration of a Virtual Machine
Request:
PUT http://vcloud.example.com/api/v1.0/vApp/vm-4/virtualHardwareSection/cpu
Content-type: application/vnd.vmware.vcloud.rxml
...
<Item xmlns="http://www.vmware.com/vcloud/v1"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/
CIM_ResourceAllocationSettingData">
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>2</rasd:VirtualQuantity>
</Item>
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ... operation="Updating Virtual Application Linux FTP server (7)" ...>
...
</Task>
Содержание 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...