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://{api_host}/api/ni/search/ql
COPY
Request Body
Search Query Request
SearchQueryRequest
of type(s)
application/json
Optional
{
"query": "VMs group by Application",
"size": 10,
"cursor": "MTA=",
"time_range": {
"start_time": 1597247025,
"end_time": 1597247999
}
}
string
query
Optional
Query
integer As int32
As int32
size
Optional
Page size of results
string
cursor
Optional
cursor
object
time_range
Optional
time_range
Responses
200
Success
Returns
SearchQueryResponse
of type(s)
application/json
"SearchQueryResponse Object"
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
"ApiError Object"
integer As int32
As int32
code
Optional
code
string
message
Optional
message
array of
object
details
Optional
details
401
Unauthorized
Operation doesn't return any data structure
500
Internal Error
Operation doesn't return any data structure
Code Samples
COPY
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{}' https://{api_host}/api/ni/search/ql