From 5285aa113dc227fbe3c5148e6d4a9a66336effdb Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 9 Dec 2024 08:39:52 -0500 Subject: [PATCH] Fixed content-type of `GET /_plugins/_observability/_local/stats`. Added missing observability object tests. Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/namespaces/observability.yaml | 2 +- tests/default/observability/local/stats.yaml | 11 ++++++ .../{observability.yaml => object.yaml} | 38 +++++++------------ 4 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 tests/default/observability/local/stats.yaml rename tests/default/observability/{observability.yaml => object.yaml} (85%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d6dc5979..3b7b828b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added missing `repository` query parameter to `/_cat/snapshots` ([#700](https://github.com/opensearch-project/opensearch-api-specification/pull/700)) - Fixed `hits` in `rank_eval` allowing numbers ([#704](https://github.com/opensearch-project/opensearch-api-specification/pull/704)) - Fixed query DSL schemas ([#706](https://github.com/opensearch-project/opensearch-api-specification/pull/706)) +- Fixed content-type of `GET /_plugins/_observability/_local/stats` ([#711](https://github.com/opensearch-project/opensearch-api-specification/pull/711)) ### Changed - Changed `tasks._common:TaskInfo` and `tasks._common:TaskGroup` to be composed of a `tasks._common:TaskInfoBase` ([#683](https://github.com/opensearch-project/opensearch-api-specification/pull/683)) diff --git a/spec/namespaces/observability.yaml b/spec/namespaces/observability.yaml index 62cca3dfd..2ac60d858 100644 --- a/spec/namespaces/observability.yaml +++ b/spec/namespaces/observability.yaml @@ -177,7 +177,7 @@ components: observability.get_localstats@200: description: Retrieves content: - application/json: + text/plain: schema: type: string parameters: diff --git a/tests/default/observability/local/stats.yaml b/tests/default/observability/local/stats.yaml new file mode 100644 index 000000000..6a3bf1df7 --- /dev/null +++ b/tests/default/observability/local/stats.yaml @@ -0,0 +1,11 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test backend stats. + +chapters: + - synopsis: Get observability stats. + path: /_plugins/_observability/_local/stats + method: GET + response: + status: 200 + content_type: text/plain \ No newline at end of file diff --git a/tests/default/observability/observability.yaml b/tests/default/observability/object.yaml similarity index 85% rename from tests/default/observability/observability.yaml rename to tests/default/observability/object.yaml index e27b2be5e..7429cd00d 100644 --- a/tests/default/observability/observability.yaml +++ b/tests/default/observability/object.yaml @@ -2,13 +2,9 @@ $schema: ../../../json_schemas/test_story.schema.yaml description: Test various operations of the OpenSearch Observability Object API. -prologues: - - path: /_plugins/_observability/object/{object_id} - method: DELETE - parameters: - object_id: test_object - status: [200, 404] - - path: /_plugins/_observability/object +chapters: + - synopsis: Create an observability object. + path: /_plugins/_observability/object method: POST request: payload: @@ -56,12 +52,11 @@ prologues: tokens: - name: field1 type: text - status: [200] - path: /_refresh method: POST - status: [200] -chapters: - - synopsis: Retrieve specific Observability object after creation. + warnings: + multiple-paths-detected: false + - synopsis: Retrieve an observability object. path: /_plugins/_observability/object/{object_id} id: observatory_object method: GET @@ -74,7 +69,7 @@ chapters: totalHits: 1 totalHitRelation: eq observabilityObjectList: [] - - synopsis: Update specific Observability object. + - synopsis: Update an observability object. path: /_plugins/_observability/object/{object_id} method: PUT parameters: @@ -128,19 +123,7 @@ chapters: status: 200 payload: objectId: test_object - - synopsis: Retrieve specific Observability object after update. - path: /_plugins/_observability/object/{object_id} - method: GET - parameters: - object_id: test_object - response: - status: 200 - payload: - startIndex: 0 - totalHits: 1 - totalHitRelation: eq - observabilityObjectList: [] - - synopsis: Retrieve list of Observability objects. + - synopsis: Retrieve all observability objects. path: /_plugins/_observability/object method: GET response: @@ -150,6 +133,11 @@ chapters: totalHits: 1 totalHitRelation: eq observabilityObjectList: [] + - synopsis: Delete an observability object. + path: /_plugins/_observability/object/{object_id} + method: DELETE + parameters: + object_id: test_object epilogues: - path: /_plugins/_observability/object/{object_id} method: DELETE