mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 21:18:31 +00:00
* Made GET mappings consistent, supporting * /{index}/_mappings/{type} * /{index}/_mapping/{type} * /_mapping/{type} * Added "mappings" in the JSON response to align it with other responses * Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name} as well as wildcards and _all notation * Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name} as well as wildcards and _all notation * Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name} as well as supportings wildcards in settings name * Returning empty JSON instead of a 404, if a specific warmer/ setting/alias/type is missing * Added a ton of spec tests for all of the above * Added a couple of more integration tests for several features Relates #4071
215 lines
4.4 KiB
YAML
215 lines
4.4 KiB
YAML
---
|
|
setup:
|
|
|
|
- do:
|
|
indices.create:
|
|
index: test_index
|
|
|
|
- do:
|
|
indices.create:
|
|
index: test_index_2
|
|
|
|
- do:
|
|
indices.put_alias:
|
|
index: test_index
|
|
name: test_alias
|
|
|
|
- do:
|
|
indices.put_alias:
|
|
index: test_index
|
|
name: test_blias
|
|
|
|
- do:
|
|
indices.put_alias:
|
|
index: test_index_2
|
|
name: test_alias
|
|
|
|
- do:
|
|
indices.put_alias:
|
|
index: test_index_2
|
|
name: test_blias
|
|
|
|
---
|
|
"Get all aliases via /_aliases":
|
|
|
|
- do:
|
|
indices.get_aliases: {}
|
|
|
|
- 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: {}}
|
|
|
|
|
|
---
|
|
"Get all aliases via /{index}/_aliases/":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index.aliases.test_blias: {}}
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get specific alias via /{index}/_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: test_alias
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get aliases via /{index}/_aliases/_all":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: _all
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index.aliases.test_blias: {}}
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get aliases via /{index}/_aliases/*":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: '*'
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index.aliases.test_blias: {}}
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get aliases via /{index}/_aliases/prefix*":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: 'test_a*'
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get aliases via /{index}/_aliases/name,name":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: 'test_alias,test_blias'
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index.aliases.test_blias: {}}
|
|
- is_false: test_index_2
|
|
|
|
---
|
|
"Get aliases via /_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
name: test_alias
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index_2.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2.aliases.test_blias
|
|
|
|
---
|
|
"Get aliases via /_all/_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: _all
|
|
name: test_alias
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index_2.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2.aliases.test_blias
|
|
|
|
---
|
|
"Get aliases via /*/_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: '*'
|
|
name: test_alias
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index_2.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2.aliases.test_blias
|
|
|
|
---
|
|
"Get aliases via /pref*/_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: '*2'
|
|
name: test_alias
|
|
|
|
- match: {test_index_2.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_alias
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2.aliases.test_blias
|
|
|
|
---
|
|
"Get aliases via /name,name/_aliases/{name}":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index,test_index_2
|
|
name: test_alias
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- match: {test_index_2.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.test_blias
|
|
- is_false: test_index_2.aliases.test_blias
|
|
|
|
|
|
---
|
|
"Non-existent alias on an existing index returns matching indcies":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: non-existent
|
|
|
|
- match: { test_index.aliases: {}}
|
|
|
|
---
|
|
"Existent and non-existent alias returns just the existing":
|
|
|
|
- do:
|
|
indices.get_aliases:
|
|
index: test_index
|
|
name: test_alias,non-existent
|
|
|
|
- match: {test_index.aliases.test_alias: {}}
|
|
- is_false: test_index.aliases.non-existent
|
|
|
|
---
|
|
"Getting alias on an non-existent index should return 404":
|
|
|
|
- skip:
|
|
version: 1 - 999
|
|
reason: not implemented yet
|
|
- do:
|
|
catch: missing
|
|
indices.get_aliases:
|
|
index: non-existent
|
|
name: foo
|
|
|
|
|
|
|