Serverless工作流 CreateFlow

By | 2021年4月22日

调用CreateFlow创建一个流程。

接口说明

  • 每个用户所能创建的流程个数受资源限制(详见 使用限制),如果您有特殊需求,可以提工单进行调整。
  • 流程在用户级别是按照名称来区分的,即单一账号下不可以存在同名流程。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateFlow

系统规定参数。取值:CreateFlow

Definition String version: v1.0<br/>type: flow<br/>steps:<br/> – type: pass<br/> name: mypass

创建的流程的定义,遵循 FDL 语法标准。

Description String test flow

创建流程的描述。

Name String flow

创建的流程名称。该名称在账户下唯一。

Type String FDL

创建流程的类型,取值:FDL。

RequestId String testRequestID

您这次请求的指定RequestID。如果不指定,我们系统会帮你随机生成。

RoleArn String acs:ram:${region}:${accountID}:${role}

可选参数,流程执行所需的资源描述符信息,用于在任务执行时 FnF 进行 assume role。

返回数据

名称 类型 示例值 描述
CreatedTime String 2019-01-01T01:01:01.001Z

流程创建时间。

Definition String version: v1.0<br/>type: flow<br/>steps:<br/> – type: pass<br/> name: mypass

流程定义。

Description String test flow

流程描述信息。

Id String e589e092-e2c0-4dee-b306-3574ddfdddf5ccc3

流程的唯一ID。

LastModifiedTime String 2019-01-01T01:01:01.001Z

流程最后更改时间。

Name String flow

流程名称。

RequestId String testRequestID

请求 ID。当有 http status code 返回时,FnF 都会返回请求 ID。

RoleArn String acs:ram:${region}:${accountID}:${role}

流程执行所需资源描述符信息。

Type String FDL

流程的类型。

示例

请求示例


http(s)://[Endpoint]/?Action=CreateFlow
&Definition=version: v1.0 type: flow steps: - type: pass name: mypass
&Description=test flow
&Name=flow
&RoleArn=acs:ram::${accountID}:${role}
&Type=FDL
&<公共请求参数>

正常返回示例

XML 格式

<CreateFlowResponseponse>
    <Description>Response in XML format is not supported.</Description>
</CreateFlowResponseponse>

JSON 格式

{
	"Name":"flow",
	"Description":"test flow",
	"CreatedTime":"2019-01-01T01:01:01.001Z",
	"Type":"FDL",
	"RequestId":"testRequestID",
	"Id":"e589e092-e2c0-4dee-b306-3574ddfdddf5ccc3",
	"LastModifiedTime":"2019-01-01T01:01:01.001Z",
	"Version":"1",
	"RoleArn":"acs:ram::${accountID}:${role}",
	"Definition":"version: v1.0\ntype: flow\nname: test\nsteps:\n  - type: pass\n    name: mypass"
}

错误码

HttpCode 错误码 错误信息 描述
403 AccessDenied The resources doesn’t belong to you. 请求鉴权未通过,具体内容请参考实际错误信息
400 ActionNotSupported The requested API operation ‘%s’ is incorrect. Please check. 所请求方法错误。请参照api文档并检查拼写
400 APIVersionNotSupported The requested API version ‘%s’ is not supported yet. Please check. 所请求接口版本不正确。请参考api简介
400 EntityTooLarge The payload size exceeds maximum allowed size (%s bytes). 请求消息体过大
409 FlowAlreadyExists Flow %s already exists. 已存在同名流程
500 InternalServerError An internal error has occurred. Please retry. 服务器内部错误。请稍后重试
403 InvalidAccessKeyID The AccessKey ID %s is invalid. access key ID 无效。
400 InvalidArgument Parameter error. 请求参数错误。具体内容请参考实际错误信息
400 MissingRequiredHeader The HTTP header ‘%s’ must be specified. 请求所需参数缺失。具体内容请参考实际错误信息。
400 MissingRequiredParams The HTTP query ‘%s’ must be specified. 请求所需参数缺失。具体内容请参考实际错误信息。
403 RequestTimeTooSkewed The difference between the request time %s and the current time %s is too large. 您的请求时间不正确,该请求已被识别为无效。请参考通用参数一节。
429 ResourceThrottled The request is throttled. Please try again later. 因某些原因系统流量已达瓶颈。请稍后重试。
403 SignatureNotMatch The request signature we calculated does not match the signature you provided. Check your access key and signing method. 您发起请求的签名与我们计算不一致,请检查您的签名算法及access key secret。
415 UnsupportedMediaType The content type must be "application/json". 请求消息体类型错误。

访问错误中心查看更多错误码。

请关注公众号获取更多资料

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Iconic One Theme | Powered by Wordpress