文档

使用ROS模板选择和设置对象

更新时间:

资源编排支持通过新增对象数组、元素数组和参数对象对JSON数据进行扩展,增强JSON对象的校验逻辑。

对象数组

对象数组为单一对象,数组元素支持所有的ROS模板参数类型。

模板示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  listParameter:
    Type: Json
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Type: String
    Default:
      - a
      - b
      - c         

对象数组展示示例

当您使用模板示例创建资源栈或资源栈组时,资源编排控制台会根据模板示例渲染参数。

单数组渲染图

元素数组

元素数组为多个对象,数组元素支持所有的ROS模板参数类型。

模板示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  listParameters:
    Type: Json
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      Parameters:
        p1:
          Type: String
        p2:
          Type: Boolean
      ListMetadata:
        ShowHeader: true
        ShowRemove: true
        ShowAddition: true
        Order:
          - p2
          - p1
    Default:
      - p1: p10
        p2: true
      - p1: p11
        p2: false

元素数组展示示例

当您使用模板示例创建资源栈或资源栈组时,资源编排控制台会根据模板示例渲染参数。

多对象渲染图

JSON参数

JSON参数用于渲染一个可定义的schema对象,JSON参数支持所有的ROS模板参数类型。

模板示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  jsonSchema:
    Type: Json
    AssociationPropertyMetadata:
      Parameters:
        a:
          Type: String
          Description: a from Json
          Default: '123'
        b:
          Type: Boolean
          Description: b from Json
          Default: true
        c:
          Type: String
          Description: c from Json
          AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        d:
          Type: String
          Description: d from Json
          Default: d

JSON参数展示示例

当您使用模板示例创建资源栈或资源栈组时,资源编排控制台会根据模板示例渲染参数。

003
  • 本页导读 (1)
文档反馈