Skip to content

Commit

Permalink
Fix: cluster settings can be flat. (#545)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Aug 30, 2024
1 parent 3f806a1 commit 30f1846
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed query DSL `neural` field `query_image` set `contentEncoding` and `model_id` as optional ([#512](https://github.com/opensearch-project/opensearch-api-specification/pull/512))
- Fixed `knn` query specification ([#538](https://github.com/opensearch-project/opensearch-api-specification/pull/538))
- Fixed content-type for `/hot_threads` ([#543](https://github.com/opensearch-project/opensearch-api-specification/pull/543))
- Fixed `/_cluster/settings` returning flat results ([#545](https://github.com/opensearch-project/opensearch-api-specification/pull/545))

### Security

Expand Down
9 changes: 3 additions & 6 deletions spec/namespaces/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,16 +634,13 @@ components:
properties:
persistent:
type: object
additionalProperties:
type: object
additionalProperties: true
transient:
type: object
additionalProperties:
type: object
additionalProperties: true
defaults:
type: object
additionalProperties:
type: object
additionalProperties: true
required:
- persistent
- transient
Expand Down
44 changes: 44 additions & 0 deletions tests/default/cluster/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test cluster settings.
chapters:
- synopsis: Returns cluster settings.
path: /_cluster/settings
method: GET
parameters:
flat_settings: false
response:
status: 200
- synopsis: Returns cluster settings with defaults.
path: /_cluster/settings
method: GET
parameters:
include_defaults: true
response:
status: 200
- synopsis: Returns cluster flat settings.
path: /_cluster/settings
method: GET
parameters:
flat_settings: true
response:
status: 200
- synopsis: Sets cluster settings.
path: /_cluster/settings
method: PUT
request:
payload:
transient:
cluster:
max_shards_per_node: 500
response:
status: 200
- synopsis: Sets cluster flat settings.
path: /_cluster/settings
method: PUT
request:
payload:
transient:
cluster.max_shards_per_node: 500
response:
status: 200

0 comments on commit 30f1846

Please sign in to comment.