[{"label":"Latest (2.0.0)","version":"latest"},{"version":"1.0.0"}]
vsphere-replication-api

Browse Datastore

Description

Browse the datastore that is defined in the URL by its ID. This API returns files that reside on the given datastore. These files are filtered based on the given search criteria.

Request

Request

URL

URL


post
https://{api_host}//pairings/{pairing_id}/vcenters/{vcenter_id}/datastores/{datastore_id}/actions/browse
Copy

Path Parameters

Path Parameters

string
pairing_id Required

The ID of the pairing between this vSphere Replication server and the remote one.


string
vcenter_id Required

The ID of the vCenter server


string
datastore_id Required

The ID of a datastore


Query Parameters

Query Parameters

array of string
filter Optional

The filter value by which to filter the result data. Must be used in combination with filter_prop parameter. Supports for nested fields. Example: https://dr-server/api/vms?filter_property=name&filter=vm-1&filter=vm-2


string
filter_property Optional

The name of the field by which to filter the result data. Must be used in combination with filter parameter. Supports for nested fields. Example: https://dr-server/api/vms?filter_property=name&filter=vm-1


string
limit Optional

Specify the limit size of the result data. In combination with offset parameter provides paging functionality. If none - configuration property ‘defaultResponsePageSize’ in REST API configuration file is taken into account. If configuration property is not defined - default value of 100 is taken into account.

limit example
"10"

string
offset Optional

The amount of elements to skip in the response. In combination with limit parameter provides paging functionality. Must be used in combination with limit parameter. If none - default value of 0 is taken into account. Example: https://dr-server/api/vms?limit=10&offset=10

offset example
"10"

string
order_by Optional

Define desired sort order by field of the result data. Must be used in combination with sort_by. Supported values: asc, ascending, desc, descending.


string
sort_by Optional

Define desired sort by field of the result data. If order_by is not specified, ascending is used as default.

sort_by example
"name"

Request Body

Request Body

DatastoreBrowserRequest of mimetype application/json Optional

Search criteria to browse the datastore

{
	"browse_path": "string",
	"query_type": "VM_DISK",
	"sub_folders": false
}
string
browse_path Optional

The path of the datastore to browse, pass an empty string for the root node.


string
query_type Optional

The datastore browser query type.

Possible values are: VM_DISKFLOPPY_IMAGEISO_IMAGEVM_CONFIG_FILESALL_FILESFOLDERS


boolean
sub_folders Optional

Indicate whether the datastore that the file system searches should include subfolders of the browse path.

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

200 OK

Returns DatastoreBrowserResultDrResponseList of type application/json

List of files and folders in the datastore, based on a search criteria.

{
	"_meta": {
		"errors": [
			{
				"code": "string",
				"field": "string",
				"message": "string"
			}
		],
		"limit": 0,
		"links": {
			"next": {
				"href": "string"
			},
			"previous": {
				"href": "string"
			},
			"self": {
				"href": "string"
			}
		},
		"offset": 0,
		"total": 0
	},
	"list": [
		{
			"file_type": "FOLDER",
			"name": "string",
			"path": "string",
			"size": 0
		}
	]
}
_meta Optional

List metadata


list Optional

The result of the browsing datastore request

Errors

Errors

ResponseError
400

Bad request - the server could not understand the request due to invalid syntax or invalid request body content


401

Unauthorized - the client must authenticate itself to get the requested response


ResponseError
403

Forbidden - not sufficient access rights to fulfill the request


404

Not Found - server cannot find the requested in URL resource


ResponseError
500

Internal server error - unexpected condition prevents fulfilling the request

Code Samples

Code Samples

PowerCLI Client SDK Example

$DatastoreBrowserRequest = Initialize-VrDatastoreBrowserRequest -QueryType "VM_DISK" -BrowsePath "MyBrowsePath" -SubFolders $false
Invoke-VrBrowseDatastore -pairingId "MypairingId" -vcenterId 38400000-8cf0-11bd-b23e-10b96e4ef00d -datastoreId "MydatastoreId" -filterProperty "MyfilterProperty" -filter "Myfilter" -sortBy name -orderBy "MyorderBy" -limit 10 -offset 10 -datastoreBrowserRequest $datastoreBrowserRequest

cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"browse_path":"string","query_type":"VM_DISK","sub_folders":false}' https://{api_host}/pairings/{pairing_id}/vcenters/{vcenter_id}/datastores/{datastore_id}/actions/browse
Vendor Extensions

Vendor Extensions

This operation contains the following vendor extensions defined in the spec:
x-dr-permissions:
    permissions:
        - System.View
        - System.Read
        - Datastore.Browse
x-dr-remote-site-connectivity-contract:
    not-authenticated: DEPENDS_ON_PROVIDED_PARAMS
    server-down: DEPENDS_ON_PROVIDED_PARAMS


Feedback

Was this page helpful?