Host Datastore Browser Search Datastore Sub Folders Task

Host Datastore Browser Search Datastore Sub Folders Task

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

Searches the folder specified by the datastore path and all subfolders. 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}/SearchDatastoreSubFolders_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.3.0 APIs.


Request Body
SearchDatastoreSubFoldersRequestType of type(s) application/json
Required

Show optional properties

{
    "datastorePath": "string"
}
{
    "datastorePath": "string",
    "searchSpec": {
        "_typeName": "string",
        "query": [
            {
                "_typeName": "string"
            }
        ],
        "details": {
            "_typeName": "string",
            "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. Typically, a specific subclass of this exception is thrown.

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"
        }
    ]
}