Search Index Query
API for efficient query/search over the managed objects (resource model) data.
It provides means to filter and retrieve projections (subsets) onto the matched resources' properties. Executes the provided SearchIndexQuerySpec instance, i.e., retrieves a snapshot of the resource model data as specified in the query.
Since: vSphere API Release 9.1.0.0
Required privileges: System.View
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}.
The vSphere release schema. The current specification covers vSphere 9.1.0.0 APIs.
Show optional properties
{
"querySpec": {}
}
{
"querySpec": {
"_typeName": "string",
"properties": [
"string"
],
"resourceType": "string",
"filters": [
{
"_typeName": "string",
"predicates": [
{
"_typeName": "string",
"propertyPath": "string",
"operator": "string",
"arrayOperator": "string",
"comparableValue": {
"_typeName": "string"
},
"comparableList": [
{
"_typeName": "string"
}
]
}
]
}
],
"returnTotalCount": false,
"limit": 0
}
}
The query that defines the managed objects data to retrieve.
Result set with data retrieved for the provided query.
{
"_typeName": "string",
"properties": [
"string"
],
"items": [
{
"_typeName": "string",
"propertyValues": [
{
"_typeName": "string",
"value": {
"_typeName": "string"
}
}
]
}
],
"totalCount": 0,
"marker": "string"
}
The names of the resource model properties returned for each resource item in the result set.
The position (index) of each model property in this list corresponds to the position of the model property value in each resource item's values list. In other words, the name of each model property in the SearchIndexResourceItem.propertyValues list is given by the string with the same index (position) in this list.
The list of result items.
Each item corresponds to a particular resource that matched the conditions in the specified SearchIndexQuerySpec instance and containing the property data retrieved for that resource.
The total number of resources that matched the query, regardless of the actual number that is returned in SearchIndexResultSet.items.
This value is set
only if it has been explicitly requested in the query, i.e. if the
SearchIndexQuerySpec.returnTotalCount flag has been set to true.
The totalCount can change as new records are added or removed
between requests. This means the count is recalculated on each subsequent
request to reflect the most up-to-date results.
The usecase of this property is for requesting only the items matching
certain query without any further properties for the resource model.
For example: find the number of all vms that are powered on.
Used for continuation of result paging.
If paging used this one will be filled with the place where the next page should continue from. It should be passed to SearchIndexIterationSpec.marker, so the paging can be continued.
InvalidArgument: if SearchIndexQuerySpec is not specified correctly
{
"_typeName": "string",
"faultCause": {
"_typeName": "string",
"faultCause": "MethodFault Object",
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
]
},
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
],
"invalidProperty": "string"
}
Optional name of the invalid property.
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"querySpec":"{}"}' https://{api_host}/sdk/vim25/{release}/SearchIndex/{moId}/Query