diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a5b3a68c..10e6b1d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,9 +16,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609)) - Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613)) - Added `GET` and `HEAD /{index}/_source/{id}` returning `404` ([#673](https://github.com/opensearch-project/opensearch-api-specification/pull/673)) -- Added `rename_alias_pattern` and `rename_alias_replacment` to `/_snapshot/{repository}/{snapshot}/_restore` body parameters ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615)) +- Added `rename_alias_pattern` and `rename_alias_replacement` to `/_snapshot/{repository}/{snapshot}/_restore` body parameters ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615)) - Added `resource_stats` to `TaskInfoBase` ([#692](https://github.com/opensearch-project/opensearch-api-specification/pull/692)) - Added `s` to `/_ingest/processor/grok` ([#689](https://github.com/opensearch-project/opensearch-api-specification/pull/689)) +- Added `aggregations` to `/nodes/_usage/{metric}` requests and responses ([#615](https://github.com/opensearch-project/opensearch-api-specification/pull/615)) ### 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)) @@ -41,6 +42,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed `value` type in `ExplanationDetail` and added `_type` to `explain@200` ([#685](https://github.com/opensearch-project/opensearch-api-specification/pull/685)) - Fixed index settings types ([#684](https://github.com/opensearch-project/opensearch-api-specification/pull/684)) - Fixed `POST` and `DELETE /_dangling/{index_uuid}` returning `202` ([#686](https://github.com/opensearch-project/opensearch-api-specification/pull/686)) +- Fixed response schema for `/_nodes/reload_secure_settings` and `/_nodes/{node_id}/reload_secure_settings` ([#694](https://github.com/opensearch-project/opensearch-api-specification/pull/694)) - Fixed `/_ingest/pipeline/{id}/_simulate` response `docs/_source` field schema ([#689](https://github.com/opensearch-project/opensearch-api-specification/pull/689)) ### Changed diff --git a/spec/schemas/nodes._common.yaml b/spec/schemas/nodes._common.yaml index 8b4e8ba17..31a4317c3 100644 --- a/spec/schemas/nodes._common.yaml +++ b/spec/schemas/nodes._common.yaml @@ -187,8 +187,8 @@ components: _nodes: $ref: '_common.yaml#/components/schemas/NodeStatistics' NodeReloadResult: - oneOf: - - $ref: '#/components/schemas/Stats' + anyOf: + - $ref: '#/components/schemas/NodeReloadResponse' - $ref: '#/components/schemas/NodeReloadError' Stats: type: object @@ -1299,15 +1299,20 @@ components: replica_rejections: description: Number of indexing requests rejected in the replica stage. type: number - NodeReloadError: + NodeReloadResponse: type: object properties: name: $ref: '_common.yaml#/components/schemas/Name' - reload_exception: - $ref: '_common.yaml#/components/schemas/ErrorCause' required: - name + NodeReloadError: + allOf: + - $ref: '#/components/schemas/NodeReloadResponse' + - type: object + properties: + reload_exception: + $ref: '_common.yaml#/components/schemas/ErrorCause' SampleType: type: string description: The type to sample. diff --git a/spec/schemas/nodes.usage.yaml b/spec/schemas/nodes.usage.yaml index 2ce22876e..19deeb842 100644 --- a/spec/schemas/nodes.usage.yaml +++ b/spec/schemas/nodes.usage.yaml @@ -10,6 +10,7 @@ components: type: string enum: - _all + - aggregations - rest_actions ResponseBase: allOf: @@ -41,7 +42,5 @@ components: additionalProperties: type: object required: - - aggregations - - rest_actions - since - timestamp diff --git a/tests/default/nodes/reload_secure_settings.yaml b/tests/default/nodes/reload_secure_settings.yaml new file mode 100644 index 000000000..74568bf70 --- /dev/null +++ b/tests/default/nodes/reload_secure_settings.yaml @@ -0,0 +1,16 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: The nodes reload secure settings endpoint. +chapters: + - synopsis: Reload secure settings for all nodes. + path: /_nodes/reload_secure_settings + method: POST + response: + status: 200 + - synopsis: Reload secure settings for a node. + path: /_nodes/{node_id}/reload_secure_settings + method: POST + parameters: + node_id: _all + response: + status: 200 diff --git a/tests/default/nodes/stats.yaml b/tests/default/nodes/stats.yaml index a54f284ae..8886d05e6 100644 --- a/tests/default/nodes/stats.yaml +++ b/tests/default/nodes/stats.yaml @@ -179,3 +179,14 @@ chapters: - search response: status: 200 + - synopsis: Get statistics for search (`node_id`). + path: /_nodes/{node_id}/stats/{metric}/{index_metric} + method: GET + parameters: + node_id: _all + metric: + - indices + index_metric: + - search + response: + status: 200 diff --git a/tests/default/nodes/usage.yaml b/tests/default/nodes/usage.yaml new file mode 100644 index 000000000..083bfcbd1 --- /dev/null +++ b/tests/default/nodes/usage.yaml @@ -0,0 +1,60 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test nodes usage. +chapters: + - synopsis: Get usage for all nodes. + path: /_nodes/usage + method: GET + response: + status: 200 + - synopsis: Get usage for all nodes for all metrics. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - _all + response: + status: 200 + - synopsis: Get usage for all nodes for the `rest_actions` metric. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - rest_actions + response: + status: 200 + - synopsis: Get usage for all nodes for the `aggregations` metric. + path: /_nodes/usage/{metric} + method: GET + parameters: + metric: + - aggregations + response: + status: 200 + - synopsis: Get usage for all nodes (`node_id`). + path: /_nodes/{node_id}/usage + method: GET + parameters: + node_id: _all + response: + status: 200 + - synopsis: Get usage for all nodes for all metrics (`node_id`). + path: /_nodes/{node_id}/usage/{metric} + method: GET + parameters: + node_id: _all + metric: + - _all + response: + status: 200 + - synopsis: Get usage for all nodes and all metrics. + warnings: + multiple-paths-detected: false + path: /_nodes/{node_id}/{metric} + method: GET + parameters: + node_id: _all + metric: + - _all + response: + status: 200