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

Fixed content-type of GET /_plugins/_observability/_local/stats. #711

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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 ([#715](https://github.com/opensearch-project/opensearch-api-specification/pull/715))
- Added missing `repository` query parameter to `/_cat/snapshots` ([#700](https://github.com/opensearch-project/opensearch-api-specification/pull/700))

### 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))
Expand Down Expand Up @@ -52,9 +53,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed `/_ingest/pipeline/{id}/_simulate` response `docs/_source` field schema ([#689](https://github.com/opensearch-project/opensearch-api-specification/pull/689))
- Fixed `/_scripts/painless/_execute` request and response schema ([#699](https://github.com/opensearch-project/opensearch-api-specification/pull/699))
- Fixed `fields` in `Hit` allowing primitive arrays ([#699](https://github.com/opensearch-project/opensearch-api-specification/pull/699))
- 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))
- Fixed `tenant` in `ObservabilityObject` request body to not be required ([#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))
Expand Down
6 changes: 3 additions & 3 deletions spec/namespaces/observability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ paths:
get:
operationId: observability.get_localstats.0
x-operation-group: observability.get_localstats
x-version-added: '1.1'
description: Retrieves Local Stats of all observability objects.
x-version-added: '2.5'
description: Retrieves local stats of all observability objects.
responses:
'200':
$ref: '#/components/responses/observability.get_localstats@200'
Expand Down Expand Up @@ -177,7 +177,7 @@ components:
observability.get_localstats@200:
description: Retrieves
content:
application/json:
text/plain:
schema:
type: string
parameters:
Expand Down
1 change: 0 additions & 1 deletion spec/schemas/observability._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ components:
$ref: '#/components/schemas/SavedQuery'
required:
- objectId
- tenant

OperationalPanel:
type: object
Expand Down
12 changes: 12 additions & 0 deletions tests/default/observability/local/stats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test backend stats.
version: '>= 2.5'

chapters:
- synopsis: Get observability stats.
path: /_plugins/_observability/_local/stats
method: GET
response:
status: 200
content_type: text/plain
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -56,12 +52,12 @@ prologues:
tokens:
- name: field1
type: text
status: [200]
- path: /_refresh
- synopsis: Refresh index.
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
Expand All @@ -74,15 +70,14 @@ 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:
object_id: test_object
request:
payload:
objectId: test_object
tenant: ''
operationalPanel:
name: updated_test_panel
visualizations: []
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading