DATASOURCE::OOS::Templates

DATASOURCE::OOS::Templates类型用于查询模板列表。

语法

{
  "Type": "DATASOURCE::OOS::Templates",
  "Properties": {
    "Category": String,
    "CreatedBy": String,
    "CreatedDateAfter": String,
    "CreatedDateBefore": String,
    "HasTrigger": Boolean,
    "IsExample": Boolean,
    "IsFavorite": Boolean,
    "ResourceGroupId": String,
    "RefreshOptions": String,
    "SortOrder": String,
    "SortField": String,
    "ShareType": String,
    "TemplateFormat": String,
    "TemplateType": String,
    "TemplateName": String,
    "Tags": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Category

String

模板类型。

取值:

  • TimerTrigger

  • EventTrigger

  • AlarmTrigger

  • Other

CreatedBy

String

模板创建者。

CreatedDateAfter

String

创建时间大于等于指定时间的模板。

格式为:YYYY-MM-DDThh:mm:ssZ

CreatedDateBefore

String

创建时间小于等于指定时间的模板。

格式为:YYYY-MM-DDThh:mm::ssZ

HasTrigger

Boolean

是否触发。

IsExample

Boolean

是否是示例模板。

IsFavorite

Boolean

是否已收藏。

ResourceGroupId

String

资源组 ID。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

SortOrder

String

排序方向。

取值范围:

  • Ascending:升序

  • Descending(默认值):降序

SortField

String

排序字段。

取值范围:

  • TotalExecutionCount(默认值):总执行次数

  • Popularity:受欢迎程度

  • TemplateName:模板名称

  • CreatedDate:创建时间

  • UpdatedDate:更新时间

ShareType

String

模板共享类型。

目前用户创建的模板的共享类型均为 Private。取值范围:

  • Public

  • Private

TemplateFormat

String

模板格式。

取值范围:

  • JSON

  • YAML

TemplateType

String

模板类型。

取值:

  • Automation:自动化

  • State:配置清单

  • Package:软件包

TemplateName

String

模板名称。

Tags

Map

标签键及值,

返回值

Fn::GetAtt

  • TemplateNames:模板名称列表。

  • Templates:模板详情列表。

属性名称

类型

描述

约束

TemplateNames

List

模板名称列表。

Templates

List

模板详情列表。

ResourceGroupId

string

资源组 ID。

Description

string

模板说明。

CreatedBy

string

模板创建者。

TemplateFormat

string

模板格式。

TemplateType

string

模板类型。

Hash

string

模板内容的 SHA256。

UpdatedBy

string

模板更新者。

HasTrigger

string

是否成功触发。

CreatedDate

string

模板创建时间。

UpdatedDate

string

模板更新时间。

TemplateId

string

模板 ID。

ShareType

string

模板共享类型。

Tags

Map

标签键及值,

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TemplateName:
    Type: String
    Description:
      en: The name of the template.
    Required: false
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::OOS::Templates
    Properties:
      TemplateName:
        Ref: TemplateName
Outputs:
  TemplateNames:
    Description: The list of template_names.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - TemplateNames
  Templates:
    Description: The list of templates.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - Templates
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TemplateName": {
      "Type": "String",
      "Description": {
        "en": "The name of the template."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::OOS::Templates",
      "Properties": {
        "TemplateName": {
          "Ref": "TemplateName"
        }
      }
    }
  },
  "Outputs": {
    "TemplateNames": {
      "Description": "The list of template_names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TemplateNames"
        ]
      }
    },
    "Templates": {
      "Description": "The list of templates.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "Templates"
        ]
      }
    }
  }
}