VMware, Inc. 121
Chapter 7 VMware vSphere Platform Operations
Example 7-3. Get Information About a vCenter Server
Request:
GET http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100
Response:
200 OK
Content-Type: application/vnd.vmware.admin.vmwvirtualcenter+xml
...
<vmext:VimServer xmlns:vmext="http://www.vmware.com/vcloud/extension/v1"
xmlns:vcloud="http://www.vmware.com/vcloud/v1" name="VC-02" ... >
<vcloud:Link rel="down" type="application/vnd.vmware.admin.vmsObjectRefsList+xml"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/
vmsList"/>
<vcloud:Link rel="down" type="application/vnd.vmware.admin.resourcePoolList+xml"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/
resourcePoolList"/>
<vcloud:Link rel="add" type="application/vnd.vmware.admin.importVmAsVAppParams+xml"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/
importVmAsVApp"/>
<vcloud:Link rel="add" type="application/vnd.vmware.admin.importVmAsVAppTemplateParams+xml"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/
importVmAsVAppTemplate"/>
<vcloud:Link rel="unregister"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/action/
unregister"/>
<vcloud:Description>vCenter created by the Configuration Wizard</vcloud:Description>
<vmext:Username>administrator</vmext:Username>
<vmext:Url>http://10.147.40.234:443</vmext:Url>
<vmext:IsEnabled>true</vmext:IsEnabled>
<vmext:ShieldManagerIP>10.147.44.59</vmext:ShieldManagerIP>
<vmext:ShieldManagerUserName>admin</vmext:ShieldManagerUserName>
</vmext:VimServer>
List Available Resource Pools on a vCenter Server
TheVimServerelementreturnedinresponsetoaGETrequesttoavimServerURLcontainsarel="down"
linkwhosehrefvalueisaURLthatreturnsalistofavailableresourcepoolshostedonthatserver.Apoolis
consideredavailableifitisnotinuseinavDC.A
systemadministratorcanmakeaGETrequesttothatURL
tolisttheavailablepools.Example 7‐4makessucharequestusingtheresourcePoolListURLfrom
Example 7‐3.
Example 7-4. List Available Resource Pools on a vCenter Server
Request:
GET http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100/resourcePoolList
Response:
200 OK
Content-Type: application/vnd.vmware.admin.resourcepoollist+xml
...
<vmext:ResourcePoolList xmlns:vmext="http://www.vmware.com/vcloud/extension/v1"
xmlns:vcloud="http://www.vmware.com/vcloud/v1" ...>
<vcloud:Link rel="up" type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
href="http://vcloud.example.com/api/v1.0/admin/extension/vimServer/100"/>
<vmext:ResourcePool name="Cluster-1">
<vmext:MoRef>resgroup-1159</vmext:MoRef>
<vmext:VimObjectType>RESOURCE_POOL</vmext:VimObjectType>
<vmext:DataStoreRefs/>
</vmext:ResourcePool>
<vmext:ResourcePool name="Cluster-2">
<vmext:MoRef>resgroup-1064</vmext:MoRef>