From e5282eb03e487e3cbb08cf758b98a40e34c8ed11 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 21 Mar 2024 07:44:28 -0700 Subject: [PATCH] Add documentation for optional param for get workflow step API (#6736) * Added documentaion for optional param for get workflow step API Signed-off-by: Owais Kazi * Addressed PR comment Signed-off-by: Owais Kazi * Doc review Signed-off-by: Fanit Kolchina * Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --------- Signed-off-by: Owais Kazi Signed-off-by: Fanit Kolchina Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Fanit Kolchina Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Nathan Bower --- .../api/get-workflow-steps.md | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/_automating-configurations/api/get-workflow-steps.md b/_automating-configurations/api/get-workflow-steps.md index b2d1f9bf4f..38059ec80c 100644 --- a/_automating-configurations/api/get-workflow-steps.md +++ b/_automating-configurations/api/get-workflow-steps.md @@ -7,7 +7,7 @@ nav_order: 50 # Get workflow steps -OpenSearch validates workflows by using the validation template that lists the required inputs, generated outputs, and required plugins for all steps. For example, for the `register_remote_model` step, the validation template appears as follows: +This API returns a list of workflow steps, including their required inputs, outputs, default timeout values, and required plugins. For example, for the `register_remote_model` step, the Get Workflow Steps API returns the following information: ```json { @@ -25,36 +25,52 @@ OpenSearch validates workflows by using the validation template that lists the r ] } } -``` - -The Get Workflow Steps API retrieves this file. +``` ## Path and HTTP methods ```json GET /_plugins/_flow_framework/workflow/_steps +GET /_plugins/_flow_framework/workflow/_step?workflow_step= ``` +## Query parameters + +The following table lists the available query parameters. All query parameters are optional. + +| Parameter | Data type | Description | +| :--- | :--- | :--- | +| `workflow_step` | String | The name of the step to retrieve. Specify multiple step names as a comma-separated list. For example, `create_connector,delete_model,deploy_model`. | + #### Example request +To fetch all workflow steps, use the following request: + ```json GET /_plugins/_flow_framework/workflow/_steps +``` +{% include copy-curl.html %} + +To fetch specific workflow steps, pass the step names to the request as a query parameter: + +```json +GET /_plugins/_flow_framework/workflow/_step?workflow_step=create_connector,delete_model,deploy_model ``` {% include copy-curl.html %} #### Example response -OpenSearch responds with the validation template containing the steps. The order of fields in the returned steps may not exactly match the original JSON but will function identically. +OpenSearch responds with the workflow steps. The order of fields in the returned steps may not exactly match the original JSON but will function identically. To retrieve the template in YAML format, specify `Content-Type: application/yaml` in the request header: ```bash -curl -XGET "http://localhost:9200/_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50" -H 'Content-Type: application/yaml' +curl -XGET "http://localhost:9200/_plugins/_flow_framework/workflow/_steps" -H 'Content-Type: application/yaml' ``` To retrieve the template in JSON format, specify `Content-Type: application/json` in the request header: ```bash -curl -XGET "http://localhost:9200/_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50" -H 'Content-Type: application/json' +curl -XGET "http://localhost:9200/_plugins/_flow_framework/workflow/_steps" -H 'Content-Type: application/json' ``` \ No newline at end of file