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://{api_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 9.0.0.0 APIs.


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

Specifies the datacenter to which the datastore path belongs.

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.

This response body class contains all of the following: MoRefVirtualMachine
{
    "0": "M",
    "1": "o",
    "2": "R",
    "3": "e",
    "4": "f",
    "5": "V",
    "6": "i",
    "7": "r",
    "8": "t",
    "9": "u",
    "10": "a",
    "11": "l",
    "12": "M",
    "13": "a",
    "14": "c",
    "15": "h",
    "16": "i",
    "17": "n",
    "18": "e",
    "19": " ",
    "20": "O",
    "21": "b",
    "22": "j",
    "23": "e",
    "24": "c",
    "25": "t"
}

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
"InvalidDatastore Object"
datastore
Optional

The datastore that is invalid.

string
name
Optional

The name of the datastore that is invalid.


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