停止执行StopExecution
更新时间:2024-07-05
接口描述
- 本接口用于用户停止执行工作流。
请求结构
POST /v1/execution/stop HTTP/1.1
Host: xflow.bj.baidubce.com
Authorization: authorization string
Content-Type: application/json
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必须 | 参数位置 | 描述 |
---|---|---|---|---|
flowName | string | 是 | Body参数 | 工作流名称 |
executionName | string | 是 | Body参数 | 执行工作流的名称 |
响应头域
除公共头域,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
input | string | 执行的输入数据 |
output | string | 执行的输出信息,若还未执行完则为空字符串 |
startedTime | int | 执行的开始时间戳 |
stoppedTime | int | 执行的结束时间戳,若未执行完则为0 |
flowName | string | 执行所属的工作流的名称 |
name | string | 执行的名称 |
status | string | 执行的状态,可能的值有Fail/Succeed/Running/Stopped/Timeout |
flowDefinition | string | 执行的工作流的定义 |
请求示例
POST /v1/execution/stop HTTP/1.1
Authorization: Authorization string
Host: xflow.bj.baidubce.com
{
"flowName":"comb-test",
"executionName":"run_WorkFlow"
}
响应示例
HTTP/1.1 200
Content-type: application/json
{
"flowDefinition":"\nname: demo\nstart: makeData\nstates:\n - type: pass\n name: makeData\n data:\n hello: world\n next: demoSwitch\n - type: switch\n name: demoSwitch\n description: \"using jq expression to decide whether to exec demo\"\n conditions:\n - condition: .execDemo == true\n next: startExec\n - condition: .execDemo == false\n next: stop\n default:\n next: startExec\n - type: parallel\n name: startExec\n next: succ\n branches:\n - start: wait1s\n states:\n - type: wait\n name: wait1s\n seconds: 1\n next: throwSucceed \n - type: succeed\n name: throwSucceed\n - start: wait3s\n states:\n - type: wait\n name: wait3s\n seconds: 3\n next: invokeCfc\n - type: operation\n name: invokeCfc\n resource: \"brn:bce:cfc:bj:7c54a6e14823a11c:function:test:$LATEST\"\n end: true\n retry:\n - errors:\n - XFlow.ALL\n intervalSeconds: 2\n maxAttempts: 1 \n catch:\n - errors:\n - XFlow.ALL\n next: errorHandler\n - type: pass\n name: errorHandler\n end: true\n - type: fail\n name: stop\n cause: \"stop demo\"\n - type: succeed\n name: succ",
"flowName":"comb-test",
"input":"{\"execDemo\":true}",
"name":"test",
"output":"",
"startedTime":1640608416307,
"status":"Running",
"stoppedTime":0
}