全部产品
Search
文档中心

资源编排:ALIYUN::ARMS::DeliverTask

更新时间:Oct 09, 2024

ALIYUN::ARMS::DeliverTask类型用于创建投递任务。

语法

{
  "Type": "ALIYUN::ARMS::DeliverTask",
  "Properties": {
    "TargetList": List,
    "TaskName": String,
    "DataSourceName": String,
    "DataSourceId": String,
    "ExternalLabel": String,
    "FilterType": Boolean,
    "FilterList": String,
    "TaskDescription": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

TargetList

List

投递目标列表。

详情参考TargetList属性

TaskName

String

投递任务名称。

DataSourceName

String

数据源的名称。

DataSourceId

String

数据源的ID。

ExternalLabel

String

任务的外部标签。

FilterType

Boolean

数据过滤是否采用白名单机制。

默认值:true。

FilterList

String

设置用于过滤的指标。

支持正则表达式、多个换行符以及多种条件以实现精准传递。

TaskDescription

String

投递任务描述。

TargetList语法

"TargetList": [
  {
    "TargetParam": String,
    "TargetType": String,
    "FaultTolerantPolicy": String,
    "TargetName": String,
    "RetryPolicy": String
  }
]

TargetList属性

属性名称

类型

必须

允许更新

描述

约束

TargetType

String

投递目标的类型。

FaultTolerantPolicy

String

投递目标的容错策略。

取值:

  • ALL(默认值):允许容许异常。当发生异常时,执行不会被阻塞,消息会根据配置超出重试策略后被递送到死信队列或直接丢弃。

  • NONE:不允许容错,当发生异常并超出重试策略配置时,执行将被阻塞。

RetryPolicy

String

投递目标的重试策略。

取值:

  • BACKOFF_RETRY:重试三次,每次重试间隔随机在10到20秒之间

  • EXPONENTIAL_DECAY_RETRY(默认值):重试176次,每次重试间隔以指数方式增加至512秒,总重试时间为1天;每次重试的间隔为:1,2,4,8,... 直到512秒。

TargetParam

String

投递目标的参数。

TargetName

String

投递目标的名称。

返回值

Fn::GetAtt

TaskId:投递任务ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TargetList:
    AssociationPropertyMetadata:
      Parameters:
        TargetParam:
          Type: String
          Description:
            en: The parameter of the target.
          Required: false
        TargetType:
          Type: String
          Description:
            en: The type of the target.
          Required: true
        FaultTolerantPolicy:
          Type: String
          Description:
            en: |-
              The fault tolerant policy of the target. Valid values:
              - ALL (default): Exception tolerance is allowed. When an exception occurs, the execution will not be blocked, and the message will be delivered to the dead message queue or dropped directly according to the configuration after exceeding the retry policy.
              - NONE: Fault tolerance is not allowed and execution is blocked when an exception occurs and exceeds the retry policy configuration.
          AllowedValues:
            - ALL
            - NONE
          Required: false
          Default: ALL
        TargetName:
          Type: String
          Description:
            en: The name of the target.
          Required: false
        RetryPolicy:
          Type: String
          Description:
            en: |-
              The retry policy of the target. Valid values:
              - BACKOFF_RETRY: retry three times, with a random interval between 10 and 20 seconds
              - EXPONENTIAL_DECAY_RETRY (default): retry 176 times, each retry interval exponentially increased to 512 seconds, total retry time is 1 day; The interval for each retry is: 1,2,4,8,... 512 seconds.
          AllowedValues:
            - BACKOFF_RETRY
            - EXPONENTIAL_DECAY_RETRY
          Required: false
          Default: EXPONENTIAL_DECAY_RETRY
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: The list of the target.
    Required: true
  TaskName:
    Type: String
    Description:
      en: The name of the task.
    AllowedPattern: '[a-zA-Z0-9-]{1,64}'
    Required: true
Resources:
  DeliverTask:
    Type: ALIYUN::ARMS::DeliverTask
    Properties:
      TargetList:
        Ref: TargetList
      TaskName:
        Ref: TaskName
Outputs:
  TaskId:
    Description: The ID of the task.
    Value:
      Fn::GetAtt:
        - DeliverTask
        - TaskId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TargetList": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "TargetParam": {
            "Type": "String",
            "Description": {
              "en": "The parameter of the target."
            },
            "Required": false
          },
          "TargetType": {
            "Type": "String",
            "Description": {
              "en": "The type of the target."
            },
            "Required": true
          },
          "FaultTolerantPolicy": {
            "Type": "String",
            "Description": {
              "en": "The fault tolerant policy of the target. Valid values:\n- ALL (default): Exception tolerance is allowed. When an exception occurs, the execution will not be blocked, and the message will be delivered to the dead message queue or dropped directly according to the configuration after exceeding the retry policy.\n- NONE: Fault tolerance is not allowed and execution is blocked when an exception occurs and exceeds the retry policy configuration."
            },
            "AllowedValues": [
              "ALL",
              "NONE"
            ],
            "Required": false,
            "Default": "ALL"
          },
          "TargetName": {
            "Type": "String",
            "Description": {
              "en": "The name of the target."
            },
            "Required": false
          },
          "RetryPolicy": {
            "Type": "String",
            "Description": {
              "en": "The retry policy of the target. Valid values:\n- BACKOFF_RETRY: retry three times, with a random interval between 10 and 20 seconds\n- EXPONENTIAL_DECAY_RETRY (default): retry 176 times, each retry interval exponentially increased to 512 seconds, total retry time is 1 day; The interval for each retry is: 1,2,4,8,... 512 seconds."
            },
            "AllowedValues": [
              "BACKOFF_RETRY",
              "EXPONENTIAL_DECAY_RETRY"
            ],
            "Required": false,
            "Default": "EXPONENTIAL_DECAY_RETRY"
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The list of the target."
      },
      "Required": true
    },
    "TaskName": {
      "Type": "String",
      "Description": {
        "en": "The name of the task."
      },
      "AllowedPattern": "[a-zA-Z0-9-]{1,64}",
      "Required": true
    }
  },
  "Resources": {
    "DeliverTask": {
      "Type": "ALIYUN::ARMS::DeliverTask",
      "Properties": {
        "TargetList": {
          "Ref": "TargetList"
        },
        "TaskName": {
          "Ref": "TaskName"
        }
      }
    }
  },
  "Outputs": {
    "TaskId": {
      "Description": "The ID of the task.",
      "Value": {
        "Fn::GetAtt": [
          "DeliverTask",
          "TaskId"
        ]
      }
    }
  }
}