Skip to content

Commit de6ddfa

Browse files
szabostevelcawl
authored andcommitted
Adds ingest API request and response examples (#2996)
Co-authored-by: Lisa Cawley <[email protected]> (cherry picked from commit 2045505)
1 parent adcd1b1 commit de6ddfa

File tree

6 files changed

+93
-1
lines changed

6 files changed

+93
-1
lines changed

docs/overlays/elasticsearch-shared-overlays.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,4 +1257,40 @@ actions:
12571257
application/json:
12581258
examples:
12591259
indicesExplainDataLifecycleResponseExample:
1260-
$ref: "../../specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponseExample1.yaml"
1260+
$ref: "../../specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponseExample1.yaml"
1261+
- target: "$.components['responses']['ingest.get_pipeline#200']"
1262+
description: "Add example for get pipeline response"
1263+
update:
1264+
content:
1265+
application/json:
1266+
examples:
1267+
indicesGetDataStreamResponseExample:
1268+
$ref: "../../specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml"
1269+
- target: "$.paths['/_ingest/pipeline/{id}']['put']"
1270+
description: "Add examples for create pipeline"
1271+
update:
1272+
requestBody:
1273+
content:
1274+
application/json:
1275+
examples:
1276+
putPipelineRequestExample1:
1277+
$ref: "../../specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml"
1278+
putPipelineRequestExample2:
1279+
$ref: "../../specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml"
1280+
- target: "$.components['requestBodies']['ingest.simulate']"
1281+
description: "Add example for simulate pipeline request"
1282+
update:
1283+
content:
1284+
application/json:
1285+
examples:
1286+
simulatePipelineRequestExample1:
1287+
$ref: "../../specification/ingest/simulate/SimulatePipelineRequestExample1.yaml"
1288+
- target: "$.components['responses']['ingest.simulate#200']"
1289+
description: "Add example for simulate pipeline response"
1290+
update:
1291+
content:
1292+
application/json:
1293+
examples:
1294+
simulatePipelineResponseExample1:
1295+
$ref: "../../specification/ingest/simulate/SimulatePipelineResponseExample1.yaml"
1296+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
summary: A successful response for retrieving information about an ingest pipeline.
2+
# description: ''
3+
# type: response
4+
# response_code: 200
5+
value:
6+
"{\n \"my-pipeline-id\" : {\n \"description\" : \"describe pipeline\",\n\
7+
\ \"version\" : 123,\n \"processors\" : [\n {\n \"set\" : {\n\
8+
\ \"field\" : \"foo\",\n \"value\" : \"bar\"\n }\n \
9+
\ }\n ]\n }\n}"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
summary: Create an ingest pipeline.
2+
# method_request: PUT _ingest/pipeline/my-pipeline-id
3+
# description: ''
4+
# type: request
5+
value:
6+
"{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\
7+
\ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\
8+
\ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\
9+
foo\"\n }\n }\n ]\n}"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
summary: Create an ingest pipeline with metadata.
2+
# method_request: PUT /_ingest/pipeline/my-pipeline-id
3+
description: You can use the `_meta` parameter to add arbitrary metadata to a pipeline.
4+
type: request
5+
value:
6+
"{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\
7+
\ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\
8+
\ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\
9+
foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field\
10+
\ to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"\
11+
id\": 10\n }\n }\n}"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
summary: Run an ingest pipeline against a set of provided documents.
2+
# method_request: POST /_ingest/pipeline/_simulate
3+
description: You can specify the used pipeline either in the request body or as a path parameter.
4+
# type: request
5+
value:
6+
"{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\"\
7+
: [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \
8+
\ \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n\
9+
\ \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \
10+
\ \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n\
11+
\ \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n\
12+
\ }\n ]\n}"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
summary: A successful response for running an ingest pipeline against a set of provided documents.
2+
# description: ''
3+
# type: response
4+
# response_code: 200
5+
value:
6+
"{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"id\"\
7+
,\n \"_index\": \"index\",\n \"_version\": \"-3\",\n \
8+
\ \"_source\": {\n \"field2\": \"_value\",\n \"\
9+
foo\": \"bar\"\n },\n \"_ingest\": {\n \"timestamp\"\
10+
: \"2017-05-04T22:30:03.187Z\"\n }\n }\n },\n {\n \
11+
\ \"doc\": {\n \"_id\": \"id\",\n \"_index\": \"index\"\
12+
,\n \"_version\": \"-3\",\n \"_source\": {\n \
13+
\ \"field2\": \"_value\",\n \"foo\": \"rab\"\n },\n \
14+
\ \"_ingest\": {\n \"timestamp\": \"2017-05-04T22:30:03.188Z\"\
15+
\n }\n }\n }\n ]\n}"

0 commit comments

Comments
 (0)