ALIYUN::OOS::Execution类型用于启动一个执行。

语法

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

属性

属性名称 类型 必须 允许更新 描述 约束
ResourceOptions Map ROS使用的资源选项。 详情请参见ResourceOptions属性
Parameters Map 由参数集合组成的JSON字符串。 示例值:{"Status": "Running"}。默认值:{}。
TemplateName String 模板名称。 最长为200个字符,不能以ALIYUN、ACS、ALIBABA开头。可包含英文字母、数字、短划线(-)和下划线(_)。
ParentExecutionId String 父执行ID。
SafetyCheck String 安全检查模式。 取值:
  • Skip:表示客户了解风险,无需确认即可执行任何Action,无论什么风险等级。Mode=Automatic时有效。
  • ConfirmEveryHighRiskAction(默认值):要求客户确认每一个高风险的Action。客户通过调用NotifyExecution接口进行确认或取消。
Mode String 执行模式。 取值范围:
  • Debug
  • Automatic(默认值)
TemplateVersion String 版本号。 如果不填默认为最新的版本号。

ResourceOptions语法

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

ResourceOptions属性

属性名称 类型 必须 允许更新 描述 约束
SuccessStatuses List ROS使用该属性判断资源是否创建成功。 取值范围:
  • Started
  • Queued
  • Running
  • Waiting
  • Success(默认值)
  • Failed
  • Cancelled
如果Execution的状态在FailureStatuses中,则判定为失败。如果Execution的状态在SuccessStatuses中,则判定为成功。如果上述条件不符合,则一直等待,直到超时(Timeout)。
Timeout Number 超时时间。 单位:秒。

默认值:1800。

CancelOnDelete Boolean 删除资源时,如果执行未完成是否取消执行。 取值:
  • true
  • false(默认值)
FailureStatuses List ROS使用该属性判断资源是否创建失败。FailureStatuses优先级高于SuccessStatuses。 取值:
  • Started
  • Queued
  • Running
  • Waiting
  • Success
  • Failed
  • Cancelled

默认值:["Failed", "Cancelled"]

返回值

Fn::GetAtt

  • Status:执行状态。
  • WindowsCurlCli:为Windows提供curl CLI命令前缀,可用于发出处理完成或失败的信号。详情请参见NotifyExecution
  • PowerShellCurlCli:为PowerShell提供curl CLI命令前缀,可用于发出信号处理完成或失败。
  • Outputs:执行输出结果。
  • ExecutionId:执行的唯一标识。
  • CurlCli:curl命令。
  • StatusMessage:状态信息。
  • Counters:执行数。

示例

JSON格式:
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Execution": {
      "Type": "ALIYUN::OOS::Execution",
      "Properties": {
        "ResourceOptions": {
          "Ref": "ResourceOptions"
        },
        "Parameters": {
          "Ref": "Parameters"
        },
        "TemplateName": {
          "Ref": "TemplateName"
        },
        "ParentExecutionId": {
          "Ref": "ParentExecutionId"
        },
        "SafetyCheck": {
          "Ref": "SafetyCheck"
        },
        "Mode": {
          "Ref": "Mode"
        },
        "TemplateVersion": {
          "Ref": "TemplateVersion"
        }
      }
    }
  },
  "Parameters": {
    "ResourceOptions": {
      "Type": "Json",
      "Description": "Resource options user by ROS."
    },
    "Parameters": {
      "Type": "Json",
      "Description": "Parameters for the execution of template."
    },
    "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
    },
    "ParentExecutionId": {
      "Type": "String",
      "Description": "Parent execution ID."
    },
    "SafetyCheck": {
      "Default": "ConfirmEveryHighRiskAction",
      "Type": "String",
      "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.",
      "AllowedValues": [
        "ConfirmEveryHighRiskAction",
        "Skip"
      ]
    },
    "Mode": {
      "Default": "Automatic",
      "Type": "String",
      "Description": "Execution mode.",
      "AllowedValues": [
        "Automatic",
        "Debug"
      ]
    },
    "TemplateVersion": {
      "Type": "String",
      "Description": "Version number of template. Default to the latest version."
    }
  },
  "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"
        ]
      }
    }
  }
}
YAML格式:
ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Execution:
    Type: ALIYUN::OOS::Execution
    Properties:
      ResourceOptions:
        Ref: ResourceOptions
      Parameters:
        Ref: Parameters
      TemplateName:
        Ref: TemplateName
      ParentExecutionId:
        Ref: ParentExecutionId
      SafetyCheck:
        Ref: SafetyCheck
      Mode:
        Ref: Mode
      TemplateVersion:
        Ref: TemplateVersion
Parameters:
  ResourceOptions:
    Type: Json
    Description: Resource options user by ROS.
  Parameters:
    Type: Json
    Description: Parameters for the execution of template.
  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
  ParentExecutionId:
    Type: String
    Description: Parent execution ID.
  SafetyCheck:
    Default: ConfirmEveryHighRiskAction
    Type: String
    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.'
    AllowedValues:
    - ConfirmEveryHighRiskAction
    - Skip
  Mode:
    Default: Automatic
    Type: String
    Description: Execution mode.
    AllowedValues:
    - Automatic
    - Debug
  TemplateVersion:
    Type: String
    Description: Version number of template. Default to the latest version.
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