From 44ce2a0bc20eed002b322ba152f08580c71533a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Oct 2024 15:31:02 +0200 Subject: [PATCH 1/5] Adds ingest API request and response examples. --- .../get_pipeline/GetPipelineResponseExample1.yaml | 8 ++++++++ .../put_pipeline/PutPipelineRequestExample1.yaml | 8 ++++++++ .../put_pipeline/PutPipelineRequestExample2.yaml | 10 ++++++++++ .../SimulatePipelineRequestRequestExample1.yaml | 11 +++++++++++ .../simulate/SimulatePipelineResponseExample1.yaml | 14 ++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml create mode 100644 specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml create mode 100644 specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml create mode 100644 specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml create mode 100644 specification/ingest/simulate/SimulatePipelineResponseExample1.yaml diff --git a/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml b/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml new file mode 100644 index 0000000000..81374e4fad --- /dev/null +++ b/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml @@ -0,0 +1,8 @@ +summary: A successful response for retrieving information about an ingest pipeline. +# description: '' +# type: response +# response_code: 200 +value: "{\n \"my-pipeline-id\" : {\n \"description\" : \"describe pipeline\",\n\ + \ \"version\" : 123,\n \"processors\" : [\n {\n \"set\" : {\n\ + \ \"field\" : \"foo\",\n \"value\" : \"bar\"\n }\n \ + \ }\n ]\n }\n}" diff --git a/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml b/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml new file mode 100644 index 0000000000..9ef945ea38 --- /dev/null +++ b/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml @@ -0,0 +1,8 @@ +summary: Create an ingest pipeline. +# method_request: PUT _ingest/pipeline/my-pipeline-id +# description: '' +# type: request +value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ + \ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\ + \ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\ + foo\"\n }\n }\n ]\n}" diff --git a/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml new file mode 100644 index 0000000000..ab5d9f8f08 --- /dev/null +++ b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml @@ -0,0 +1,10 @@ +summary: Creates an ingest pipeline. +# method_request: PUT /_ingest/pipeline/my-pipeline-id +description: You can use the `_meta` parameter to add arbitrary metadata to a pipeline. +type: request +value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ + \ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\ + \ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\ + foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field\ + \ to foo\",\n \"serialization\": {\n \"class\": \"MyPipeline\",\n \"\ + id\": 10\n }\n }\n}" diff --git a/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml b/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml new file mode 100644 index 0000000000..6c5bb844fc --- /dev/null +++ b/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml @@ -0,0 +1,11 @@ +summary: Run an ingest pipeline against a set of provided documents. +# method_request: POST /_ingest/pipeline/_simulate +description: You can specify the used pipeline either in the request body or as a path parameter. +# type: request +value: "{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\"\ + : [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \ + \ \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n\ + \ \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \ + \ \"foo\": \"bar\"\n }\n },\n {\n \"_index\": \"index\",\n\ + \ \"_id\": \"id\",\n \"_source\": {\n \"foo\": \"rab\"\n }\n\ + \ }\n ]\n}" diff --git a/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml b/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml new file mode 100644 index 0000000000..985b02ea8a --- /dev/null +++ b/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml @@ -0,0 +1,14 @@ +summary: A successful response for running an ingest pipeline against a set of provided documents. +# description: '' +# type: response +# response_code: 200 +value: "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"id\"\ + ,\n \"_index\": \"index\",\n \"_version\": \"-3\",\n \ + \ \"_source\": {\n \"field2\": \"_value\",\n \"\ + foo\": \"bar\"\n },\n \"_ingest\": {\n \"timestamp\"\ + : \"2017-05-04T22:30:03.187Z\"\n }\n }\n },\n {\n \ + \ \"doc\": {\n \"_id\": \"id\",\n \"_index\": \"index\"\ + ,\n \"_version\": \"-3\",\n \"_source\": {\n \ + \ \"field2\": \"_value\",\n \"foo\": \"rab\"\n },\n \ + \ \"_ingest\": {\n \"timestamp\": \"2017-05-04T22:30:03.188Z\"\ + \n }\n }\n }\n ]\n}" From 59996e05e1e977cd5f865db8c97acc1e75125dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Oct 2024 15:34:41 +0200 Subject: [PATCH 2/5] Fixes formatting. --- .../ingest/get_pipeline/GetPipelineResponseExample1.yaml | 3 ++- .../ingest/put_pipeline/PutPipelineRequestExample1.yaml | 3 ++- .../ingest/put_pipeline/PutPipelineRequestExample2.yaml | 3 ++- .../simulate/SimulatePipelineRequestRequestExample1.yaml | 3 ++- .../ingest/simulate/SimulatePipelineResponseExample1.yaml | 5 +++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml b/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml index 81374e4fad..36dad4236d 100644 --- a/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml +++ b/specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml @@ -2,7 +2,8 @@ summary: A successful response for retrieving information about an ingest pipeli # description: '' # type: response # response_code: 200 -value: "{\n \"my-pipeline-id\" : {\n \"description\" : \"describe pipeline\",\n\ +value: + "{\n \"my-pipeline-id\" : {\n \"description\" : \"describe pipeline\",\n\ \ \"version\" : 123,\n \"processors\" : [\n {\n \"set\" : {\n\ \ \"field\" : \"foo\",\n \"value\" : \"bar\"\n }\n \ \ }\n ]\n }\n}" diff --git a/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml b/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml index 9ef945ea38..3a3870ce01 100644 --- a/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml +++ b/specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml @@ -2,7 +2,8 @@ summary: Create an ingest pipeline. # method_request: PUT _ingest/pipeline/my-pipeline-id # description: '' # type: request -value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ +value: + "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ \ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\ \ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\ foo\"\n }\n }\n ]\n}" diff --git a/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml index ab5d9f8f08..50e8131630 100644 --- a/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml +++ b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml @@ -2,7 +2,8 @@ summary: Creates an ingest pipeline. # method_request: PUT /_ingest/pipeline/my-pipeline-id description: You can use the `_meta` parameter to add arbitrary metadata to a pipeline. type: request -value: "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ +value: + "{\n \"description\" : \"My optional pipeline description\",\n \"processors\"\ \ : [\n {\n \"set\" : {\n \"description\" : \"My optional processor\ \ description\",\n \"field\": \"my-keyword-field\",\n \"value\": \"\ foo\"\n }\n }\n ],\n \"_meta\": {\n \"reason\": \"set my-keyword-field\ diff --git a/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml b/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml index 6c5bb844fc..40d368cd69 100644 --- a/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml +++ b/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml @@ -2,7 +2,8 @@ summary: Run an ingest pipeline against a set of provided documents. # method_request: POST /_ingest/pipeline/_simulate description: You can specify the used pipeline either in the request body or as a path parameter. # type: request -value: "{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\"\ +value: + "{\n \"pipeline\" :\n {\n \"description\": \"_description\",\n \"processors\"\ : [\n {\n \"set\" : {\n \"field\" : \"field2\",\n \ \ \"value\" : \"_value\"\n }\n }\n ]\n },\n \"docs\": [\n {\n\ \ \"_index\": \"index\",\n \"_id\": \"id\",\n \"_source\": {\n \ diff --git a/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml b/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml index 985b02ea8a..5a8077a5bd 100644 --- a/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml +++ b/specification/ingest/simulate/SimulatePipelineResponseExample1.yaml @@ -1,8 +1,9 @@ -summary: A successful response for running an ingest pipeline against a set of provided documents. +summary: A successful response for running an ingest pipeline against a set of provided documents. # description: '' # type: response # response_code: 200 -value: "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"id\"\ +value: + "{\n \"docs\": [\n {\n \"doc\": {\n \"_id\": \"id\"\ ,\n \"_index\": \"index\",\n \"_version\": \"-3\",\n \ \ \"_source\": {\n \"field2\": \"_value\",\n \"\ foo\": \"bar\"\n },\n \"_ingest\": {\n \"timestamp\"\ From fe969da881ffeb0ba59e3ad549863473efbb7907 Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 9 Dec 2024 16:49:32 -0800 Subject: [PATCH 3/5] Add example overlays --- .../elasticsearch-shared-overlays.yaml | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index 9078350407..4b75953716 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1257,4 +1257,40 @@ actions: application/json: examples: indicesExplainDataLifecycleResponseExample: - $ref: "../../specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponseExample1.yaml" \ No newline at end of file + $ref: "../../specification/indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponseExample1.yaml" + - target: "$.components['responses']['ingest.get_pipeline#200']" + description: "Add example for get pipeline response" + update: + content: + application/json: + examples: + indicesGetDataStreamResponseExample: + $ref: "../../specification/ingest/get_pipeline/GetPipelineResponseExample1.yaml" + - target: "$.paths['/_ingest/pipeline/{id}']['put']" + description: "Add examples for create pipeline" + update: + requestBody: + content: + application/json: + examples: + putPipelineRequestExample1: + $ref: "../../specification/ingest/put_pipeline/PutPipelineRequestExample1.yaml" + putPipelineRequestExample2: + $ref: "../../specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml" + - target: "$.components['requestBodies']['ingest.simulate']" + description: "Add example for simulate pipeline request" + update: + content: + application/json: + examples: + simulatePipelineRequestExample1: + $ref: "../../specification/ingest/simulate/SimulatePipelineRequestExample1.json" + - target: "$.components['responses']['ingest.simulate#200']" + description: "Add example for simulate pipeline response" + update: + content: + application/json: + examples: + simulatePipelineResponseExample1: + $ref: "../../specification/ingest/simulate/SimulatePipelineResponseExample1.json" + \ No newline at end of file From 892609c30c7d0a92163e7289ddf6c41fe11c180a Mon Sep 17 00:00:00 2001 From: lcawl Date: Mon, 9 Dec 2024 16:57:37 -0800 Subject: [PATCH 4/5] Fix filename --- docs/overlays/elasticsearch-shared-overlays.yaml | 4 ++-- ...uestExample1.yaml => SimulatePipelineRequestExample1.yaml} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename specification/ingest/simulate/{SimulatePipelineRequestRequestExample1.yaml => SimulatePipelineRequestExample1.yaml} (100%) diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index 4b75953716..956e964df1 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1284,7 +1284,7 @@ actions: application/json: examples: simulatePipelineRequestExample1: - $ref: "../../specification/ingest/simulate/SimulatePipelineRequestExample1.json" + $ref: "../../specification/ingest/simulate/SimulatePipelineRequestExample1.yaml" - target: "$.components['responses']['ingest.simulate#200']" description: "Add example for simulate pipeline response" update: @@ -1292,5 +1292,5 @@ actions: application/json: examples: simulatePipelineResponseExample1: - $ref: "../../specification/ingest/simulate/SimulatePipelineResponseExample1.json" + $ref: "../../specification/ingest/simulate/SimulatePipelineResponseExample1.yaml" \ No newline at end of file diff --git a/specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml b/specification/ingest/simulate/SimulatePipelineRequestExample1.yaml similarity index 100% rename from specification/ingest/simulate/SimulatePipelineRequestRequestExample1.yaml rename to specification/ingest/simulate/SimulatePipelineRequestExample1.yaml From 0226877b6be5bb8bd57ecdf427bdcdf3783fa3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 10 Dec 2024 09:48:51 +0100 Subject: [PATCH 5/5] Update specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml Co-authored-by: Lisa Cawley --- .../ingest/put_pipeline/PutPipelineRequestExample2.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml index 50e8131630..a36e912842 100644 --- a/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml +++ b/specification/ingest/put_pipeline/PutPipelineRequestExample2.yaml @@ -1,4 +1,4 @@ -summary: Creates an ingest pipeline. +summary: Create an ingest pipeline with metadata. # method_request: PUT /_ingest/pipeline/my-pipeline-id description: You can use the `_meta` parameter to add arbitrary metadata to a pipeline. type: request