Cancel workflow rerun¶
Request to cancel a workflow and rerun the branch. A successful request does not mean that the branch has been stopped. Please read the return status to confirm the actual status.
POST $CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/{workflow_id}/executions/{execution_id}/reruns/{rerun_id}/cancel
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the workflow rerun details and confirm that the branch currently allows cancellation. Prepare personal access token and target workspace ID that can access the target workspace.
Confirm that the current identity has permission to run the workflow.
Request body¶
Replace $WORKFLOW_ID, $EXECUTION_ID, $RERUN_ID, $CLOUDSIGMA_API_KEY, $WORKSPACE_ID in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workflow/v2/workflow-apps/$WORKFLOW_ID/executions/$EXECUTION_ID/reruns/$RERUN_ID/cancel" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
workflow ID, located in the request path. |
|
string |
Yes |
Source job ID, located in the request path. |
|
string |
Yes |
Rerun ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string or null |
No |
Custom reasons are currently being received but not saved. |
reason is an optional field received by the current interface, but is not used to save custom reasons. This cannot be used to determine that the reason for cancellation or rerun has been recorded.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"rerun": {
"rerun_id": "rerun-001",
"branch_id": "branch-001",
"case_id": "",
"source_execution_id": "exec-001",
"mode": "rerun_current_and_downstream",
"status": "cancelled"
}
}
}
Field |
Type |
Description |
|---|---|---|
|
object |
Rerun branch information. |
|
string |
Rerun plan ID. |
|
string |
Rerun branch ID. |
|
string |
Run ID. |
|
string |
Source branch ID. |
|
string |
New workflow execution ID. |
|
string |
Source execution ID. |
|
string |
Source run ID. |
|
string |
Node key. |
|
string |
Source node execution ID. |
|
string |
processing mode. Value: |
|
string |
status. Values: |
|
string |
error message. |
|
string |
Creation time. |
|
string |
Update time. |
|
string |
Startup error. |
|
string |
Refresh error. |
Query workflow rerun details to confirm the final status.
Error response¶
When the target does not exist, has a status conflict, or the service fails, HTTP 404, 409, and 500 may be returned respectively.
The business error response does not contain data.
{
"code": "ErrNotFound",
"msg": "资源不存在"
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Readable error message. |