|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +""" Code is generated by ucloud-model, DO NOT EDIT IT. """ |
| 4 | +from ucloud.core.client import Client |
| 5 | +from ucloud.services.stepflow.schemas import apis |
| 6 | + |
| 7 | + |
| 8 | +class StepFlowClient(Client): |
| 9 | + def __init__(self, config, transport=None, middleware=None, logger=None): |
| 10 | + super(StepFlowClient, self).__init__(config, transport, middleware, logger) |
| 11 | + |
| 12 | + def create_sf_workflow_from_template(self, req=None, **kwargs): |
| 13 | + """ CreateSFWorkflowFromTemplate - 导入工作流定义 |
| 14 | +
|
| 15 | + **Request** |
| 16 | +
|
| 17 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 18 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 19 | + - **Namespace** (str) - (Required) 需要创建的工作流namespace |
| 20 | + - **Workflow** (str) - (Required) 描述工作流定义的base64字符串 |
| 21 | + - **WorkflowName** (str) - (Required) 需要创建的工作流名称 |
| 22 | + |
| 23 | + **Response** |
| 24 | +
|
| 25 | + - **Message** (str) - 返回消息 |
| 26 | + - **Version** (int) - 创建的工作流版本号 |
| 27 | + |
| 28 | + """ |
| 29 | + d = {"ProjectId": self.config.project_id, "Region": self.config.region} |
| 30 | + req and d.update(req) |
| 31 | + d = apis.CreateSFWorkflowFromTemplateRequestSchema().dumps(d) |
| 32 | + kwargs["max_retries"] = 0 |
| 33 | + resp = self.invoke("CreateSFWorkflowFromTemplate", d, **kwargs) |
| 34 | + return apis.CreateSFWorkflowFromTemplateResponseSchema().loads(resp) |
| 35 | + |
| 36 | + def get_sf_workflow_template(self, req=None, **kwargs): |
| 37 | + """ GetSFWorkflowTemplate - 导出工作流定义 |
| 38 | +
|
| 39 | + **Request** |
| 40 | +
|
| 41 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 42 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 43 | + - **WorkflowId** (str) - (Required) 被导出工作流的Id |
| 44 | + - **WorkflowVersion** (int) - 被导出工作流的版本号。取值范围:WorkflowVersion >= 1;默认会获取发布版本对应的workflow;超过最大版本会返回错误 |
| 45 | + |
| 46 | + **Response** |
| 47 | +
|
| 48 | + - **Message** (str) - 返回消息 |
| 49 | + - **Version** (int) - 导出工作流的版本号 |
| 50 | + - **Workflow** (dict) - 见 **WorkflowTemplate** 模型定义 |
| 51 | + - **WorkflowId** (str) - 导出工作流的Id |
| 52 | + |
| 53 | + **Response Model** |
| 54 | + |
| 55 | + **Param** |
| 56 | + |
| 57 | + - **Name** (str) - 参数名称 |
| 58 | + - **Type** (str) - 参数类型 |
| 59 | + - **Value** (str) - 参数值 |
| 60 | +
|
| 61 | + **ActivityTemplate** |
| 62 | + |
| 63 | + - **Input** (dict) - Activity的输入 |
| 64 | + - **Name** (str) - Activity的名字 |
| 65 | + - **Next** (str) - 下一个Activity的名字 |
| 66 | + - **Output** (list) - Activity的输出,详见Param |
| 67 | + - **RetryTimes** (str) - Activity的重试次数 |
| 68 | + - **Timeout** (str) - Activity的超时时间 |
| 69 | + - **Type** (str) - Activity的类型 |
| 70 | +
|
| 71 | + **WorkflowTemplate** |
| 72 | + |
| 73 | + - **Activites** (list) - 见 **ActivityTemplate** 模型定义 |
| 74 | + - **Input** (list) - 见 **Param** 模型定义 |
| 75 | + - **Output** (list) - 见 **Param** 模型定义 |
| 76 | +
|
| 77 | + """ |
| 78 | + d = {"ProjectId": self.config.project_id, "Region": self.config.region} |
| 79 | + req and d.update(req) |
| 80 | + d = apis.GetSFWorkflowTemplateRequestSchema().dumps(d) |
| 81 | + resp = self.invoke("GetSFWorkflowTemplate", d, **kwargs) |
| 82 | + return apis.GetSFWorkflowTemplateResponseSchema().loads(resp) |
0 commit comments