Search
Using search QL API you can execute search by specifying search query directly as you specify on the UI. A successful search execution will return one of the following three things :
- List of entity ids that matches the search criteria.
- List of aggregations.
- List of groups.
Request
URI
POST
https://www.mgmt.cloud.vmware.com/ni/api/ni/search/ql
COPY
Request Body
Search Query Request
SearchQueryRequest of type(s) application/json
Optional
{
"query": "VM where CPU Cores > 2",
"size": 10,
"time_range": {
"start_time": 1534410000,
"end_time": 1534410559
}
}
string
query
Optional
Query
integer As int32 As int32
size
Optional
Page size of results
string
cursor
Optional
cursor
Responses
200
Success
Returns SearchQueryResponse of type(s) application/json
{
"search_response_total_hits": 100
}
integer As int32 As int32
search_response_total_hits
Optional
Total number of results
object
entity_list_response
Optional
entity_list_response
object
aggregation_response
Optional
aggregation_response
object
groupby_response
Optional
groupby_response
400
Bad Request
Returns ApiError of type(s) application/json
{
"code": 0,
"message": "string",
"details": [
{
"code": 0,
"message": "string",
"target": [
"string"
]
}
]
}
integer As int32 As int32
code
Optional
code
string
message
Optional
message
401
Unauthorized
Operation doesn't return any data structure
500
Internal Error
Operation doesn't return any data structure