All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-ScheduleToExecuteTemplate

Last Updated:Jan 03, 2025

Template name

ACS-ECS-ScheduleToExecuteTemplate

Execute Now

Template description

Executes a specific template as scheduled. This applies to scenarios in which you want to execute OOS templates at the specified time. When you configure this template, you must specify the following parameters: timerTrigger: the trigger type and expressions, templateName: the name of the OOS template, and templateParameters: the required parameters to execute the template. After this template is executed, the OOS template is executed at the specified time.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

timerTrigger

The type of the scheduled task.

Json

Yes

templateName

The template name.

String

Yes

templateParameters

The parameters that trigger the execution template.

Json

Yes

OOSAssumeRole

The Resource Access Management (RAM) role that is assumed by CloudOps Orchestration Service (OOS).

String

No

OOSServiceRole

Output parameters

None

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": []
}

References

For more information, see ACS-ECS-ScheduleToExecuteTemplate.yml at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: 'Schedules to execute specified template, applicable to scenarios where OOS templates need to be executed at specific intervals or time points, such as automated maintenance tasks and scheduled management tasks. During configuration, users need to provide the following required parameter information: Timer Trigger (timerTrigger), which configures the trigger type and expression, Template Name (templateName), which specifies the name of the OOS template to be executed, and Template Parameters (templateParameters), which are the parameters required for executing the template. Once defined, the template will trigger and execute the specified OOS template according to the configured schedule.'
  zh-cn: the description in Chinese
  name-en: ACS-ECS-ScheduleToExecuteTemplate
  zh-cn: the description in Chinese
  categories:
    - time_trigger
Parameters:
  timerTrigger:
    Type: Json
    Label:
      en: TimerTrigger
      zh-cn: the description in Chinese
    AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
    AssociationPropertyMetadata:
      MinuteInterval: 30
  templateName:
    Type: String
    Label:
      en: TemplateName
      zh-cn: the description in Chinese
    AssociationProperty: TemplateName
  templateParameters:
    Label:
      en: TemplateParemeters
      zh-cn: the description in Chinese
    Type: Json
    AssociationProperty: TemplateParameter
    AssociationPropertyMetadata:
      TemplateName: templateName
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: the description in Chinese
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: timerTrigger
    Action: 'ACS::TimerTrigger'
    Description:
      en: Triggers a task as scheduled by specifying type and expression
      zh-cn: the description in Chinese
    Properties:
      Type:
        'Fn::Select':
          - type
          - '{{timerTrigger}}'
      Expression:
        'Fn::Select':
          - expression
          - '{{timerTrigger}}'
      EndDate:
        'Fn::Select':
          - endDate
          - '{{ timerTrigger }}'
      TimeZone:
        'Fn::Select':
          - timeZone
          - '{{ timerTrigger }}'
  - Name: executeTemplate
    Action: 'ACS::Template'
    Description:
      en: Execute template
      zh-cn: the description in Chinese
    Properties:
      TemplateName: '{{ templateName }}'
      Parameters: '{{ templateParameters }}'