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://{vcenter-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
{
    "datastorePath": "string",
    "searchSpec": {
        "query": [
            {
                "_typeName": "string"
            }
        ],
        "details": {
            "fileType": false,
            "fileSize": false,
            "modification": false,
            "fileOwner": false
        },
        "searchCaseInsensitive": false,
        "matchPattern": [
            "string"
        ],
        "sortFoldersFirst": false
    }
}
string
datastorePath
Required

datastorePath

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
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

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: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}