ALIYUN::SchedulerX::Job

更新时间:
复制为 MD 格式

ALIYUN::SchedulerX::Job类型用于创建任务。

语法

{
  "Type": "ALIYUN::SchedulerX::Job",
  "Properties": {
    "ExecuteMode": String,
    "GroupId": String,
    "JobType": String,
    "Name": String,
    "Namespace": String,
    "TimeType": Integer,
    "AttemptInterval": Integer,
    "ClassName": String,
    "ContactInfo": List,
    "ConsumerSize": Integer,
    "Calendar": String,
    "Content": String,
    "Description": String,
    "DispatcherSize": Integer,
    "DataOffset": Integer,
    "FailEnable": Boolean,
    "FailTimes": Integer,
    "MissWorkerEnable": Boolean,
    "MaxAttempt": Integer,
    "MaxConcurrency": Integer,
    "NamespaceSource": String,
    "PageSize": Integer,
    "Parameters": String,
    "Priority": Integer,
    "QueueSize": Integer,
    "SuccessNoticeEnable": Boolean,
    "SendChannel": String,
    "Timezone": String,
    "TimeExpression": String,
    "TaskMaxAttempt": Integer,
    "Timeout": Integer,
    "TimeoutKillEnable": Boolean,
    "TaskAttemptInterval": Integer,
    "TimeoutEnable": Boolean,
    "XAttrs": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ExecuteMode

String

任务的执行模式。

取值:

  • standalone

  • broadcast

  • parallel

  • batch

  • sharding

GroupId

String

任务的组ID。

JobType

String

任务的类型。

取值:

  • python

  • xxljob

  • java

  • shell

  • golang

  • go

  • http

  • dataworks

Name

String

任务的名称。

Namespace

String

任务的命名空间。

TimeType

Integer

任务的时间类型。

取值:

  • 1

  • 3

  • 4

  • 5

  • 100

  • -1

AttemptInterval

Integer

任务的重试间隔。

Calendar

String

任务的日历。

ClassName

String

任务的类名。

ConsumerSize

Integer

任务的消费者数量。

ContactInfo

List

任务的联系人信息。

长度最大值为10。更多信息,请参考ContactInfo属性

Content

String

任务的内容。

DataOffset

Integer

任务的数据偏移量。

Description

String

任务的描述。

DispatcherSize

Integer

任务的调度器数量。

FailEnable

Boolean

任务是否启用失败重试。

FailTimes

Integer

任务的失败次数。

MaxAttempt

Integer

任务的最大重试次数。

MaxConcurrency

Integer

任务的最大并发数。

取值范围:1200。

MissWorkerEnable

Boolean

任务是否启用缺失worker。

NamespaceSource

String

任务的命名空间来源。

PageSize

Integer

并行网格任务的高级配置。

一次拉取子任务的默认数量为100。

Parameters

String

任务的参数。

Priority

Integer

任务的优先级。

取值:

  • 1

  • 5

  • 10

  • 15

QueueSize

Integer

任务的队列大小。

SendChannel

String

任务的发送通道。

SuccessNoticeEnable

Boolean

任务是否启用成功通知。

TaskAttemptInterval

Integer

任务子任务的重试间隔。

TaskMaxAttempt

Integer

任务子任务的最大重试次数。

TimeExpression

String

任务的时间表达式。

Timeout

Integer

任务的超时时间。

TimeoutEnable

Boolean

任务是否启用超时。

TimeoutKillEnable

Boolean

任务是否启用超时终止。

Timezone

String

任务的时区。

XAttrs

Map

任务的扩展属性。

ContactInfo语法

"ContactInfo": [
  {
    "UserName": String,
    "UserPhone": String,
    "UserMail": String,
    "Ding": String
  }
]

ContactInfo属性

属性名称

类型

必须

允许更新

描述

约束

Ding

String

联系人信息中的钉钉。

UserMail

String

联系人信息中的用户邮箱。

UserName

String

联系人信息中的用户名。

UserPhone

String

联系人信息中的用户电话。

返回值

Fn::GetAtt

JobId:任务的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Namespace:
    Type: String
    Description:
      en: The namespace of the job.
    Required: true
  NamespaceSource:
    Type: String
    Description:
      en: The namespace source of the job.
    Default: Null
    Required: false
  GroupId:
    Type: String
    Description:
      en: The group ID of the job.
    Required: true
  JobType:
    Type: String
    Description:
      en: The type of the job.
    AllowedValues:
      - python
      - xxljob
      - java
      - shell
      - golang
      - go
      - http
      - dataworks
    Required: true
  Name:
    Type: String
    Description:
      en: The name of the job.
    Required: true
  Description:
    Type: String
    Description:
      en: The description of the job.
    AssociationProperty: TextArea
    Default: Null
    Required: false
  ExecuteMode:
    Type: String
    Description:
      en: The execute mode of the job.
    AllowedValues:
      - standalone
      - broadcast
      - parallel
      - batch
      - sharding
    Required: true
  ClassName:
    Type: String
    Description:
      en: The class name of the job.
    Default: Null
    Required: false
  Content:
    Type: String
    Description:
      en: The content of the job.
    Default: Null
    Required: false
  Parameters:
    Type: String
    Description:
      en: The parameters of the job.
    Default: Null
    Required: false
  MaxConcurrency:
    Type: Number
    Description:
      en: The max concurrency of the job.
    MinValue: 1
    MaxValue: 200
    Default: Null
    Required: false
  MaxAttempt:
    Type: Number
    Description:
      en: The max attempt of the job.
    Default: Null
    Required: false
  AttemptInterval:
    Type: Number
    Description:
      en: The attempt interval of the job.
    Default: Null
    Required: false
  PageSize:
    Type: Number
    Description:
      en: Advanced configuration for parallel grid tasks, the default number of sub-tasks pulled at a time is 100.
    Default: Null
    Required: false
  ConsumerSize:
    Type: Number
    Description:
      en: The consumer size of the job.
    Default: Null
    Required: false
  QueueSize:
    Type: Number
    Description:
      en: The queue size of the job.
    Default: Null
    Required: false
  DispatcherSize:
    Type: Number
    Description:
      en: The dispatcher size of the job.
    Default: Null
    Required: false
  TimeType:
    Type: Number
    Description:
      en: |-
        The time type of the job.
        cron:1
        fixed_rate:3
        second_delay:4
        one_time :5
        api:100
        none:-1
    AllowedValues:
      - 1
      - 3
      - 4
      - 5
      - 100
      - -1
    Required: true
  TimeExpression:
    Type: String
    Description:
      en: The time expression of the job.
    Default: Null
    Required: false
  Calendar:
    Type: String
    Description:
      en: The calendar of the job.
    Default: Null
    Required: false
  DataOffset:
    Type: Number
    Description:
      en: The data offset of the job.
    Default: Null
    Required: false
  Timezone:
    Type: String
    Description:
      en: The timezone of the job.
    Default: Null
    Required: false
  TimeoutEnable:
    Type: Boolean
    Description:
      en: Whether timeout is enabled for the job.
    Default: Null
    Required: false
  Timeout:
    Type: Number
    Description:
      en: The timeout of the job.
    Default: Null
    Required: false
  TimeoutKillEnable:
    Type: Boolean
    Description:
      en: Whether timeout kill is enabled for the job.
    Default: Null
    Required: false
  FailEnable:
    Type: Boolean
    Description:
      en: Whether fail is enabled for the job.
    Default: Null
    Required: false
  FailTimes:
    Type: Number
    Description:
      en: The fail times of the job.
    Default: Null
    Required: false
  MissWorkerEnable:
    Type: Boolean
    Description:
      en: Whether miss worker is enabled for the job.
    Default: Null
    Required: false
  SuccessNoticeEnable:
    Type: Boolean
    Description:
      en: Whether success notice is enabled for the job.
    Default: Null
    Required: false
  SendChannel:
    Type: String
    Description:
      en: The send channel of the job.
    Default: Null
    Required: false
  TaskMaxAttempt:
    Type: Number
    Description:
      en: The task max attempt of the job.
    Default: Null
    Required: false
  TaskAttemptInterval:
    Type: Number
    Description:
      en: The task attempt interval of the job.
    Default: Null
    Required: false
  ContactInfo:
    Description:
      en: The contact info of the job.
    Required: false
    Default: Null
    Type: Json
    MaxLength: 10
    AssociationProperty: List[Parameters]
    AssociationPropertyMetadata:
      Parameters:
        UserPhone:
          Type: String
          Description:
            en: The user phone in contact info.
          Default: Null
          Required: false
        UserName:
          Type: String
          Description:
            en: The user name in contact info.
          Default: Null
          Required: false
        UserMail:
          Type: String
          Description:
            en: The user mail in contact info.
          Default: Null
          Required: false
        Ding:
          Type: String
          Description:
            en: The ding in contact info.
          Default: Null
          Required: false
  XAttrs:
    Description:
      en: The extended attributes of the job.
    Required: false
    Default: Null
    Type: Json
  Priority:
    Type: Number
    Description:
      en: The priority of the job.
    AllowedValues:
      - 1
      - 5
      - 10
      - 15
    Default: Null
    Required: false
Resources:
  Job:
    Type: ALIYUN::SchedulerX::Job
    Properties:
      Namespace:
        Ref: Namespace
      NamespaceSource:
        Ref: NamespaceSource
      GroupId:
        Ref: GroupId
      JobType:
        Ref: JobType
      Name:
        Ref: Name
      Description:
        Ref: Description
      ExecuteMode:
        Ref: ExecuteMode
      ClassName:
        Ref: ClassName
      Content:
        Ref: Content
      Parameters:
        Ref: Parameters
      MaxConcurrency:
        Ref: MaxConcurrency
      MaxAttempt:
        Ref: MaxAttempt
      AttemptInterval:
        Ref: AttemptInterval
      PageSize:
        Ref: PageSize
      ConsumerSize:
        Ref: ConsumerSize
      QueueSize:
        Ref: QueueSize
      DispatcherSize:
        Ref: DispatcherSize
      TimeType:
        Ref: TimeType
      TimeExpression:
        Ref: TimeExpression
      Calendar:
        Ref: Calendar
      DataOffset:
        Ref: DataOffset
      Timezone:
        Ref: Timezone
      TimeoutEnable:
        Ref: TimeoutEnable
      Timeout:
        Ref: Timeout
      TimeoutKillEnable:
        Ref: TimeoutKillEnable
      FailEnable:
        Ref: FailEnable
      FailTimes:
        Ref: FailTimes
      MissWorkerEnable:
        Ref: MissWorkerEnable
      SuccessNoticeEnable:
        Ref: SuccessNoticeEnable
      SendChannel:
        Ref: SendChannel
      TaskMaxAttempt:
        Ref: TaskMaxAttempt
      TaskAttemptInterval:
        Ref: TaskAttemptInterval
      ContactInfo:
        Ref: ContactInfo
      XAttrs:
        Ref: XAttrs
      Priority:
        Ref: Priority
Outputs:
  JobId:
    Value:
      Fn::GetAtt:
        - Job
        - JobId
    Description: The ID of the job.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Namespace": {
      "Type": "String",
      "Description": {
        "en": "The namespace of the job."
      },
      "Required": true
    },
    "NamespaceSource": {
      "Type": "String",
      "Description": {
        "en": "The namespace source of the job."
      },
      "Default": null,
      "Required": false
    },
    "GroupId": {
      "Type": "String",
      "Description": {
        "en": "The group ID of the job."
      },
      "Required": true
    },
    "JobType": {
      "Type": "String",
      "Description": {
        "en": "The type of the job."
      },
      "AllowedValues": [
        "python",
        "xxljob",
        "java",
        "shell",
        "golang",
        "go",
        "http",
        "dataworks"
      ],
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The name of the job."
      },
      "Required": true
    },
    "Description": {
      "Type": "String",
      "Description": {
        "en": "The description of the job."
      },
      "AssociationProperty": "TextArea",
      "Default": null,
      "Required": false
    },
    "ExecuteMode": {
      "Type": "String",
      "Description": {
        "en": "The execute mode of the job."
      },
      "AllowedValues": [
        "standalone",
        "broadcast",
        "parallel",
        "batch",
        "sharding"
      ],
      "Required": true
    },
    "ClassName": {
      "Type": "String",
      "Description": {
        "en": "The class name of the job."
      },
      "Default": null,
      "Required": false
    },
    "Content": {
      "Type": "String",
      "Description": {
        "en": "The content of the job."
      },
      "Default": null,
      "Required": false
    },
    "Parameters": {
      "Type": "String",
      "Description": {
        "en": "The parameters of the job."
      },
      "Default": null,
      "Required": false
    },
    "MaxConcurrency": {
      "Type": "Number",
      "Description": {
        "en": "The max concurrency of the job."
      },
      "MinValue": 1,
      "MaxValue": 200,
      "Default": null,
      "Required": false
    },
    "MaxAttempt": {
      "Type": "Number",
      "Description": {
        "en": "The max attempt of the job."
      },
      "Default": null,
      "Required": false
    },
    "AttemptInterval": {
      "Type": "Number",
      "Description": {
        "en": "The attempt interval of the job."
      },
      "Default": null,
      "Required": false
    },
    "PageSize": {
      "Type": "Number",
      "Description": {
        "en": "Advanced configuration for parallel grid tasks, the default number of sub-tasks pulled at a time is 100."
      },
      "Default": null,
      "Required": false
    },
    "ConsumerSize": {
      "Type": "Number",
      "Description": {
        "en": "The consumer size of the job."
      },
      "Default": null,
      "Required": false
    },
    "QueueSize": {
      "Type": "Number",
      "Description": {
        "en": "The queue size of the job."
      },
      "Default": null,
      "Required": false
    },
    "DispatcherSize": {
      "Type": "Number",
      "Description": {
        "en": "The dispatcher size of the job."
      },
      "Default": null,
      "Required": false
    },
    "TimeType": {
      "Type": "Number",
      "Description": {
        "en": "The time type of the job.\ncron:1\nfixed_rate:3\nsecond_delay:4\none_time :5\napi:100\nnone:-1"
      },
      "AllowedValues": [
        1,
        3,
        4,
        5,
        100,
        -1
      ],
      "Required": true
    },
    "TimeExpression": {
      "Type": "String",
      "Description": {
        "en": "The time expression of the job."
      },
      "Default": null,
      "Required": false
    },
    "Calendar": {
      "Type": "String",
      "Description": {
        "en": "The calendar of the job."
      },
      "Default": null,
      "Required": false
    },
    "DataOffset": {
      "Type": "Number",
      "Description": {
        "en": "The data offset of the job."
      },
      "Default": null,
      "Required": false
    },
    "Timezone": {
      "Type": "String",
      "Description": {
        "en": "The timezone of the job."
      },
      "Default": null,
      "Required": false
    },
    "TimeoutEnable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether timeout is enabled for the job."
      },
      "Default": null,
      "Required": false
    },
    "Timeout": {
      "Type": "Number",
      "Description": {
        "en": "The timeout of the job."
      },
      "Default": null,
      "Required": false
    },
    "TimeoutKillEnable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether timeout kill is enabled for the job."
      },
      "Default": null,
      "Required": false
    },
    "FailEnable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether fail is enabled for the job."
      },
      "Default": null,
      "Required": false
    },
    "FailTimes": {
      "Type": "Number",
      "Description": {
        "en": "The fail times of the job."
      },
      "Default": null,
      "Required": false
    },
    "MissWorkerEnable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether miss worker is enabled for the job."
      },
      "Default": null,
      "Required": false
    },
    "SuccessNoticeEnable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether success notice is enabled for the job."
      },
      "Default": null,
      "Required": false
    },
    "SendChannel": {
      "Type": "String",
      "Description": {
        "en": "The send channel of the job."
      },
      "Default": null,
      "Required": false
    },
    "TaskMaxAttempt": {
      "Type": "Number",
      "Description": {
        "en": "The task max attempt of the job."
      },
      "Default": null,
      "Required": false
    },
    "TaskAttemptInterval": {
      "Type": "Number",
      "Description": {
        "en": "The task attempt interval of the job."
      },
      "Default": null,
      "Required": false
    },
    "ContactInfo": {
      "Description": {
        "en": "The contact info of the job."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "MaxLength": 10,
      "AssociationProperty": "List[Parameters]",
      "AssociationPropertyMetadata": {
        "Parameters": {
          "UserPhone": {
            "Type": "String",
            "Description": {
              "en": "The user phone in contact info."
            },
            "Default": null,
            "Required": false
          },
          "UserName": {
            "Type": "String",
            "Description": {
              "en": "The user name in contact info."
            },
            "Default": null,
            "Required": false
          },
          "UserMail": {
            "Type": "String",
            "Description": {
              "en": "The user mail in contact info."
            },
            "Default": null,
            "Required": false
          },
          "Ding": {
            "Type": "String",
            "Description": {
              "en": "The ding in contact info."
            },
            "Default": null,
            "Required": false
          }
        }
      }
    },
    "XAttrs": {
      "Description": {
        "en": "The extended attributes of the job."
      },
      "Required": false,
      "Default": null,
      "Type": "Json"
    },
    "Priority": {
      "Type": "Number",
      "Description": {
        "en": "The priority of the job."
      },
      "AllowedValues": [
        1,
        5,
        10,
        15
      ],
      "Default": null,
      "Required": false
    }
  },
  "Resources": {
    "Job": {
      "Type": "ALIYUN::SchedulerX::Job",
      "Properties": {
        "Namespace": {
          "Ref": "Namespace"
        },
        "NamespaceSource": {
          "Ref": "NamespaceSource"
        },
        "GroupId": {
          "Ref": "GroupId"
        },
        "JobType": {
          "Ref": "JobType"
        },
        "Name": {
          "Ref": "Name"
        },
        "Description": {
          "Ref": "Description"
        },
        "ExecuteMode": {
          "Ref": "ExecuteMode"
        },
        "ClassName": {
          "Ref": "ClassName"
        },
        "Content": {
          "Ref": "Content"
        },
        "Parameters": {
          "Ref": "Parameters"
        },
        "MaxConcurrency": {
          "Ref": "MaxConcurrency"
        },
        "MaxAttempt": {
          "Ref": "MaxAttempt"
        },
        "AttemptInterval": {
          "Ref": "AttemptInterval"
        },
        "PageSize": {
          "Ref": "PageSize"
        },
        "ConsumerSize": {
          "Ref": "ConsumerSize"
        },
        "QueueSize": {
          "Ref": "QueueSize"
        },
        "DispatcherSize": {
          "Ref": "DispatcherSize"
        },
        "TimeType": {
          "Ref": "TimeType"
        },
        "TimeExpression": {
          "Ref": "TimeExpression"
        },
        "Calendar": {
          "Ref": "Calendar"
        },
        "DataOffset": {
          "Ref": "DataOffset"
        },
        "Timezone": {
          "Ref": "Timezone"
        },
        "TimeoutEnable": {
          "Ref": "TimeoutEnable"
        },
        "Timeout": {
          "Ref": "Timeout"
        },
        "TimeoutKillEnable": {
          "Ref": "TimeoutKillEnable"
        },
        "FailEnable": {
          "Ref": "FailEnable"
        },
        "FailTimes": {
          "Ref": "FailTimes"
        },
        "MissWorkerEnable": {
          "Ref": "MissWorkerEnable"
        },
        "SuccessNoticeEnable": {
          "Ref": "SuccessNoticeEnable"
        },
        "SendChannel": {
          "Ref": "SendChannel"
        },
        "TaskMaxAttempt": {
          "Ref": "TaskMaxAttempt"
        },
        "TaskAttemptInterval": {
          "Ref": "TaskAttemptInterval"
        },
        "ContactInfo": {
          "Ref": "ContactInfo"
        },
        "XAttrs": {
          "Ref": "XAttrs"
        },
        "Priority": {
          "Ref": "Priority"
        }
      }
    }
  },
  "Outputs": {
    "JobId": {
      "Value": {
        "Fn::GetAtt": [
          "Job",
          "JobId"
        ]
      },
      "Description": "The ID of the job."
    }
  }
}