All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::OOS::Execution

Last Updated:May 16, 2023

ALIYUN::OOS::Execution is used to start an execution.

Syntax

{
  "Type": "ALIYUN::OOS::Execution",
  "Properties": {
    "ResourceOptions": Map,
    "Parameters": Map,
    "Tags": Map,
    "TemplateName": String,
    "ParentExecutionId": String,
    "SafetyCheck": String,
    "Mode": String,
    "TemplateVersion": String,
    "ResourceGroupId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ResourceOptions

Map

No

No

The resource options that are used by Resource Orchestration Service (ROS).

For more information, see ResourceOptions properties.

Parameters

Map

No

No

The JSON strings that consist of parameters.

Example: {"Status": "Running"}.

Default value: {}.

Tags

Map

No

No

The tags. A tag is a key-value pair. Example: {"k1":"v1", "k2":"v2"}.

You can add up to 20 tags.

TemplateName

String

Yes

No

The name of the template.

The name can be up to 200 characters in length. The name cannot start with ALIYUN, ACS, or ALIBABA. The name can contain letters, digits, hyphens (-), and underscores (_).

ParentExecutionId

String

No

No

The ID of the parent execution.

None.

SafetyCheck

String

No

No

The safety check mode.

Valid values:

  • Skip: specifies that you are aware of the risks. The system executes all actions in the execution without manual confirmation, regardless of the risk level. This value is valid when Mode is set to Automatic.

  • ConfirmEveryHighRiskAction (default): requires you to confirm every high-risk action. You can call the NotifyExecution operation to confirm or cancel an action.

Mode

String

No

No

The execution mode.

Valid values:

  • Debug

  • Automatic (default)

TemplateVersion

String

No

No

The version number.

If you do not specify this property, the system uses the latest version.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

ResourceOptions syntax

"ResourceOptions": {
  "SuccessStatuses": List,
  "Timeout": Number,
  "CancelOnDelete": Boolean,
  "FailureStatuses": List
}

ResourceOptions properties

Property

Type

Required

Editable

Description

Constraint

SuccessStatuses

List

No

No

The states that indicate whether resources are created.

Valid values:

  • Started

  • Queued

  • Running

  • Waiting

  • Success (default)

  • Failed

  • Cancelled

If the state of the execution is included in the value of the FailureStatuses property, resources failed to be created. If the state of the execution is included in the value of the SuccessStatuses property, resources are created. If neither of the preceding conditions is met, the system waits until the request times out.

Timeout

Number

No

No

The timeout period.

Unit: seconds.

Default value: 1800.

CancelOnDelete

Boolean

No

No

Indicates whether to cancel the execution that is not completed when the resource is being deleted.

Valid values:

  • true

  • false (default)

FailureStatuses

List

No

No

The states that indicate whether resources failed to be created. The FailureStatuses property takes precedence over the SuccessStatuses property.

Valid values:

  • Started

  • Queued

  • Running

  • Waiting

  • Success

  • Failed

  • Cancelled

Default value: ["Failed", "Cancelled"].

Return values

Fn::GetAtt

  • Status: the state of the execution.

  • WindowsCurlCli: The cURL CLI command prefix that is provided for Windows. WindowsCurlCli can be used to send a signal that indicates whether the execution is completed or failed. For more information, see NotifyExecution.

  • PowerShellCurlCli: The cURL CLI command prefix that is provided for PowerShell. PowerShellCurlCli can be used to send a signal that indicates whether the execution is completed or failed.

  • Outputs: the outputs of the execution.

  • ExecutionId: the unique ID of the execution.

  • CurlCli: the cURL command.

  • StatusMessage: the status information.

  • Counters: the number of executions.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TemplateName:
    Type: String
    Description: Template name. Content is limited to letters, numbers, underlined, underline, the length of 200 characters, and can not begin to ALIYUN, ACS, ALIBABA.
    Label: Template Name
    ConstraintDescription: '[2, 128] English or Chinese characters'
    MinLength: 2
    MaxLength: 128
    Default: mytest
Resources:
  Execution:
    Type: ALIYUN::OOS::Execution
    Properties:
      Parameters: {}
      TemplateName:
        Ref: TemplateName
      ResourceOptions:
        SuccessStatuses:
          - Running
          - Success
          - Queued
          - Waiting
        CancelOnDelete: true
Outputs:
  Status:
    Description: Execution status.
    Value:
      Fn::GetAtt:
        - Execution
        - Status
  WindowsCurlCli:
    Description: 'Convenience attribute, provides curl CLI command prefix for Windows, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary "{\"data\": {\"NotifyType\": \"Approve\"}}" You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
    Value:
      Fn::GetAtt:
        - Execution
        - WindowsCurlCli
  PowerShellCurlCli:
    Description: 'Convenience attribute, provides curl CLI command prefix for PowerShell, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding -Body ''{"data": {"NotifyType": "Approve"}}'' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
    Value:
      Fn::GetAtt:
        - Execution
        - PowerShellCurlCli
  Outputs:
    Description: Execution output.
    Value:
      Fn::GetAtt:
        - Execution
        - Outputs
  ExecutionId:
    Description: Execution ID.
    Value:
      Fn::GetAtt:
        - Execution
        - ExecutionId
  CurlCli:
    Description: 'Convenience attribute, provides curl CLI command prefix, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary ''{"data": {"NotifyType": "Approve"}}''  You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
    Value:
      Fn::GetAtt:
        - Execution
        - CurlCli
  StatusMessage:
    Description: Execution status information.
    Value:
      Fn::GetAtt:
        - Execution
        - StatusMessage
  Counters:
    Description: 'Task statistics: FailedTasks, SuccessTasks, TotalTasks.'
    Value:
      Fn::GetAtt:
        - Execution
        - Counters

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TemplateName": {
      "Type": "String",
      "Description": "Template name. Content is limited to letters, numbers, underlined, underline, the length of 200 characters, and can not begin to ALIYUN, ACS, ALIBABA.",
      "Label": "Template Name",
      "ConstraintDescription": "[2, 128] English or Chinese characters",
      "MinLength": 2,
      "MaxLength": 128,
      "Default": "mytest"
    }
  },
  "Resources": {
    "Execution": {
      "Type": "ALIYUN::OOS::Execution",
      "Properties": {
        "Parameters": {
        },
        "TemplateName": {
          "Ref": "TemplateName"
        },
        "ResourceOptions": {
          "SuccessStatuses": [
            "Running",
            "Success",
            "Queued",
            "Waiting"
          ],
          "CancelOnDelete": true
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "Execution status.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Status"
        ]
      }
    },
    "WindowsCurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix for Windows, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary \"{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}\" You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "WindowsCurlCli"
        ]
      }
    },
    "PowerShellCurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix for PowerShell, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding -Body '{\"data\": {\"NotifyType\": \"Approve\"}}' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "PowerShellCurlCli"
        ]
      }
    },
    "Outputs": {
      "Description": "Execution output.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Outputs"
        ]
      }
    },
    "ExecutionId": {
      "Description": "Execution ID.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "ExecutionId"
        ]
      }
    },
    "CurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary '{\"data\": {\"NotifyType\": \"Approve\"}}'  You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "CurlCli"
        ]
      }
    },
    "StatusMessage": {
      "Description": "Execution status information.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "StatusMessage"
        ]
      }
    },
    "Counters": {
      "Description": "Task statistics: FailedTasks, SuccessTasks, TotalTasks.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Counters"
        ]
      }
    }
  }
}