Skip to content

Commit

Permalink
Add is_hidden parameter for create or update alias API (#429)
Browse files Browse the repository at this point in the history
* Add  parameter for create or update alias API

Signed-off-by: gaobinlong <[email protected]>

* Optimize changelog and test case

Signed-off-by: gaobinlong <[email protected]>

---------

Signed-off-by: gaobinlong <[email protected]>
  • Loading branch information
gaobinlong authored Jul 18, 2024
1 parent 82c000f commit b553c4b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added missing fields to `/_nodes/stats` ([#415](https://github.com/opensearch-project/opensearch-api-specification/pull/415))
- Added missing metrics options to `/_nodes/stats` ([#422](https://github.com/opensearch-project/opensearch-api-specification/pull/422))
- Added tests against OpenSearch 1.3 ([#424](https://github.com/opensearch-project/opensearch-api-specification/pull/424))
- Added `is_hidden` to `/{index}/_alias/{name}` and `/{index}/_aliases/{name}` ([#429](https://github.com/opensearch-project/opensearch-api-specification/pull/429))

### Changed

Expand Down
6 changes: 6 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,12 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/Routing'
search_routing:
$ref: '../schemas/_common.yaml#/components/schemas/Routing'
is_hidden:
x-version-added: '2.16'
description: |-
If `true`, the alias will be hidden`.
type: boolean
default: false
description: The settings for the alias, such as `routing` or `filter`
indices.put_index_template:
content:
Expand Down
30 changes: 30 additions & 0 deletions tests/indices/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,33 @@ chapters:
parameters:
index: games
name: plays2
- synopsis: Create an alias by Create or Update alias endpoint.
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
- synopsis: Create an alias with custom settings by Create or Update alias endpoint.
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
request_body:
payload:
index_routing: test1
search_routing: test2
routing: test
is_write_index: true
filter:
match_all: {}
- synopsis: Create an alias with is_hidden by Create or Update alias endpoint.
version: '>= 2.16'
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
request_body:
payload:
is_hidden: true

0 comments on commit b553c4b

Please sign in to comment.