Query watches
Added in 7.11.0
Get all registered watches in a paginated manner and optionally filter watches by a query.
Note that only the _id
and metadata.*
fields are queryable or sortable.
Body
-
from
number The offset from the first result to fetch. It must be non-negative.
-
size
number The number of hits to return. It must be non-negative.
-
query
object An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
-
search_after
array[number | string | boolean | null] A field value.
POST
/_watcher/_query/watches
curl \
--request POST 'http://api.example.com/_watcher/_query/watches' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"from":42.0,"size":42.0,"query":{},"":"string","search_after":[42.0]}'
Request examples
{
"from": 42.0,
"size": 42.0,
"query": {},
"": "string",
"search_after": [
42.0
]
}
Response examples (200)
A successful response from `GET /_watcher/_query/watches`.
{
"count": 1,
"watches": [
{
"_id": "my_watch",
"watch": {
"trigger": {
"schedule": {
"hourly": {
"minute": [
0,
5
]
}
}
},
"input": {
"simple": {
"payload": {
"send": "yes"
}
}
},
"condition": {
"always": {}
},
"actions": {
"test_index": {
"index": {
"index": "test"
}
}
}
},
"status": {
"state": {
"active": true,
"timestamp": "2015-05-26T18:21:08.630Z"
},
"actions": {
"test_index": {
"ack": {
"timestamp": "2015-05-26T18:21:08.630Z",
"state": "awaits_successful_execution"
}
}
},
"version": -1
},
"_seq_no": 0,
"_primary_term": 1
}
]
}