-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds index API requests and responses - part 1 (#2979)
Co-authored-by: lcawl <[email protected]>
- Loading branch information
1 parent
0e35843
commit 470590b
Showing
17 changed files
with
261 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
specification/indices/add_block/IndicesAddBlockResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# summary: '' | ||
description: 'A successful response for adding an index block to an index.' | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"acknowledged\" : true,\n \"shards_acknowledged\" : true,\n \"indices\"\ | ||
\ : [ {\n \"name\" : \"my-index-000001\",\n \"blocked\" : true\n } ]\n}" |
5 changes: 5 additions & 0 deletions
5
specification/indices/analyze/indicesAnalyzeRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: Perform analysis on a text string and returns the resulting tokens. | ||
method_request: GET /_analyze | ||
# description: '' | ||
# type: request | ||
value: "{\n \"analyzer\" : \"standard\",\n \"text\" : \"Quick Brown Foxes!\"\n}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
summary: Clone an existing index. | ||
# method_request: POST /my_source_index/_clone/my_target_index | ||
description: > | ||
Clone `my_source_index` into a new index called `my_target_index` with `POST /my_source_index/_clone/my_target_index`. The API accepts `settings` and `aliases` parameters for the target index. | ||
# type: request | ||
value: | ||
"{\n \"settings\": {\n \"index.number_of_shards\": 5\n },\n \"aliases\"\ | ||
: {\n \"my_search_indices\": {}\n }\n}" |
7 changes: 7 additions & 0 deletions
7
specification/indices/close/indicesCloseResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# summary: '' | ||
description: A successful response for closing an index. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"acknowledged\": true,\n \"shards_acknowledged\": true,\n \"indices\"\ | ||
: {\n \"my-index-000001\": {\n \"closed\": true\n }\n }\n}" |
7 changes: 7 additions & 0 deletions
7
specification/indices/create/indicesCreateRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
summary: Creates an index. | ||
# method_request: PUT /my-index-000001 | ||
description: This request specifies the `number_of_shards` and `number_of_replicas`. | ||
# type: request | ||
value: | ||
"{\n \"settings\": {\n \"number_of_shards\": 3,\n \"number_of_replicas\"\ | ||
: 2\n }\n}" |
7 changes: 7 additions & 0 deletions
7
specification/indices/create/indicesCreateRequestExample2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
summary: Creates an index with mapping. | ||
# method_request: PUT /test | ||
description: You can provide mapping definitions in the create index API requests. | ||
# type: request | ||
value: | ||
"{\n \"settings\": {\n \"number_of_shards\": 1\n },\n \"mappings\": {\n\ | ||
\ \"properties\": {\n \"field1\": { \"type\": \"text\" }\n }\n }\n}" |
13 changes: 13 additions & 0 deletions
13
specification/indices/data_streams_stats/indicesDataStreamStatsResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# summary: '' | ||
description: A successful response for retrieving statistics for a data stream. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"_shards\": {\n \"total\": 10,\n \"successful\": 5,\n \"failed\"\ | ||
: 0\n },\n \"data_stream_count\": 2,\n \"backing_indices\": 5,\n \"total_store_size\"\ | ||
: \"7kb\",\n \"total_store_size_bytes\": 7268,\n \"data_streams\": [\n {\n\ | ||
\ \"data_stream\": \"my-data-stream\",\n \"backing_indices\": 3,\n \ | ||
\ \"store_size\": \"3.7kb\",\n \"store_size_bytes\": 3772,\n \"maximum_timestamp\"\ | ||
: 1607512028000\n },\n {\n \"data_stream\": \"my-data-stream-two\",\n\ | ||
\ \"backing_indices\": 2,\n \"store_size\": \"3.4kb\",\n \"store_size_bytes\"\ | ||
: 3496,\n \"maximum_timestamp\": 1607425567000\n }\n ]\n}" |
5 changes: 5 additions & 0 deletions
5
specification/indices/delete_data_lifecycle/IndicesDeleteDataLifecycleResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# summary: '' | ||
description: A successful response for deleting a data stream lifecycle. | ||
# type: response | ||
# response_code: 200 | ||
value: "{\n \"acknowledged\": true\n}" |
11 changes: 11 additions & 0 deletions
11
...ification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# summary: '' | ||
description: A successful response for retrieving data stream lifecycle status for a data stream backing index. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"indices\": {\n \".ds-metrics-2023.03.22-000001\": {\n \"index\"\ | ||
\ : \".ds-metrics-2023.03.22-000001\",\n \"managed_by_lifecycle\" : true,\n\ | ||
\ \"index_creation_date_millis\" : 1679475563571,\n \"time_since_index_creation\"\ | ||
\ : \"843ms\",\n \"rollover_date_millis\" : 1679475564293,\n \"time_since_rollover\"\ | ||
\ : \"121ms\",\n \"lifecycle\" : { },\n \"generation_time\" : \"121ms\"\ | ||
\n }\n}" |
10 changes: 10 additions & 0 deletions
10
specification/indices/get_data_lifecycle/IndicesGetDataLifecycleResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# summary: | ||
description: A successful response of getting the lifecycle of a set of data streams. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream-1\",\n \ | ||
\ \"lifecycle\": {\n \"enabled\": true,\n \"data_retention\":\ | ||
\ \"7d\"\n }\n },\n {\n \"name\": \"my-data-stream-2\",\n \"\ | ||
lifecycle\": {\n \"enabled\": true,\n \"data_retention\": \"7d\"\n\ | ||
\ }\n }\n ]\n}" |
32 changes: 32 additions & 0 deletions
32
specification/indices/get_data_stream/indicesGetDataStreamResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# summary: | ||
description: A successful response for retrieving information about a data stream. | ||
# type: response | ||
# response_code: 200 | ||
value: | ||
"{\n \"data_streams\": [\n {\n \"name\": \"my-data-stream\",\n \ | ||
\ \"timestamp_field\": {\n \"name\": \"@timestamp\"\n },\n \"\ | ||
indices\": [\n {\n \"index_name\": \".ds-my-data-stream-2099.03.07-000001\"\ | ||
,\n \"index_uuid\": \"xCEhwsp8Tey0-FLNFYVwSg\",\n \"prefer_ilm\"\ | ||
: true,\n \"ilm_policy\": \"my-lifecycle-policy\",\n \"managed_by\"\ | ||
: \"Index Lifecycle Management\"\n },\n {\n \"index_name\"\ | ||
: \".ds-my-data-stream-2099.03.08-000002\",\n \"index_uuid\": \"PA_JquKGSiKcAKBA8DJ5gw\"\ | ||
,\n \"prefer_ilm\": true,\n \"ilm_policy\": \"my-lifecycle-policy\"\ | ||
,\n \"managed_by\": \"Index Lifecycle Management\"\n }\n ],\n\ | ||
\ \"generation\": 2,\n \"_meta\": {\n \"my-meta-field\": \"foo\"\ | ||
\n },\n \"status\": \"GREEN\",\n \"next_generation_managed_by\":\ | ||
\ \"Index Lifecycle Management\",\n \"prefer_ilm\": true,\n \"template\"\ | ||
: \"my-index-template\",\n \"ilm_policy\": \"my-lifecycle-policy\",\n \ | ||
\ \"hidden\": false,\n \"system\": false,\n \"allow_custom_routing\":\ | ||
\ false,\n \"replicated\": false,\n \"rollover_on_write\": false\n \ | ||
\ },\n {\n \"name\": \"my-data-stream-two\",\n \"timestamp_field\"\ | ||
: {\n \"name\": \"@timestamp\"\n },\n \"indices\": [\n {\n\ | ||
\ \"index_name\": \".ds-my-data-stream-two-2099.03.08-000001\",\n \ | ||
\ \"index_uuid\": \"3liBu2SYS5axasRt6fUIpA\",\n \"prefer_ilm\": true,\n\ | ||
\ \"ilm_policy\": \"my-lifecycle-policy\",\n \"managed_by\": \"\ | ||
Index Lifecycle Management\"\n }\n ],\n \"generation\": 1,\n \ | ||
\ \"_meta\": {\n \"my-meta-field\": \"foo\"\n },\n \"status\"\ | ||
: \"YELLOW\",\n \"next_generation_managed_by\": \"Index Lifecycle Management\"\ | ||
,\n \"prefer_ilm\": true,\n \"template\": \"my-index-template\",\n \ | ||
\ \"ilm_policy\": \"my-lifecycle-policy\",\n \"hidden\": false,\n \"\ | ||
system\": false,\n \"allow_custom_routing\": false,\n \"replicated\":\ | ||
\ false,\n \"rollover_on_write\": false\n }\n ]\n}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# summary: | ||
description: A successful response for opening an index. | ||
# type: response | ||
# response_code: 200 | ||
value: "{\n \"acknowledged\" : true,\n \"shards_acknowledged\" : true\n}" |
5 changes: 5 additions & 0 deletions
5
specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequestExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: Set the data stream lifecycle retention | ||
# method_request: PUT _data_stream/my-data-stream/_lifecycle | ||
# description: Sets the lifecycle of a data stream. | ||
# type: request | ||
value: "{\n \"data_retention\": \"7d\"\n}" |
8 changes: 8 additions & 0 deletions
8
specification/indices/put_data_lifecycle/IndicesPutDataLifecycleRequestExample2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
summary: Set the data stream lifecycle downsampling | ||
# method_request: PUT _data_stream/my-weather-sensor-data-stream/_lifecycle | ||
description: This example configures two downsampling rounds. | ||
# type: request | ||
value: | ||
"{\n \"downsampling\": [\n {\n \"after\": \"1d\",\n \"\ | ||
fixed_interval\": \"10m\"\n },\n {\n \"after\": \"7d\",\n \ | ||
\ \"fixed_interval\": \"1d\"\n }\n ]\n}" |
5 changes: 5 additions & 0 deletions
5
specification/indices/put_data_lifecycle/IndicesPutDataLifecycleResponseExample1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# summary: | ||
description: A successful response for configuring a data stream lifecycle. | ||
# type: response | ||
# response_code: 200 | ||
value: "{\n \"acknowledged\": true\n}" |