Skip to content

Commit 9b9b141

Browse files
committed
Adding examples
1 parent 4b41e98 commit 9b9b141

File tree

6 files changed

+185
-0
lines changed

6 files changed

+185
-0
lines changed

output/schema/schema.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
summary: Get data stream settings on a data stream
2+
description: >
3+
This is a response to `GET /_data_stream/my-data-stream/_settings` where my-data-stream that has two settings set. The
4+
`effective_settings` field shows additional settings that are pulled from its template.
5+
# type: response
6+
# response_code: 200
7+
value: |-
8+
{
9+
"data_streams": [
10+
{
11+
"name": "my-data-stream",
12+
"settings": {
13+
"index": {
14+
"lifecycle": {
15+
"name": "new-test-policy"
16+
},
17+
"number_of_shards": "11"
18+
}
19+
},
20+
"effective_settings": {
21+
"index": {
22+
"lifecycle": {
23+
"name": "new-test-policy"
24+
},
25+
"mode": "standard",
26+
"number_of_shards": "11",
27+
"number_of_replicas": "0"
28+
}
29+
}
30+
}
31+
]
32+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
summary: Change data stream settings on a data stream
2+
description: >
3+
This shows a response to `PUT /_data_stream/my-data-stream/_settings` when two settings are successfully updated on
4+
the data stream. In this case, `index.number_of_shards` is only applied to the data stream -- it will be applied to
5+
the write index on rollover. The setting `index.lifecycle.name` is applied to the data stream and all backing indices.
6+
# type: response
7+
# response_code: 200
8+
value: |-
9+
{
10+
"data_streams": [
11+
{
12+
"name": "my-data-stream",
13+
"applied_to_data_stream": true,
14+
"settings": {
15+
"index": {
16+
"lifecycle": {
17+
"name": "new-test-policy"
18+
},
19+
"number_of_shards": "11"
20+
}
21+
},
22+
"effective_settings": {
23+
"index": {
24+
"lifecycle": {
25+
"name": "new-test-policy"
26+
},
27+
"mode": "standard",
28+
"number_of_shards": "11",
29+
"number_of_replicas": "0"
30+
}
31+
},
32+
"index_settings_results": {
33+
"applied_to_data_stream_only": [
34+
"index.number_of_shards"
35+
],
36+
"applied_to_data_stream_and_backing_indices": [
37+
"index.lifecycle.name"
38+
]
39+
}
40+
}
41+
]
42+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
summary: Change data stream settings on a data stream that has an index with a metadata block
2+
description: >
3+
This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a setting is successfully applied to the
4+
data stream, but one of the backing indices, `.ds-my-data-stream-2025.05.28-000001`, has a write block. The response
5+
reports that the setting was not successfully applied to that index.
6+
# type: response
7+
# response_code: 200
8+
value: |-
9+
{
10+
"data_streams": [
11+
{
12+
"name": "my-data-stream",
13+
"applied_to_data_stream": true,
14+
"settings": {
15+
"index": {
16+
"lifecycle": {
17+
"name": "new-test-policy"
18+
},
19+
"number_of_shards": "11"
20+
}
21+
},
22+
"effective_settings": {
23+
"index": {
24+
"lifecycle": {
25+
"name": "new-test-policy"
26+
},
27+
"mode": "standard",
28+
"number_of_shards": "11",
29+
"number_of_replicas": "0"
30+
}
31+
},
32+
"index_settings_results": {
33+
"applied_to_data_stream_only": [
34+
"index.number_of_shards"
35+
],
36+
"applied_to_data_stream_and_backing_indices": [
37+
"index.lifecycle.name"
38+
],
39+
"errors": [
40+
{
41+
"index": ".ds-my-data-stream-2025.05.28-000001",
42+
"error": "index [.ds-my-data-stream-2025.05.28-000001] blocked by: [FORBIDDEN/9/index metadata (api)];"
43+
}
44+
]
45+
}
46+
}
47+
]
48+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
summary: Attempt to change a data stream setting that is not allowed
2+
description: >
3+
This shows a response to `PUT /_data_stream/my-data-stream/_settings` when a user attempts to set a setting that is
4+
not allowed on a data stream. As a result, no change was applied to the data stream.
5+
# type: response
6+
# response_code: 200
7+
value: |-
8+
{
9+
"data_streams": [
10+
{
11+
"name": "my-data-stream",
12+
"applied_to_data_stream": false,
13+
"error": "Cannot set the following settings on a data stream: [index.number_of_replicas]",
14+
"settings": {},
15+
"effective_settings": {},
16+
"index_settings_results": {
17+
"applied_to_data_stream_only": [],
18+
"applied_to_data_stream_and_backing_indices": []
19+
}
20+
}
21+
]
22+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
summary: Change a data stream setting
2+
# method_request: PUT /_data_stream/my-data-stream/_settings
3+
description: >
4+
This is a request to change two settings on a data stream.
5+
# type: request
6+
value: |-
7+
{
8+
"index.lifecycle.name" : "new-test-policy",
9+
"index.number_of_shards": 11
10+
}

0 commit comments

Comments
 (0)