aws step函数的python dsl

steppygraph的Python项目详细描述


steppy graph-用于step函数的alpha质量dsl

示例用法:

s = StateMachine()
    res = Resource(name="foores", type=ResourceType.LAMBDA)
    s.next(Task(resource=res, name="Kermit", comment='Foo'))
    s.next(Wait(name="Waiting time", comment='Foo', seconds=2))
    s.next(Pass(name="Pass the buck"))
    s.next(Task(resource=res, name="Miss Piggy", comment='Foo'))
    s.build()

    print(s.to_json())

应产生类似于:

{
    "StartAt": "Kermit",
    "States": {
        "Kermit": {
            "Comment": "Foo",
            "End": false,
            "Next": "Waiting time",
            "Resource": "arn:aws:lambda:::function:foores",
            "TimeoutSeconds": 600,
            "Type": "Task"
        },
        "Miss Piggy": {
            "Comment": "Foo",
            "End": true,
            "Resource": "arn:aws:lambda:::function:foores",
            "TimeoutSeconds": 600,
            "Type": "Task"
        },
        "Pass the buck": {
            "Comment": "",
            "End": false,
            "Next": "Miss Piggy",
            "Type": "Pass"
        },
        "Waiting time": {
            "Comment": "Foo",
            "End": false,
            "Next": "Pass the buck",
            "Seconds": 2,
            "Type": "Wait"
        }
    },
    "TimeoutSeconds": 600
}

注意-通过statemachine中的next()方法添加的状态总是“自动连接的”,即它们有一个布尔值 将自动将它们连接到图形中的下一个状态的标志集。对要添加的状态使用“添加状态” 添加而不自动连接下一个属性。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
添加组件后,java JTable为空   java将json发送到php并插入mysql,但返回null   java Spring引导JNDI CommonJ资源   从不同PC创建和合并后的Java servlet问题   java如何在使用findelements时从xpath获取文本   java使用spring boot使用gmail smtp发送电子邮件   java在不使用pojo、bean或getter和setter的情况下获取Json标题的Json数组   Java中的OpenFile对话框将null作为响应   JavaBuilder模式。扩展接口   java中无需替换的数据结构选取   java如何评价Encog中的预测神经网络   java如何在安卓中使用实际的HttpURLConnection进行单元测试?   java使用XML配置禁用WebSocket中的CSRF保护   java如何通过hibernate从多表查询中获取数据?   mysql如何在java中获取更新的行Id   java AEM/CQ组件单一组件/有限组件   java FFmpeg Javacv延迟问题   显示整数数组的java不起作用