REST API - GET Datastore Browse

This operation browses datastores.

Request

Syntax

GET webservice/VSBrowse/pseudoClientId/entityName?requestType=requestType HTTP/1.1
Host: host name
Accept: application/xml
Authtoken: authentication token

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Parameter

Name

Description

Required

pseudoClientId

The client ID for the virtualization client. If the client ID is not known, use the GET Virtualization Client API to retrieve it.

Yes

entityName

The name of the entity to browse. For a list of entities to browse, use INVENTORY for both the entityName and requestType parameters, for example, VSBrowse/47/INVENTORY?requestType=INVENTORY. In the response, the name parameter in the <inventoryInfo> element holds the host name. Use the host name as the value for the entityName parameter when the requestType parameter is not INVENTORY.

Valid values are:

  • INVENTORY, use when requestType is INVENTORY

  • the host name, use when requestType is not INVENTORY

No

requestType

The type of browse to perform. The value used for requestType affects the values used for the entityName parameter. See the description for entityName for details.

Valid values are:

  • DEFAULT

  • MOUNTSNAP

  • INVENTORY

  • DATASTORES_ON_HOST

  • RESOURCE_POOLS_ON_HOST

  • FILES_ON_DATASTORE

  • NETWORKS_ON_HOST

No

Request Header

Name

Description

Host

The host name of the web server.

Accept

The format of the response. Valid values are: application/xml or application/json.

Authtoken

The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication.

Response

Response Parameters

Parameter

Description

Element

name

The name of the entity.

inventoryInfo

poweredOff

inventoryInfo

strGUID

The globally unique identifier for the virtual entity.

inventoryInfo

templateVM

Indicates if the virtual machine is a template.

Valid values are 0/1.

inventoryInfo

type

The type of entity. Requests that do not include an inventory path parameter always return a type of 0.

Valid values are:

  • 0, for none

  • 1, for server host

  • 2, for resource pool

  • 4, for datacenter

  • 6, for cluster

  • 7, for datastore

  • 8, for datastore cluster

  • 9, for virtual machine

  • 10, for virtual machine name

  • 24, for datastore list

inventoryInfo

dataCenterName

The name of the data center.

hostInfo

dnsHostName

The name of the DNS host.

hostInfo

esxServerName

The name of the ESX server.

hostInfo

vmFolderPath

hostInfo

dataStoreName

The name of the data store.

dataStore

dataStoreType

Valid values are:

  • VMFS

  • NFS

dataStore

freeSpaceInBytes

dataStore

totalSizeInBytes

dataStore

Examples

Sample Request

This request is for a list of entities to browse.

GET webservice/VSBrowse/4787/INVENTORY?requestType=INVENTORY HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
 Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc60f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef768fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f3233d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8

This request browses datastores on the host.

GET webservice/VSBrowse/4787/111.11.111.10?requestType=DATASTORES_ON_HOST HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
 Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc60f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef768fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f3233d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8

Sample Response

This is the response when the request is for a list of entities to browse.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 <EVGui_VirtualMachineDestination>
   <inventoryInfo templateVM="0" strGUID="" name="DC1" poweredOff="1" type="4">
     <inventoryInfo name="111.11.111.10" poweredOff="1" strGUID="" templateVM="0" type="1" />
   </inventoryInfo>
   <inventoryInfo name="res_pool_001" poweredOff="1" strGUID="" templateVM="0" type="4">
     <inventoryInfo name="DOCTESTLAB.commvault.com" poweredOff="1" strGUID="" templateVM="0" type="1" />
   </inventoryInfo>
   <inventoryInfo name="VSA-DC1" poweredOff="1" strGUID="" templateVM="0" type="4">
     <inventoryInfo name="C2" poweredOff="1" strGUID="" templateVM="0" type="6">
         <inventoryInfo name="111.11.111.10" poweredOff="1" strGUID="" templateVM="0" type="1" />
     </inventoryInfo>
   </inventoryInfo>
   <inventoryInfo name="vsa-vc51_esx" poweredOff="1" strGUID="" templateVM="0" type="4" />
   <inventoryInfo name="DC2" poweredOff="1" strGUID="" templateVM="0" type="5">
     <inventoryInfo name="DC2" poweredOff="1" strGUID="" templateVM="0" type="4">
       <inventoryInfo name="SK_Cluster" poweredOff="1" strGUID="" templateVM="0" type="6">
         <inventoryInfo name="111.11.111.13" poweredOff="1" strGUID="" templateVM="0" type="1" />
       </inventoryInfo>
     </inventoryInfo>
     <inventoryInfo name="T001" poweredOff="1" strGUID="" templateVM="0" type="4" />
   </inventoryInfo>
 </EVGui_VirtualMachineDestination>

This is the response when the request browses datastores on the host.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 <EVGui_VirtualMachineDestination>
   <hostInfo dataCenterName="" dnsHostName="" esxServerName="111.11.111.13" vmFolderPath="">
     <dataStore dataStoreName="datastore1" dataStoreType="VMFS" freeSpaceInBytes="610961195008" totalSizeInBytes="991600574464" />
     <dataStore dataStoreName="datastore2" dataStoreType="VMFS" freeSpaceInBytes="166889259008" totalSizeInBytes="999385202688" />
     <dataStore dataStoreName="datastore3" dataStoreType="VMFS" freeSpaceInBytes="153453854720" totalSizeInBytes="999385202688" />
     <dataStore dataStoreName="localds4" dataStoreType="VMFS" freeSpaceInBytes="551619133440" totalSizeInBytes="999385202688" />
     <dataStore dataStoreName="localds5" dataStoreType="VMFS" freeSpaceInBytes="975600353280" totalSizeInBytes="999385202688" />
   </hostInfo>
 </EVGui_VirtualMachineDestination>
×

Loading...