Skip to content
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

Add is_hidden parameter for create or update alias API #429

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
- Add `is_hidden` parameter for create or update alias API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it look like the rest of the lines.

"Added is_hidden to /{index}/_alias/ (#...)"


### Changed

Expand Down
5 changes: 5 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,11 @@ 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, defaults to `false`.
type: boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add default: false, and no need to say "defaults to ..." in the text. We're going to clean these up at some point.

description: The settings for the alias, such as `routing` or `filter`
indices.put_index_template:
content:
Expand Down
42 changes: 42 additions & 0 deletions tests/indices/create_or_update_alias.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$schema: ../../json_schemas/test_story.schema.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have alias.yaml that has a lot of similar tests. Either add one more test for is_hidden there, or create a folder called tests/indices/alias/is_hidden.yaml and include only functionality related to this new is_hidden into it. I think the former seems simpler.

You also need to add version: '>= 2.16' into the test so it doesn't run with older OpenSearch (I expect it to fail).


description: Test create or update alias endpoints.
epilogues:
- path: /games
method: DELETE
status: [200, 404]
prologues:
- path: /{index}
method: PUT
parameters:
index: games
chapters:
- synopsis: Create an alias.
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
- synopsis: Create an alias with custom routing.
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
request_body:
payload:
index_routing: test1
search_routing: test2
- synopsis: Create an alias with custom settings.
path: /{index}/_alias/{name}
method: PUT
parameters:
index: games
name: jeux
request_body:
payload:
routing: test
is_write_index: true
is_hidden: true
filter:
match_all: {}
Loading