vcenter datastore: list
Returns information about at most 1000 visible (subject to permission checks) datastores in vCenter matching the vcenter.datastore.filter_spec.
Request:
HTTP request
GET https://{server}/rest/vcenter/datastore
?filter.datacenters.1=obj-103
&filter.datacenters.2=obj-103
&filter.names.1=string
&filter.names.2=string
&filter.folders.1=obj-103
&filter.folders.2=obj-103
&filter.types.1=VMFS
&filter.types.2=VMFS
&filter.datastores.1=obj-103
&filter.datastores.2=obj-103
?filter.datacenters.1=obj-103
&filter.datacenters.2=obj-103
&filter.names.1=string
&filter.names.2=string
&filter.folders.1=obj-103
&filter.folders.2=obj-103
&filter.types.1=VMFS
&filter.types.2=VMFS
&filter.datastores.1=obj-103
&filter.datastores.2=obj-103
Request Query Parameters:
| Name | Type | Description |
|---|---|---|
| bold = required | ||
| filter | filter_spec | Optional. Specification of matching datastores for which information should be returned. |
| filter.datastores | string[] | Identifiers of datastores that can match the filter. Optional. If unset or empty, datastores with any identifier match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Datastore. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Datastore. |
| filter.names | string[] | Names that datastores must have to match the filter (see vcenter.datastore.info.name). Optional. If unset or empty, datastores with any name match the filter. |
| filter.types | string[] | Types that datastores must have to match the filter (see vcenter.datastore.summary.type). Optional. If unset or empty, datastores with any type match the filter. |
| filter.folders | string[] | Folders that must contain the datastore for the datastore to match the filter. Optional. If unset or empty, datastores in any folder match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Folder. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Folder. |
| filter.datacenters | string[] | Datacenters that must contain the datastore for the datastore to match the filter. Optional. If unset or empty, datastores in any datacenter match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Datacenter. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Datacenter. |
Response:
HTTP Status Code: 200
Representations:
{
"value": [
{
"capacity": 1,
"datastore": "obj-103",
"free_space": 1,
"name": "string",
"type": "VMFS"
},
{
"capacity": 1,
"datastore": "obj-103",
"free_space": 1,
"name": "string",
"type": "VMFS"
}
]
}
"value": [
{
"capacity": 1,
"datastore": "obj-103",
"free_space": 1,
"name": "string",
"type": "VMFS"
},
{
"capacity": 1,
"datastore": "obj-103",
"free_space": 1,
"name": "string",
"type": "VMFS"
}
]
}
<?xml version="1.0" ?>
<ns0:List-Result xmlns:ns0="http://vmware.com/vcenter/datastore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<value-array>
<array-item>
<free_space>1</free_space>
<name>string</name>
<capacity>1</capacity>
<type>VMFS</type>
<datastore>obj-103</datastore>
</array-item>
<array-item>
<free_space>1</free_space>
<name>string</name>
<capacity>1</capacity>
<type>VMFS</type>
<datastore>obj-103</datastore>
</array-item>
</value-array>
</ns0:List-Result>
<ns0:List-Result xmlns:ns0="http://vmware.com/vcenter/datastore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<value-array>
<array-item>
<free_space>1</free_space>
<name>string</name>
<capacity>1</capacity>
<type>VMFS</type>
<datastore>obj-103</datastore>
</array-item>
<array-item>
<free_space>1</free_space>
<name>string</name>
<capacity>1</capacity>
<type>VMFS</type>
<datastore>obj-103</datastore>
</array-item>
</value-array>
</ns0:List-Result>
Response Type:
| Name | Type | Description |
|---|---|---|
| bold = required | ||
| value | summary[] | Commonly used information about the datastores matching the vcenter.datastore.filter_spec. |
| value[].datastore | string | Identifier of the datastore. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Datastore. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Datastore. |
| value[].name | string | Name of the datastore. |
| value[].type | string | Type (VMFS, NFS, NFS41, CIFS, VSAN, VFFS, VVOL) of the datatore. Defines the supported types of vCenter datastores. Value is one of:VMFS: VMware File System (ESX Server only). NFS: Network file system v3 (linux & esx servers only). NFS41: Network file system v4.1 (linux & esx servers only). CIFS: Common Internet File System. VSAN: Virtual SAN (ESX Server only). VFFS: Flash Read Cache (ESX Server only). VVOL: vSphere Virtual Volume (ESX Server only). |
| value[].free_space | long | Available space of this datastore, in bytes. The server periodically updates this value. Optional. This field will be unset if the available space of this datastore is not known. |
| value[].capacity | long | Capacity of this datastore, in bytes. The server periodically updates this value. Optional. This field will be unset if the capacity of this datastore is not known. |
Errors:
| HTTP Status Code | Type | Description |
|---|---|---|
| 400 | invalid_argument | if the vcenter.datastore.filter_spec.types field contains a value that is not supported by the server. |
| 400 | unable_to_allocate_resource | if more than 1000 datastores match the vcenter.datastore.filter_spec. |
| 503 | service_unavailable | if the system is unable to communicate with a service to complete the request. |
| 401 | unauthenticated | if the user can not be authenticated. |
| 403 | unauthorized | if the user doesn't have the required privileges. |