Search Index Find By Datastore Path

Search Index Find By Datastore Path

Finds a virtual machine by its location on a datastore.

Required privileges: System.View

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/SearchIndex/{moId}/FindByDatastorePath
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 SearchIndex/{moId}.

string
release
Required

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


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

Show optional properties

{
    "datacenter": {},
    "path": "string"
}
{
    "datacenter": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "path": "string"
}
datacenter
Required

Reference to an instance of the Datacenter managed object.

string
path
Required

A datastore path to the .vmx file for the virtual machine.

Authentication
This operation uses the following authentication methods.
Responses
200

The virtual machine that is found. If no virtual machine is found, null is returned. Only a single entity is returned, even if there are multiple matches.

Returns MoRefVirtualMachine of type(s) application/json
This response body class contains all of the following: MoRefManagedEntity
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidDatastore: if a datastore has not been specified in the path or if the specified datastore does not exist on the specified datacenter.

Returns InvalidDatastore of type(s) application/json
This response body class contains all of the following: VimFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ],
    "datastore": {
        "_typeName": "string",
        "type": "string",
        "value": "string"
    },
    "name": "string"
}
datastore
Optional

Reference to an instance of the Datastore managed object.

string
name
Optional

The name of the datastore that is invalid.