Host Datastore Browser Search Datastore Task

Host Datastore Browser Search Datastore Task

Returns the information for the files that match the given search criteria as a SearchResults object.

Searches only the folder specified by the datastore path. The Datastore.Browse privilege must be held on the datastore identified by the datastore path.

Request
URI
POST
https://{api_host}/sdk/vim25/{release}/HostDatastoreBrowser/{moId}/SearchDatastore_Task
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case HostDatastoreBrowser/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
SearchDatastoreRequestType of type(s) application/json
Required
"SearchDatastoreRequestType Object"
string
datastorePath
Required

datastorePath

object
searchSpec
Optional

The data object type describes a search for files in one or more datastores.

The properties do not include the starting datastore path because that path is a separate parameter to the search method.

A SearchSpec contains the query parameters and some global search modifiers.

Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation. The info.result property in the Task contains the HostDatastoreBrowserSearchResults upon success.

Returns MoRefTask of type(s) application/json
"MoRefTask Object"

500

InvalidDatastore: if the operation cannot be performed on the target datastores. The server can throw InvalidDatastorePath to indicate a malformed datastorePath, or InaccessibleDatastore to indicate inaccessibility of the datastore.

InvalidArgument: if the SearchSpec contains duplicate file types.

FileNotFound: if the file or folder specified by datastorePath is not found.

Returns VimFault of type(s) application/json
This response body class contains all of the following: InlineVimFault0
"VimFault Object"

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/HostDatastoreBrowser/{moId}/SearchDatastore_Task