From 2f5a8c4c1c84a2c99829937453e0ae755501a494 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Tue, 10 Dec 2024 00:36:01 +0500 Subject: [PATCH] added node attributes as a additional property in shard stores and tests for shard stores Signed-off-by: Tokesh --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 2 +- spec/schemas/indices.shard_stores.yaml | 2 ++ tests/default/_core/shard_stores.yaml | 26 +++++++++++++++++++++++ tests/default/indices/shard_stores.yaml | 28 +++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/default/_core/shard_stores.yaml create mode 100644 tests/default/indices/shard_stores.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d6dc5979..222991096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added missing `status` to `/_search/template` response ([#702](https://github.com/opensearch-project/opensearch-api-specification/pull/702)) - Added `_type` to `rank_eval` API specs ([#704](https://github.com/opensearch-project/opensearch-api-specification/pull/704)) - Added request body to `_search_shards` API specs ([#709](https://github.com/opensearch-project/opensearch-api-specification/pull/709)) +- Added NodeAttributes as additional property in `shard_stores` API specs ([#709](https://github.com/opensearch-project/opensearch-api-specification/pull/709)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 3b71f9287..d48733fd5 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -2710,7 +2710,7 @@ components: additionalProperties: type: object indices_boost: - description: Allows increasing the relevance of specific indices in the search. + description: Allows increasing the relevance of specific indexes in the search. type: object additionalProperties: type: number diff --git a/spec/schemas/indices.shard_stores.yaml b/spec/schemas/indices.shard_stores.yaml index 0745101db..9b76b9027 100644 --- a/spec/schemas/indices.shard_stores.yaml +++ b/spec/schemas/indices.shard_stores.yaml @@ -40,6 +40,8 @@ components: $ref: '_common.yaml#/components/schemas/Id' store_exception: $ref: '#/components/schemas/ShardStoreException' + additionalProperties: + $ref: '_common.yaml#/components/schemas/NodeAttributes' required: - allocation ShardStoreAllocation: diff --git a/tests/default/_core/shard_stores.yaml b/tests/default/_core/shard_stores.yaml new file mode 100644 index 000000000..d425f9b73 --- /dev/null +++ b/tests/default/_core/shard_stores.yaml @@ -0,0 +1,26 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test _shard_stores API. +prologues: + - path: /_bulk + method: POST + parameters: + refresh: true + request: + content_type: application/x-ndjson + payload: + - {create: {_index: movies, _id: movie1}} + - {director: Quentin Tarantino, title: Pulp Fiction, year: 1994} + - {create: {_index: movies, _id: movie2}} + - {director: Christopher Nolan, title: Inception, year: 2010} +epilogues: + - path: /movies + method: DELETE + status: [200, 404] + +chapters: + - synopsis: Verify shard store information across all indices. + path: /_shard_stores + method: GET + response: + status: 200 diff --git a/tests/default/indices/shard_stores.yaml b/tests/default/indices/shard_stores.yaml new file mode 100644 index 000000000..07ca4f8fc --- /dev/null +++ b/tests/default/indices/shard_stores.yaml @@ -0,0 +1,28 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test _shard_stores API. +prologues: + - path: /_bulk + method: POST + parameters: + refresh: true + request: + content_type: application/x-ndjson + payload: + - {create: {_index: movies, _id: movie1}} + - {director: Quentin Tarantino, title: Pulp Fiction, year: 1994} + - {create: {_index: movies, _id: movie2}} + - {director: Christopher Nolan, title: Inception, year: 2010} +epilogues: + - path: /movies + method: DELETE + status: [200, 404] + +chapters: + - synopsis: Verify shard store information for a specific index. + path: /{index}/_shard_stores + parameters: + index: movies + method: GET + response: + status: 200