Skip to content

Commit 2da56ac

Browse files
lcawlszabosteve
andauthored
Add Watcher API examples (#3489)
Co-authored-by: István Zoltán Szabó <szabosteve@gmail.com>
1 parent a63b1f6 commit 2da56ac

34 files changed

+759
-95
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 37 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 115 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ run-as-privilege,https://www.elastic.co/guide/en/elasticsearch/reference/{branch
504504
runtime-search-request,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/runtime-search-request.html
505505
script-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/script-processor.html
506506
scroll-search-results,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/paginate-search-results.html#scroll-search-results
507+
search-after,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/paginate-search-results.html#search-after
507508
search-aggregations,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations.html
508509
search-aggregations-bucket-adjacency-matrix-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-adjacency-matrix-aggregation.html
509510
search-aggregations-bucket-autodatehistogram-aggregation,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations-bucket-autodatehistogram-aggregation.html

specification/ccr/put_auto_follow_pattern/examples/response/PutAutoFollowPatternResponseExample1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ description: A successful response for creating an auto-follow pattern.
33
# type: response
44
# response_code: 200
55
value:
6-
acknowledged": true
6+
acknowledged: true

specification/watcher/_types/Execution.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ export class ExecutionResultInput {
9292
}
9393

9494
export class ExecutionThreadPool {
95+
/**
96+
* The largest size of the execution thread pool, which indicates the largest number of concurrent running watches.
97+
*/
9598
max_size: long
99+
/**
100+
* The number of watches that were triggered and are currently queued.
101+
*/
96102
queue_size: long
97103
}

specification/watcher/ack_watch/WatcherAckWatchRequest.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,24 @@ import { Name, Names } from '@_types/common'
2828
*
2929
* IMPORTANT: If the specified watch is currently being executed, this API will return an error
3030
* The reason for this behavior is to prevent overwriting the watch status from a watch execution.
31+
*
32+
* Acknowledging an action throttles further executions of that action until its `ack.state` is reset to `awaits_successful_execution`.
33+
* This happens when the condition of the watch is not met (the condition evaluates to false).
3134
* @rest_spec_name watcher.ack_watch
3235
* @availability stack stability=stable
3336
* @cluster_privileges manage_watcher
37+
* @doc_id watcher-api-ack-watch
3438
*/
3539
export interface Request extends RequestBase {
3640
path_parts: {
41+
/**
42+
* The watch identifier.
43+
*/
3744
watch_id: Name
45+
/**
46+
* A comma-separated list of the action identifiers to acknowledge.
47+
* If you omit this parameter, all of the actions of the watch are acknowledged.
48+
*/
3849
action_id?: Names
3950
}
4051
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# summary:
2+
description: A successful response from `POST _watcher/watch/my_watch/_ack`.
3+
# type: response
4+
# response_code: 200
5+
value: |-
6+
{
7+
"status": {
8+
"state": {
9+
"active": true,
10+
"timestamp": "2015-05-26T18:04:27.723Z"
11+
},
12+
"last_checked": "2015-05-26T18:04:27.753Z",
13+
"last_met_condition": "2015-05-26T18:04:27.763Z",
14+
"actions": {
15+
"test_index": {
16+
"ack" : {
17+
"timestamp": "2015-05-26T18:04:27.713Z",
18+
"state": "acked"
19+
},
20+
"last_execution" : {
21+
"timestamp": "2015-05-25T18:04:27.733Z",
22+
"successful": true
23+
},
24+
"last_successful_execution" : {
25+
"timestamp": "2015-05-25T18:04:27.773Z",
26+
"successful": true
27+
}
28+
}
29+
},
30+
"execution_state": "executed",
31+
"version": 2
32+
}
33+
}

specification/watcher/activate_watch/WatcherActivateWatchRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ import { Name } from '@_types/common'
2626
* @rest_spec_name watcher.activate_watch
2727
* @availability stack stability=stable
2828
* @cluster_privileges manage_watcher
29+
* @doc_id watcher-api-activate-watch
2930
* @ext_doc_id watcher-works
3031
*/
3132
export interface Request extends RequestBase {
3233
path_parts: {
34+
/**
35+
* The watch identifier.
36+
*/
3337
watch_id: Name
3438
}
3539
}

specification/watcher/deactivate_watch/DeactivateWatchRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ import { Name } from '@_types/common'
2626
* @rest_spec_name watcher.deactivate_watch
2727
* @availability stack stability=stable
2828
* @cluster_privileges manage_watcher
29+
* @doc_id watcher-api-deactivate-watch
2930
* @ext_doc_id watcher-works
3031
*/
3132
export interface Request extends RequestBase {
3233
path_parts: {
34+
/**
35+
* The watch identifier.
36+
*/
3337
watch_id: Name
3438
}
3539
}

0 commit comments

Comments
 (0)