Skip to content

Commit daaa778

Browse files
committed
Add examples for simulate APIs
1 parent 6387891 commit daaa778

File tree

9 files changed

+51
-12
lines changed

9 files changed

+51
-12
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ indices-rollover-index,https://www.elastic.co/guide/en/elasticsearch/reference/{
266266
indices-segments,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-segments.html
267267
indices-shards-stores,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-shards-stores.html
268268
indices-shrink-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-shrink-index.html
269+
indices-simulate,https://www.elastic.co/guide/en/elasticsearch/reference/{master}/indices-simulate-index.html
269270
indices-simulate-template,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-simulate-template.html
270271
indices-split-index,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-split-index.html
271272
indices-stats,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/indices-stats.html

specification/indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { Duration } from '@_types/Time'
2727
* @rest_spec_name indices.simulate_index_template
2828
* @availability stack since=7.9.0 stability=stable
2929
* @availability serverless stability=stable visibility=public
30-
* @doc_id indices-simulate-template
30+
* @doc_id indices-simulate
3131
* @cluster_privileges manage_index_templates
3232
*/
3333
export interface Request extends RequestBase {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# summary: indices/simulate-index.asciidoc:188
2+
description: A successful response from `POST /_index_template/_simulate_index/my-index-000001`.
3+
# type: response
4+
# response_code: 200
5+
value: "{\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \
6+
\ \"number_of_shards\" : \"2\",\n \"number_of_replicas\" : \"0\",\n \
7+
\ \"routing\" : {\n \"allocation\" : {\n \"include\" : {\n\
8+
\ \"_tier_preference\" : \"data_content\"\n }\n \
9+
\ }\n }\n }\n },\n \"mappings\" : {\n \"properties\" : {\n\
10+
\ \"@timestamp\" : {\n \"type\" : \"date\"\n }\n }\n\
11+
\ },\n \"aliases\" : { }\n },\n \"overlapping\" : [\n {\n \"name\"\
12+
\ : \"template_1\",\n \"index_patterns\" : [\n \"my-index-*\"\n \
13+
\ ]\n }\n ]\n}"

specification/indices/simulate_template/IndicesSimulateTemplateRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ import { Duration } from '@_types/Time'
2626

2727
/**
2828
* Simulate an index template.
29-
* Returns the index configuration that would be applied by a particular index template.
29+
* Get the index configuration that would be applied by a particular index template.
3030
* @rest_spec_name indices.simulate_template
3131
* @availability stack stability=stable
3232
* @availability serverless stability=stable visibility=public
3333
* @cluster_privileges manage_index_templates
34+
* @doc_id indices-simulate-template
3435
*/
3536
export interface Request extends RequestBase {
3637
path_parts: {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# summary:
2+
# method_request: POST /_index_template/_simulate
3+
description: >
4+
To see what settings will be applied by a template before you add it to the cluster, you can pass a template configuration in the request body.
5+
The specified template is used for the simulation if it has a higher priority than existing templates.
6+
# type: request
7+
value: "{\n \"index_patterns\": [\"my-index-*\"],\n \"composed_of\": [\"ct2\"],\n\
8+
\ \"priority\": 10,\n \"template\": {\n \"settings\": {\n \"index.number_of_replicas\"\
9+
: 1\n }\n }\n}"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# summary:
2+
description: >
3+
A successful response from `POST /_index_template/_simulate` with a template configuration in the request body.
4+
The response shows any overlapping templates with a lower priority.
5+
# type: response
6+
# response_code: 200
7+
value: "{\n \"template\" : {\n \"settings\" : {\n \"index\" : {\n \
8+
\ \"number_of_replicas\" : \"1\",\n \"routing\" : {\n \"allocation\"\
9+
\ : {\n \"include\" : {\n \"_tier_preference\" : \"data_content\"\
10+
\n }\n }\n }\n }\n },\n \"mappings\" : {\n\
11+
\ \"properties\" : {\n \"@timestamp\" : {\n \"type\" : \"date\"\
12+
\n }\n }\n },\n \"aliases\" : { }\n },\n \"overlapping\" : [\n\
13+
\ {\n \"name\" : \"final-template\",\n \"index_patterns\" : [\n \
14+
\ \"my-index-*\"\n ]\n }\n ]\n}"

0 commit comments

Comments
 (0)