-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Enable must_exist parameter for update aliases API #11210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
51d0b36
Enable must_exist parameter for update aliases API
gaobinlong 011ad8c
modify changelog
gaobinlong bdb00e1
merge main
gaobinlong 16cde84
merge main
gaobinlong ef1767c
Fix test failure
gaobinlong c9c5451
Fix test failure
gaobinlong 16fff4c
Merge remote-tracking branch 'upstream/main' into fix_alias
gaobinlong 7647aeb
Merge remote-tracking branch 'upstream/main' into fix_alias
gaobinlong 73dddd8
Merge remote-tracking branch 'upstream/main' into fix_alias
gaobinlong b8c8791
Remove silently when all aliases are non-existing and must_exist is f…
gaobinlong 97f3ff0
Merge remote-tracking branch 'upstream/main' into fix_alias
gaobinlong 069675f
Modify some comments to run gradle check again
gaobinlong b6c3048
Add more yaml test
gaobinlong a93447f
Merge remote-tracking branch 'upstream/main' into fix_alias
gaobinlong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
141 changes: 141 additions & 0 deletions
141
...rc/main/resources/rest-api-spec/test/indices.update_aliases/40_remove_with_must_exist.yml
This file contains hidden or 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,141 @@ | ||
| --- | ||
| "Throw aliases missing exception when removing non-existing alias with setting must_exist to true": | ||
| - skip: | ||
| version: " - 2.99.99" | ||
| reason: "introduced in 3.0" | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test_index | ||
|
|
||
| - do: | ||
| indices.exists_alias: | ||
| name: test_alias | ||
|
|
||
| - is_false: '' | ||
|
|
||
| - do: | ||
| catch: /aliases \[test_alias\] missing/ | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| alias: test_alias | ||
| must_exist: true | ||
|
|
||
| - do: | ||
| catch: /aliases \[testAlias\*\] missing/ | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| aliases: [ testAlias* ] | ||
| must_exist: true | ||
|
|
||
| - do: | ||
| catch: /\[aliases\] can't be empty/ | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| aliases: [] | ||
| must_exist: true | ||
|
|
||
| --- | ||
| "Throw aliases missing exception when all of the specified aliases are non-existing": | ||
| - skip: | ||
| version: " - 2.99.99" | ||
| reason: "introduced in 3.0" | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test_index | ||
|
|
||
| - do: | ||
| indices.exists_alias: | ||
| name: test_alias | ||
|
|
||
| - is_false: '' | ||
|
|
||
| - do: | ||
| catch: /aliases \[test\_alias\] missing/ | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| alias: test_alias | ||
|
|
||
| - do: | ||
| catch: /aliases \[test\_alias\*\] missing/ | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| indices: [ test_index ] | ||
| aliases: [ test_alias* ] | ||
|
|
||
| --- | ||
| "Remove successfully when some specified aliases are non-existing": | ||
| - skip: | ||
| version: " - 2.99.99" | ||
| reason: "introduced in 3.0" | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test_index | ||
|
|
||
| - do: | ||
| indices.exists_alias: | ||
| name: test_alias | ||
|
|
||
| - is_false: '' | ||
|
|
||
| - do: | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - add: | ||
| indices: [ test_index ] | ||
| aliases: [ test_alias ] | ||
|
|
||
| - do: | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| aliases: [test_alias, test_alias1, test_alias2] | ||
| must_exist: false | ||
|
|
||
| - match: { acknowledged: true } | ||
|
|
||
| --- | ||
| "Remove silently when all of the specified aliases are non-existing and must_exist is false": | ||
| - skip: | ||
| version: " - 2.99.99" | ||
| reason: "introduced in 3.0" | ||
|
|
||
| - do: | ||
| indices.create: | ||
| index: test_index | ||
|
|
||
| - do: | ||
| indices.exists_alias: | ||
| name: test_alias | ||
|
|
||
| - is_false: '' | ||
|
|
||
| - do: | ||
| indices.update_aliases: | ||
| body: | ||
| actions: | ||
| - remove: | ||
| index: test_index | ||
| aliases: [test_alias, test_alias1, test_alias2] | ||
| must_exist: false | ||
|
|
||
| - match: { acknowledged: true } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.