From f8e0fa5689173e9211d79185a4e8890cc6af4179 Mon Sep 17 00:00:00 2001 From: Daniel Widdis Date: Wed, 12 Jun 2024 08:21:52 -0700 Subject: [PATCH] Document optional clear_status query parameter for Delete Workflow API (#7268) * Document optional clear_status query parameter for Delete Workflow API Signed-off-by: Daniel Widdis * Update _automating-configurations/api/delete-workflow.md Co-authored-by: Owais Kazi Signed-off-by: Daniel Widdis * Update _automating-configurations/api/delete-workflow.md Co-authored-by: Owais Kazi Signed-off-by: Daniel Widdis * Address code review comments Signed-off-by: Daniel Widdis * Address code review comments Signed-off-by: Daniel Widdis --------- Signed-off-by: Daniel Widdis Co-authored-by: Owais Kazi --- .../api/delete-workflow.md | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/_automating-configurations/api/delete-workflow.md b/_automating-configurations/api/delete-workflow.md index db3a340cee..13cd5ae5dc 100644 --- a/_automating-configurations/api/delete-workflow.md +++ b/_automating-configurations/api/delete-workflow.md @@ -7,9 +7,11 @@ nav_order: 80 # Delete a workflow -When you no longer need a workflow template, you can delete it by calling the Delete Workflow API. +When you no longer need a workflow template, you can delete it by calling the Delete Workflow API. -Note that deleting a workflow only deletes the stored template but does not deprovision its resources. +Note that deleting a workflow only deletes the stored template---it does not deprovision its resources. + +When a workflow is deleted, its corresponding status (returned by the [Workflow State API]({{site.url}}{{site.baseurl}}/automating-configurations/api/get-workflow-status/)) is also deleted unless either the provisioning status is `IN_PROGRESS` or resources have been provisioned. ## Path and HTTP methods @@ -25,13 +27,26 @@ The following table lists the available path parameters. | :--- | :--- | :--- | | `workflow_id` | String | The ID of the workflow to be retrieved. Required. | +## Query parameters + +The following table lists the available query parameters. All query parameters are optional. + +| Parameter | Data type | Description | +| :--- | :--- | :--- | +| `clear_status` | Boolean | Determines whether to delete the workflow state (without deprovisioning resources) after deleting the template. OpenSearch deletes the workflow state only if the provisioning status is not `IN_PROGRESS`. Default is `false`. | + #### Example request -``` +```json DELETE /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50 ``` {% include copy-curl.html %} +```json +DELETE /_plugins/_flow_framework/workflow/8xL8bowB8y25Tqfenm50?clear_status=true +``` +{% include copy-curl.html %} + #### Example response If the workflow exists, a delete response contains the status of the deletion, where the `result` field is set to `deleted` on success or `not_found` if the workflow does not exist (it may have already been deleted): @@ -50,4 +65,4 @@ If the workflow exists, a delete response contains the status of the deletion, w "_seq_no": 2, "_primary_term": 1 } -``` \ No newline at end of file +```