forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
elastic#104233 Allow Watcher Node Allocation Settings (elastic#115251)
* Update settings endpoint modified Now accepts index.routing.allocation.* settings but denies changing the allocation setting that keeps watches on data nodes * Get settings endpoint modified Now returns index.routing.allocation.* settings explicitly filters out the `index.routing.allocation.include._tier_preference` setting * Tests for modified endpoints * Update docs
- Loading branch information
1 parent
07374ab
commit 36c45c1
Showing
5 changed files
with
149 additions
and
81 deletions.
There are no files selected for viewing
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
104 changes: 104 additions & 0 deletions
104
...lRestTest/resources/rest-api-spec/test/watcher/settings_endpoints/10_watcher_settings.yml
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,104 @@ | ||
--- | ||
setup: | ||
- do: | ||
cluster.health: | ||
wait_for_status: yellow | ||
- do: | ||
watcher.put_watch: | ||
id: "my_watch" | ||
body: > | ||
{ | ||
"trigger": { | ||
"schedule": { | ||
"hourly": { | ||
"minute": [ 0, 5 ] | ||
} | ||
} | ||
}, | ||
"input": { | ||
"simple": { | ||
"payload": { | ||
"send": "yes" | ||
} | ||
} | ||
}, | ||
"condition": { | ||
"always": {} | ||
}, | ||
"actions": { | ||
"test_index": { | ||
"index": { | ||
"index": "test" | ||
} | ||
} | ||
} | ||
} | ||
--- | ||
"Test update and get watch settings api": | ||
- do: | ||
watcher.get_settings: { } | ||
|
||
- match: { index.auto_expand_replicas: "0-1" } | ||
- match: { index.number_of_replicas: "0" } | ||
|
||
- do: | ||
watcher.update_settings: | ||
body: | ||
index.auto_expand_replicas: "0-all" | ||
|
||
- do: | ||
watcher.get_settings: { } | ||
|
||
- match: { index.auto_expand_replicas: "0-all" } | ||
- is_false: index.routing.allocation.include._tier_preference | ||
|
||
- do: | ||
watcher.update_settings: | ||
body: | ||
index.auto_expand_replicas: null | ||
index.number_of_replicas: 1 | ||
|
||
- do: | ||
watcher.get_settings: { } | ||
|
||
- match: { index.number_of_replicas: "1" } | ||
--- | ||
"Test disallowed setting name throws error": | ||
- requires: | ||
test_runner_features: regex | ||
- do: | ||
watcher.update_settings: | ||
body: | ||
index.disallowed_setting: "some_invalid_value" | ||
catch: bad_request | ||
- match: | ||
error: | ||
type: "action_request_validation_exception" | ||
reason: '/illegal settings\: \[index.disallowed_setting\].*/' | ||
--- | ||
"Test allowed prefix setting name": | ||
- do: | ||
watcher.update_settings: | ||
body: | ||
index.routing.allocation.include.role: "watcher" | ||
index.routing.allocation.exclude.role: "noWatcher" | ||
index.routing.allocation.require.role: "mustWatcher" | ||
- do: | ||
watcher.get_settings: { } | ||
- match: { index.routing.allocation.include.role: "watcher" } | ||
- match: { index.routing.allocation.exclude.role: "noWatcher" } | ||
- match: { index.routing.allocation.require.role: "mustWatcher" } | ||
--- | ||
"Test explicitly disallowed prefix setting name throws error": | ||
- requires: | ||
test_runner_features: regex | ||
- do: | ||
watcher.update_settings: | ||
body: | ||
index.routing.allocation.include.disallowed_prefix: "some_invalid_value" | ||
catch: bad_request | ||
- match: | ||
error: | ||
type: "action_request_validation_exception" | ||
reason: '/illegal settings\: \[index.routing.allocation.include.disallowed_prefix\].*/' |
66 changes: 0 additions & 66 deletions
66
...tTest/resources/rest-api-spec/test/watcher/update_settings/10_update_watcher_settings.yml
This file was deleted.
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