调用此接口,可以将通过FlowSpec定义的工作流节点和其内部的子节点都导入到数据开发中。
接口说明
注意 该接口不支持导入多个工作流,若 FlowSpec 中定义了不止一个工作流,则除第一个以外的后续工作流将被忽略。
注意 这是一个异步接口,调用该接口将返回一个异步任务的对象。任务具体的执行状态需要调用 GetJobStatus 查询。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
当前API暂无授权信息透出。
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
ProjectId | string | 是 | DataWorks 工作空间的 ID。您可以登录 DataWorks 控制台,进入工作空间管理页面获取 ID。 该参数用来确定本次 API 调用操作使用的 DataWorks 工作空间。 | 123456 |
Spec | string | 是 | 描述这个工作流的 FlowSpec 信息,具体规范详见 FlowSpec 。 | { "version": "1.1.0", "kind": "CycleWorkflow", "spec": { "name": "异步创建工作流测试", "id": "632647691239009XXXX", "type": "CycleWorkflow", "owner": "110755000425XXXX", "workflows": [ { "script": { "path": "XX/OpenAPI测试/工作流测试/异步创建工作流测试", "runtime": { "command": "WORKFLOW" }, "id": "571736535339375XXXX" }, "id": "632647691239009XXXX", "trigger": { "type": "Scheduler", "id": "704867956014174XXXX", "cron": "00 03 00 * * ?", "startTime": "1970-01-01 00:00:00", "endTime": "9999-01-01 00:00:00", "timezone": "Asia/Shanghai", "delaySeconds": 0 }, "strategy": { "timeout": 0, "instanceMode": "T+1", "rerunMode": "Allowed", "rerunTimes": 3, "rerunInterval": 180000, "failureStrategy": "Break" }, "name": "异步创建工作流测试", "owner": "110755000425XXXX", "inputs": {}, "outputs": { "nodeOutputs": [ { "data": "632647691239009XXXX", "artifactType": "NodeOutput", "refTableName": "异步创建工作流测试", "isDefault": true } ] }, "nodes": [ { "recurrence": "Normal", "id": "742981001612325XXXX", "timeout": 0, "instanceMode": "T+1", "rerunMode": "Allowed", "rerunTimes": 3, "rerunInterval": 180000, "script": { "path": "XX/OpenAPI测试/工作流测试/异步创建工作流测试/111", "runtime": { "command": "ODPS_SQL", "commandTypeId": 10, "cu": "0.25" }, "content": "select now();\n", "id": "553495118941391XXXX" }, "trigger": { "type": "Scheduler", "id": "553164589407812XXXX", "cron": "00 24 00 * * ?", "startTime": "1970-01-01 00:00:00", "endTime": "9999-01-01 00:00:00", "timezone": "Asia/Shanghai", "delaySeconds": 0 }, "name": "111", "owner": "110755000425XXXX", "inputs": {}, "outputs": { "nodeOutputs": [ { "data": "742981001612325XXXX", "artifactType": "NodeOutput", "refTableName": "111", "isDefault": true } ] } }, { "recurrence": "Normal", "id": "595182137303408XXXX", "timeout": 0, "instanceMode": "T+1", "rerunMode": "Allowed", "rerunTimes": 3, "rerunInterval": 180000, "script": { "path": "XX/OpenAPI测试/工作流测试/异步创建工作流测试/222", "runtime": { "command": "ODPS_SQL", "commandTypeId": 10, "cu": "0.25" }, "content": "select now();\n select 1;", "id": "793399140553304XXXX" }, "trigger": { "type": "Scheduler", "id": "613552850338387XXXX", "cron": "00 00 00 * * ?", "startTime": "1970-01-01 00:00:00", "endTime": "9999-01-01 00:00:00", "timezone": "Asia/Shanghai", "delaySeconds": 0 }, "name": "222", "owner": "110755000425XXXX", "inputs": {}, "outputs": { "nodeOutputs": [ { "data": "595182137303408XXXX", "artifactType": "NodeOutput", "refTableName": "222", "isDefault": true } ] } } ], "dependencies": [ { "nodeId": "595182137303408XXXX", "depends": [ { "type": "Normal", "output": "742981001612325XXXX", "refTableName": "111" } ] } ] } ] } } |
返回参数
示例
正常返回示例
JSON
格式
{
"RequestId": "7C352CB7-CD88-50CF-9D0D-E81BDF020E7F",
"AsyncJob": {
"Completed": false,
"CreateTime": 1706581425000,
"Error": "target folder already exists: XXXX",
"Id": "1234567691239009XXXX",
"Progress": 0,
"Response": "632647691239009XXXX",
"Status": "Running",
"Type": "Create"
}
}
错误码
访问错误中心查看更多错误码。