本文介绍了资源编排 ROS 使用示例,您可以参见示例进行操作。

本产品已接入阿里云资源编排服务(简称 ROS),您可以使用 ROS 管理流程。

使用示例

您可以使用 ROS 控制台CLI 创建资源。模板的定义请参见流程资源定义文档

  • YAML 格式流程资源模板
    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      Flow:
        Type: 'ALIYUN::FNF::Flow'
        Properties:
          Description: flow created from ros
          Definition: |-
            version: v1
            type: flow
            steps:
              - type: pass
                name: pass1
          Name: test-ros
    Outputs:
      CreatedTime:
        Description: The flow creation time.
        Value:
          'Fn::GetAtt':
            - Flow
            - CreatedTime
      LastModifiedTime:
        Description: The flow last modified time.
        Value:
          'Fn::GetAtt':
            - Flow
            - LastModifiedTime
      Id:
        Description: The flow ID.
        Value:
          'Fn::GetAtt':
            - Flow
            - Id           
  • JSON 格式流程资源模板
    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "Flow": {
          "Type": "ALIYUN::FNF::Flow",
          "Properties": {
            "Description": "flow created from ros",
            "Definition": "version: v1\ntype: flow\nsteps:\n  - type: pass\n    name: pass1",
            "Name": "test-ros"
          }
        }
      },
      "Outputs": {
        "CreatedTime": {
          "Description": "The flow creation time.",
          "Value": {
            "Fn::GetAtt": [
              "Flow",
              "CreatedTime"
            ]
          }
        },
        "LastModifiedTime": {
          "Description": "The flow last modified time.",
          "Value": {
            "Fn::GetAtt": [
              "Flow",
              "LastModifiedTime"
            ]
          }
        },
        "Id": {
          "Description": "The flow ID.",
          "Value": {
            "Fn::GetAtt": [
              "Flow",
              "Id"
            ]
          }
        }
      }
    }