Skip to content

Commit d961f5d

Browse files
Adds ingest API request and response examples (#2996) (#3269)
Co-authored-by: Lisa Cawley <[email protected]> (cherry picked from commit 2045505) Co-authored-by: István Zoltán Szabó <[email protected]>
1 parent 3729e43 commit d961f5d

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed
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)