diff options
author | Lee Hinman <lee@writequit.org> | 2017-06-07 10:27:43 -0600 |
---|---|---|
committer | Lee Hinman <lee@writequit.org> | 2017-06-08 10:03:03 -0600 |
commit | 5b2ab96364335539affe99151546552423700f6e (patch) | |
tree | 5b926ab704722d2f3aaa2a2da46c46361d4854f9 /rest-api-spec/src/main | |
parent | ee0e9216435ad73d91207b6ae5a3870ad9e139e7 (diff) |
Return index name and empty map for /{index}/_alias with no aliases
Previously in #24723 we changed the `_alias` API to not go through the
`RestGetIndicesAction` endpoint, instead creating a `RestGetAliasesAction` that
did the same thing.
This changes the formatting so that it matches the old formatting of the
endpoint, before:
```
GET /test-1/_alias
{ }
```
And after this change:
```
GET /test-1/_alias
{
"test-1": {
"aliases": {}
}
}
```
This is related to #25090
Diffstat (limited to 'rest-api-spec/src/main')
3 files changed, 85 insertions, 2 deletions
diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml index d1d01cbaaa..2882250519 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml @@ -84,6 +84,10 @@ setup: --- "check delete with index list": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + - do: indices.delete_alias: index: "test_index1,test_index2" @@ -106,6 +110,10 @@ setup: --- "check delete with prefix* index": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + - do: indices.delete_alias: index: "test_*" @@ -129,6 +137,10 @@ setup: --- "check delete with index list and * aliases": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + - do: indices.delete_alias: index: "test_index1,test_index2" @@ -152,6 +164,10 @@ setup: --- "check delete with index list and _all aliases": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + - do: indices.delete_alias: index: "test_index1,test_index2" @@ -175,6 +191,10 @@ setup: --- "check delete with index list and wildcard aliases": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + - do: indices.delete_alias: index: "test_index1,test_index2" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yml index 6678cbebbd..4e3861b059 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_alias/10_basic.yml @@ -41,6 +41,62 @@ setup: - is_false: test_index_2 --- +"Get aliases via /_all/_alias/": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: _all + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - match: {myindex.aliases: {}} + +--- +"Get aliases via /*/_alias/": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: "*" + + - match: {test_index.aliases.test_alias: {}} + - match: {test_index.aliases.test_blias: {}} + - match: {test_index_2.aliases.test_alias: {}} + - match: {test_index_2.aliases.test_blias: {}} + - match: {myindex.aliases: {}} + +--- +"Get and index with no aliases via /{index}/_alias/": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x + + - do: + indices.create: + index: myindex + + - do: + indices.get_alias: + index: myindex + + - match: {myindex.aliases: {}} + +--- "Get specific alias via /{index}/_alias/{name}": - do: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml index 05858dd176..aa030aa554 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml @@ -14,6 +14,9 @@ setup: --- "put alias per index": + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x - do: indices.put_alias: @@ -69,7 +72,9 @@ setup: --- "put alias prefix* index": - + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x - do: indices.put_alias: @@ -86,7 +91,9 @@ setup: --- "put alias in list of indices": - + - skip: + version: " - 5.99.99" + reason: only requested indices are included in 6.x - do: indices.put_alias: |