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 used by Resource Orchestration Service (ROS). For more information, see ResourceOptions properties.
Parameters Map No No The JSON-formatted 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 specify up to 20 tags.
TemplateName String Yes No The name of the template. The template name can be up to 200 characters in length. It 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 security check mode. Valid values:
  • Skip: specifies that you are aware of the risks. The system perform all actions in the execution without manual confirmation, regardless of the risk level. This property is valid only if the Mode property is set to Automatic.
  • ConfirmEveryHighRiskAction: requires you to confirm each high-risk action. This is the default value. You can call the NotifyExecution operation to confirm or cancel an action.
Mode String No No The execution mode. Valid values:
  • Debug.
  • Automatic. This is the default value.
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. This is the default value.
  • Failed.
  • Cancelled.
If the value of the Status parameter is included in the value of the FailureStatuses property, resources failed to be created. If the value of the Status parameter 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 resource creation request times out.
Timeout Number No No The timeout period. Unit: seconds.

Default value: 1800.

CancelOnDelete Boolean No No Specifies whether to cancel the execution that is not complete when the resources are being deleted. Valid values:
  • true.
  • false. This is the default value.
FailureStatuses List No No Specifies 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"].

Response parameters

Fn::GetAtt

  • Status: the state of the execution.
  • WindowsCurlCli: provides Windows with cURL CLI command prefixes and sends a message that indicates whether the execution is complete or failed. For more information, see NotifyExecution.
  • PowerShellCurlCli: provides PowerShell with cURL CLI command prefixes and sends a message that indicates whether the execution is complete or failed.
  • Outputs: the output of the execution.
  • ExecutionId: the unique ID of the execution.
  • CurlCli: the cURL command.
  • StatusMessage: the status information.
  • Counters: the number of executions.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ParentExecutionId": {
      "Type": "String",
      "Description": "Parent execution ID."
    },
    "ResourceOptions": {
      "Type": "Json",
      "Description": "Resource options user by ROS."
    },
    "Parameters": {
      "Type": "Json",
      "Description": "Parameters for the execution of template."
    },
    "SafetyCheck": {
      "Type": "String",
      "Description": "Security check mode. Allowed values:\n- Skip: This option means that customers understand the risks, you can do anything without confirmation Action, no matter what the level of risk. It takes effect only if Mode is Automatic.\n- ConfirmEveryHighRiskAction (default): This option would require customers to confirm each Action a high risk. NotifyExecution by calling customer interface to confirm or cancel.",
      "AllowedValues": [
        "ConfirmEveryHighRiskAction",
        "Skip"
      ],
      "Default": "ConfirmEveryHighRiskAction"
    },
    "Mode": {
      "Type": "String",
      "Description": "Execution mode.",
      "AllowedValues": [
        "Automatic",
        "Debug"
      ],
      "Default": "Automatic"
    },
    "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.",
      "MaxLength": 200
    },
    "TemplateVersion": {
      "Type": "String",
      "Description": "Version number of template. Default to the latest version."
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tag value and the key mapping, the label of the key number can be up to 20.",
      "MaxLength": 20
    }
  },
  "Resources": {
    "Execution": {
      "Type": "ALIYUN::OOS::Execution",
      "Properties": {
        "ParentExecutionId": {
          "Ref": "ParentExecutionId"
        },
        "ResourceOptions": {
          "Ref": "ResourceOptions"
        },
        "Parameters": {
          "Ref": "Parameters"
        },
        "SafetyCheck": {
          "Ref": "SafetyCheck"
        },
        "Mode": {
          "Ref": "Mode"
        },
        "TemplateName": {
          "Ref": "TemplateName"
        },
        "TemplateVersion": {
          "Ref": "TemplateVersion"
        },
        "Tags": {
          "Ref": "Tags"
        }
      }
    }
  },
  "Outputs": {
    "Status": {
      "Description": "Execution status.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Status"
        ]
      }
    },
    "CurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix, which can be used to notify oos execution instead of OOS API NotifyExecution.\nYou can notify approve to oos execution by adding --data-binary '{\"data\": {\"NotifyType\": \"Approve\"}}' \nYou 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"
        ]
      }
    },
    "WindowsCurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix for Windows, which can be used to notify oos execution instead of OOS API NotifyExecution.\nYou can notify approve to oos execution by adding --data-binary \"{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}\" \nYou 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"
        ]
      }
    },
    "Outputs": {
      "Description": "Execution output.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Outputs"
        ]
      }
    },
    "Counters": {
      "Description": "Task statistics: FailedTasks, SuccessTasks, TotalTasks.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "Counters"
        ]
      }
    },
    "PowerShellCurlCli": {
      "Description": "Convenience attribute, provides curl CLI command prefix for PowerShell, which can be used to notify oos execution instead of OOS API NotifyExecution.\nYou can notify approve to oos execution by adding -Body '{\"data\": {\"NotifyType\": \"Approve\"}}' \nYou 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"
        ]
      }
    },
    "ExecutionId": {
      "Description": "Execution ID.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "ExecutionId"
        ]
      }
    },
    "StatusMessage": {
      "Description": "Execution status information.",
      "Value": {
        "Fn::GetAtt": [
          "Execution",
          "StatusMessage"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Mode:
    AllowedValues:
    - Automatic
    - Debug
    Default: Automatic
    Description: Execution mode.
    Type: String
  Parameters:
    Description: Parameters for the execution of template.
    Type: Json
  ParentExecutionId:
    Description: Parent execution ID.
    Type: String
  ResourceOptions:
    Description: Resource options user by ROS.
    Type: Json
  SafetyCheck:
    AllowedValues:
    - ConfirmEveryHighRiskAction
    - Skip
    Default: ConfirmEveryHighRiskAction
    Description: 'Security check mode. Allowed values:

      - Skip: This option means that customers understand the risks, you can do anything
      without confirmation Action, no matter what the level of risk. It takes effect
      only if Mode is Automatic.

      - ConfirmEveryHighRiskAction (default): This option would require customers
      to confirm each Action a high risk. NotifyExecution by calling customer interface
      to confirm or cancel.'
    Type: String
  Tags:
    Description: Tag value and the key mapping, the label of the key number can be
      up to 20.
    MaxLength: 20
    Type: Json
  TemplateName:
    Description: Template name. Content is limited to letters, numbers, underlined,
      underline, the length of 200 characters, and can not begin to ALIYUN, ACS, ALIBABA.
    MaxLength: 200
    Type: String
  TemplateVersion:
    Description: Version number of template. Default to the latest version.
    Type: String
Resources:
  Execution:
    Properties:
      Mode:
        Ref: Mode
      Parameters:
        Ref: Parameters
      ParentExecutionId:
        Ref: ParentExecutionId
      ResourceOptions:
        Ref: ResourceOptions
      SafetyCheck:
        Ref: SafetyCheck
      Tags:
        Ref: Tags
      TemplateName:
        Ref: TemplateName
      TemplateVersion:
        Ref: TemplateVersion
    Type: ALIYUN::OOS::Execution
Outputs:
  Counters:
    Description: 'Task statistics: FailedTasks, SuccessTasks, TotalTasks.'
    Value:
      Fn::GetAtt:
      - Execution
      - Counters
  CurlCli:
    Description: "Convenience attribute, provides curl CLI command prefix, which can\
      \ be used to notify oos execution instead of OOS API NotifyExecution.\nYou can\
      \ notify approve to oos execution by adding --data-binary '{\"data\": {\"NotifyType\"\
      : \"Approve\"}}' \n\
      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
  ExecutionId:
    Description: Execution ID.
    Value:
      Fn::GetAtt:
      - Execution
      - ExecutionId
  Outputs:
    Description: Execution output.
    Value:
      Fn::GetAtt:
      - Execution
      - Outputs
  PowerShellCurlCli:
    Description: "Convenience attribute, provides curl CLI command prefix for PowerShell,\
      \ which can be used to notify oos execution instead of OOS API NotifyExecution.\n\
      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
  Status:
    Description: Execution status.
    Value:
      Fn::GetAtt:
      - Execution
      - Status
  StatusMessage:
    Description: Execution status information.
    Value:
      Fn::GetAtt:
      - Execution
      - StatusMessage
  WindowsCurlCli:
    Description: "Convenience attribute, provides curl CLI command prefix for Windows,\
      \ which can be used to notify oos execution instead of OOS API NotifyExecution.\n\
      You can notify approve to oos execution by adding --data-binary \"{\\\"data\\\
      \": {\\\"NotifyType\\\": \\\"Approve\\\"}}\" \nYou 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

For more information, see OOS.json and OOS.yml. In the examples, the ALIYUN::OOS::Template and ALIYUN::OOS::Execution resource types are involved.