-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: István Zoltán Szabó <[email protected]> (cherry picked from commit 2da56ac)
- Loading branch information
Showing
35 changed files
with
794 additions
and
100 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
specification/watcher/ack_watch/examples/response/WatcherAckWatchResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# summary: | ||
description: A successful response from `POST _watcher/watch/my_watch/_ack`. | ||
# type: response | ||
# response_code: 200 | ||
value: |- | ||
{ | ||
"status": { | ||
"state": { | ||
"active": true, | ||
"timestamp": "2015-05-26T18:04:27.723Z" | ||
}, | ||
"last_checked": "2015-05-26T18:04:27.753Z", | ||
"last_met_condition": "2015-05-26T18:04:27.763Z", | ||
"actions": { | ||
"test_index": { | ||
"ack" : { | ||
"timestamp": "2015-05-26T18:04:27.713Z", | ||
"state": "acked" | ||
}, | ||
"last_execution" : { | ||
"timestamp": "2015-05-25T18:04:27.733Z", | ||
"successful": true | ||
}, | ||
"last_successful_execution" : { | ||
"timestamp": "2015-05-25T18:04:27.773Z", | ||
"successful": true | ||
} | ||
} | ||
}, | ||
"execution_state": "executed", | ||
"version": 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
specification/watcher/delete_watch/examples/response/DeleteWatchResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# summary: | ||
description: A successful response from `DELETE _watcher/watch/my_watch`. | ||
# type: response | ||
# response_code: 200 | ||
value: |- | ||
{ | ||
"found": true, | ||
"_id": "my_watch", | ||
"_version": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
specification/watcher/execute_watch/examples/request/WatcherExecuteRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
summary: Run a watch | ||
# method_request: POST _watcher/watch/my_watch/_execute | ||
description: > | ||
Run `POST _watcher/watch/my_watch/_execute` to run a watch. | ||
The input defined in the watch is ignored and the `alternative_input` is used as the payload. | ||
The condition as defined by the watch is ignored and is assumed to evaluate to true. | ||
The `force_simulate` action forces the simulation of `my-action`. | ||
Forcing the simulation means that throttling is ignored and the watch is simulated by Watcher instead of being run normally. | ||
# type: request | ||
value: |- | ||
{ | ||
"trigger_data" : { | ||
"triggered_time" : "now", | ||
"scheduled_time" : "now" | ||
}, | ||
"alternative_input" : { | ||
"foo" : "bar" | ||
}, | ||
"ignore_condition" : true, | ||
"action_modes" : { | ||
"my-action" : "force_simulate" | ||
}, | ||
"record_execution" : true | ||
} |
12 changes: 12 additions & 0 deletions
12
specification/watcher/execute_watch/examples/request/WatcherExecuteRequestExample2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
summary: Run a watch with multiple action modes | ||
# method_request: POST _watcher/watch/my_watch/_execute | ||
description: > | ||
Run `POST _watcher/watch/my_watch/_execute` and set a different mode for each action. | ||
# type: request | ||
value: |- | ||
{ | ||
"action_modes" : { | ||
"action1" : "force_simulate", | ||
"action2" : "skip" | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
specification/watcher/execute_watch/examples/request/WatcherExecuteRequestExample3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
summary: Run a watch inline | ||
# method_request: POST _watcher/watch/_execute | ||
description: > | ||
Run `POST _watcher/watch/_execute` to run a watch inline. | ||
All other settings for this API still apply when inlining a watch. | ||
In this example, while the inline watch defines a compare condition, during the execution this condition will be ignored. | ||
# type: request | ||
value: |- | ||
{ | ||
"watch" : { | ||
"trigger" : { "schedule" : { "interval" : "10s" } }, | ||
"input" : { | ||
"search" : { | ||
"request" : { | ||
"indices" : [ "logs" ], | ||
"body" : { | ||
"query" : { | ||
"match" : { "message": "error" } | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"condition" : { | ||
"compare" : { "ctx.payload.hits.total" : { "gt" : 0 }} | ||
}, | ||
"actions" : { | ||
"log_error" : { | ||
"logging" : { | ||
"text" : "Found {{ctx.payload.hits.total}} errors in the logs" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.