更新工作流UpdateFlow
更新时间:2024-07-05
接口描述
- 本接口用于更新指定工作流。
请求结构
PUT /v1/flow HTTP/1.1
Host: xflow.bj.baidubce.com
Authorization: authorization string
Content-Type: application/json
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
name | string | 是 | Body参数 | 要更新的工作流的名字,最大长度: 128,最小长度: 1 |
type | string | 是 | Body参数 | 类型,当前为固定值"FDL" |
definition | string | 是 | Body参数 | 满足工作流语法规范的YAML定义,最大长度10000 |
description | string | 否 | Body参数 | 工作流描述信息,最大长度128 |
响应头域
除公共头域,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
name | string | 工作流的名称 |
workspaceId | string | 工作空间id |
type | string | 类型,当前为固定值"FDL" |
definition | string | 工作流YAML定义 |
description | string | 工作流描述信息 |
created_at | string | 工作流创建时间。ISO-8601格式 (YYYY-MM-DDThh:mm:ss.sTZD) |
updated_at | string | 工作流更新时间。ISO-8601格式 (YYYY-MM-DDThh:mm:ss.sTZD) |
请求示例
PUT /v1/flow HTTP/1.1
Host: xflow.bj.baidubce.com
Authorization: authorization string
{
"name":"testWorkFlow",
"description":"first WorkFlow",
"definition":"name: demo\nstart: initData\nstates:\n - type: pass\n name: initData\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: wait3s\n states:\n - type: wait\n name: wait3s\n seconds: 3\n end: true\n - start: invokeCfc\n states:\n - type: operation\n name: invokeCfc\n resource: \"brn:bce:cfc:bj:7c54a6e14823a11c:function:test:$LATEST\"\n end: true\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",
"type":"FDL"
}
响应示例
HTTP/1.1 200
Content-type: application/json
{
"name":"testWorkFlow",
"updated_at":"2021-12-27 22:44:52",
"description":"first WorkFlow",
"definition":"name: demo\nstart: initData\nstates:\n - type: pass\n name: initData\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: wait3s\n states:\n - type: wait\n name: wait3s\n seconds: 3\n end: true\n - start: invokeCfc\n states:\n - type: operation\n name: invokeCfc\n resource: \"brn:bce:cfc:bj:7c54a6e14823a11c:function:test:$LATEST\"\n end: true\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",
"created_at":"2021-12-27 12:20:27",
"workspaceId":"default",
"type":"FDL"
}