创建函数流 -j9九游会登录
功能介绍
创建函数流
调用方法
请参见。
授权信息
账号具备所有api的调用权限,如果使用账号下的iam用户调用当前api,该iam用户需具备调用api所需的权限,具体权限要求请参见权限和授权项。
uri
post /v1/{project_id}/ffs/graphs
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
string |
参数解释: 租户项目 id,获取方式请参见获取项目id。 约束限制: 不涉及。 取值范围: 只能由英文字母、数字组成,且长度为32个字符 默认取值: 不涉及。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
x-cloud-service |
否 |
string |
用户标签 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
id |
否 |
string |
流程定义id |
|
name |
否 |
string |
名字 |
|
description |
否 |
string |
描述 |
|
nodes |
否 |
array of graphnode objects |
nodes |
|
edges |
否 |
array of graphedge objects |
edges |
|
constants |
否 |
string |
constants |
|
label |
否 |
string |
label |
|
enterprise_project_id |
否 |
string |
enterprise_project_id |
|
merge_params |
否 |
boolean |
merge_params |
|
mode |
否 |
string |
mode |
|
enable_stream_response |
否 |
boolean |
是否返回流数据 |
|
express_config |
否 |
expressconfig object |
参数解释: functiongraph工作流快速工作流配置项。 约束限制: 快速函数流模式配置,当mode为express时需要设置。 取值范围: 不涉及。 默认取值: 不涉及。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
id |
否 |
string |
id |
|
name |
否 |
string |
名称 |
|
category |
否 |
string |
种类 |
|
description |
否 |
string |
描述 |
|
parent_node |
否 |
string |
parent_node |
|
shape |
否 |
shape object |
shape |
|
position_x |
否 |
integer |
position_x |
|
position_y |
否 |
integer |
position_y |
|
execution_id |
否 |
string |
流程节点执行id |
|
incoming_edges |
否 |
array of strings |
incoming_edges |
|
outgoing_edges |
否 |
array of strings |
outgoing_edges |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
id |
否 |
string |
id |
|
from |
否 |
string |
from |
|
to |
否 |
string |
to |
|
label |
否 |
string |
label |
|
shape |
否 |
shape object |
shape |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
geometry |
否 |
string |
geometry |
|
style |
否 |
string |
style |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
log_level |
否 |
string |
参数解释: 日志级别 取值范围:
|
响应参数
状态码:201
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
string |
流程定义id |
|
name |
string |
名字 |
|
description |
string |
描述 |
|
nodes |
array of graphnode objects |
nodes |
|
edges |
array of graphedge objects |
edges |
|
domain_name |
string |
domain_name |
|
domain_id |
string |
domain_id |
|
project_id |
string |
project_id |
|
workflow_id |
string |
workflow_id |
|
workflow_run_id |
string |
workflow_run_id |
|
created |
string |
创建时间,格式:yyyy-mm-ddthh:mm:ssz,utc时间 |
|
updated |
string |
更新时间,格式:yyyy-mm-ddthh:mm:ssz,utc时间 |
|
task_status |
string |
task_status |
|
error_info |
operateerrorresponse object |
operateerrorresponse |
|
workflow_urn |
string |
workflow_urn |
|
workflow_definition |
workflowcreatebody object |
参数解释: functiongraph工作流创建body体 取值范围: 不涉及。 |
|
constants |
string |
constants |
|
label |
string |
label |
|
privilege |
string |
privilege |
|
enterprise_project_id |
string |
enterprise_project_id |
|
merge_params |
boolean |
merge_params |
|
mode |
string |
mode |
|
express_config |
expressconfig object |
参数解释: functiongraph工作流快速工作流配置项。 约束限制: 快速函数流模式配置,当mode为express时需要设置。 取值范围: 不涉及。 默认取值: 不涉及。 |
|
lts_group_id |
string |
lts_group_id |
|
lts_stream_id |
string |
lts_stream_id |
|
enable_stream_response |
boolean |
是否返回流数据 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
string |
id |
|
name |
string |
名称 |
|
category |
string |
种类 |
|
description |
string |
描述 |
|
parent_node |
string |
parent_node |
|
shape |
shape object |
shape |
|
position_x |
integer |
position_x |
|
position_y |
integer |
position_y |
|
execution_id |
string |
流程节点执行id |
|
incoming_edges |
array of strings |
incoming_edges |
|
outgoing_edges |
array of strings |
outgoing_edges |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
string |
id |
|
from |
string |
from |
|
to |
string |
to |
|
label |
string |
label |
|
shape |
shape object |
shape |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
geometry |
string |
geometry |
|
style |
string |
style |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
graph_id |
string |
graph_id |
|
error_detail |
string |
error_detail |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
name |
string |
参数解释: functiongraph工作流名称。 约束限制: ^([_a-za-z0-9().-]|[\u4e00-\u9fa5]){1,64}$ 取值范围: [1, 64] 默认取值: 不涉及。 |
|
description |
string |
参数解释: functiongraph工作流描述。 约束限制: ^([_a-za-z0-9().-]|[\u4e00-\u9fa5]){1,512}$ 取值范围: [1, 512] 默认取值: 不涉及。 |
|
start |
string |
参数解释: functiongraph工作流开始节点id。 约束限制: 不涉及。 取值范围: [1, 256] 默认取值: 不涉及。 |
|
triggers |
array of trigger objects |
参数解释: functiongraph工作流触发器列表。 约束限制: 不涉及。 取值范围: [0, 200] 默认取值: 不涉及。 |
|
functions |
array of function objects |
参数解释: functiongraph工作流函数列表。 约束限制: 不涉及。 取值范围: [0, 100] 默认取值: 不涉及。 |
|
states |
array of operationstate objects |
参数解释: functiongraph工作流节点列表。 约束限制: 不涉及。 取值范围: [1, 100] 默认取值: 不涉及。 |
|
constants |
object |
参数解释: functiongraph工作流常量。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
|
retries |
array of retry objects |
参数解释: functiongraph工作流重试策略列表。 约束限制: 不涉及。 取值范围: [0, 200] 默认取值: 不涉及。 |
|
mode |
string |
参数解释: functiongraph工作流模式,默认标准模式。 约束限制: 不涉及。 取值范围:
默认取值: normal |
|
express_config |
expressconfig object |
参数解释: 快速函数流模式配置,当mode为express时需要设置。 |
|
enterprise_project_id |
string |
参数解释: functiongraph工作流企业项目。 约束限制: 不涉及。 取值范围: [0, 64] 默认取值: 不涉及。 |
|
enable_stream_response |
boolean |
参数解释: functiongraph工作流是否支持流式返回。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: false |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
trigger_name |
string |
参数解释: 触发器名称 取值范围: 不涉及。 |
|
trigger_type |
string |
参数解释 触发器类型 取值范围
|
|
enabled |
boolean |
参数解释: 是否启用触发器 取值范围: 不涉及。 |
|
trigger_config |
obstriggerconfig object |
参数解释: obs触发器配置 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
bucket |
string |
参数解释: obs桶名 取值范围: 不涉及。 |
|
events |
array of strings |
参数解释: obs事件列表 取值范围: 不涉及。 |
|
prefix |
string |
参数解释: obs对象名前缀 取值范围: 不涉及。 |
|
suffix |
string |
参数解释: obs对象名后缀 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
name |
string |
参数解释: 函数名称,在单个流程中,名称需要唯一 取值范围: 不涉及。 |
|
operation |
string |
参数解释: 函数调用urn 取值范围: 不涉及。 |
|
metadata |
object |
参数解释: 函数扩展信息, 由用户自己定制。 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
action_mode |
string |
参数解释: 节点执行模式 取值范围:
|
|
actions |
array of action objects |
参数解释: 节点执行操作列表 取值范围: 不涉及。 |
|
on_errors |
array of onerror objects |
参数解释: 节点执行错误处理策略列表 取值范围: 不涉及。 |
|
id |
string |
参数解释: 节点id, 工作流中唯一 取值范围: 不涉及。 |
|
name |
string |
参数解释: 节点名称 取值范围: 不涉及。 |
|
type |
string |
参数解释: 节点类型表 取值范围:
|
|
end |
boolean |
参数解释: 是否是结束节点 取值范围: 不涉及。 |
|
transition |
string |
参数解释: 下一节点id 取值范围: 不涉及。 |
|
state_data_filter |
statedatafilter object |
参数解释: 过滤表达式 取值范围: 不涉及。 |
|
duration |
long |
参数解释: 时间等待节点等待时间(秒),节点类型为sleep时为必填,节点类型不为sleep时无效 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
function_ref |
functionref object |
参数解释: 函数调用信息 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
ref_name |
string |
参数解释: 函数引用名称, 需要和外层functions中的name对应 取值范围: 不涉及。 |
|
invoke_mode |
string |
参数解释: 函数调用模式, 目前只支持同步调用 取值范围:
|
|
arguments |
object |
参数解释 函数执行时的入参,支持引用constants中的常量 定义方式:参数路径 | 常量值/常量路径 参数路径指输入参数的jsonpath路径,如$.a.b[0].c 常量值可以为数字类型,字符串类型(需要用单引号括起来),布尔类型 常量路径为常量的jsonpath路径,但是根节点需要用$const表示,示例:$const.a.b 取值范围 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error |
string |
参数解释: 错误匹配表达式,用来过滤需要处理的异常 取值范围: 不涉及。 |
|
transition |
string |
参数解释: 下一步骤节点id 取值范围: 不涉及。 |
|
retry_ref |
string |
参数解释: 重试策略名称 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
input |
string |
参数解释: 输入过滤表达式(jsonpath) 取值范围: 不涉及。 |
|
output |
string |
参数解释: 输出过滤表达式(jsonpath) 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
name |
string |
参数解释: 重试策略名称,在单个流程中,名称需要唯一。 取值范围: 不涉及。 |
|
delay |
long |
参数解释: 重试间隔,单位:秒。若不传,默认为1。 取值范围: 不涉及。 |
|
max_attempts |
long |
参数解释: 最大重试次数,若不传,默认为3。 取值范围: 不涉及。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
log_level |
string |
参数解释: 日志级别 取值范围:
|
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
string |
错误码 |
|
error_msg |
string |
错误描述 |
|
request_id |
string |
请求id |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
string |
错误码 |
|
error_msg |
string |
错误描述 |
|
request_id |
string |
请求id |
请求示例
无
响应示例
无
状态码
|
状态码 |
描述 |
|---|---|
|
201 |
created |
|
400 |
bad request |
|
500 |
internal server error |
错误码
请参见错误码。
相关文档
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨