All Products
Search
Document Center

CloudOps Orchestration Service:Task

Last Updated:Dec 18, 2019

As the most important component of a template, the Tasks parameter defines the details of O&M operations. The type of a task is called an action. Operation Orchestration Service (OOS) provides you with a wide range of actions, including actions for common cloud products, such as Elastic Compute Service (ECS) and Relational Database Service (RDS). If you need common actions for cloud products that are not provided by OOS, you can contact us and provide us with your scenarios. You can also customize atom actions so that you can orchestrate and execute O&M operations immediately.

General attributes

Syntax

  • YAML format
  1. Tasks:
  2. - Name: TaskName1 # Required. The name of the task. The name can contain letters, digits, underscores (_), and hyphens (-). It can be up to 200 characters in length. We recommend that you use the camel case for a name. Example: StartInstance.
  3. Action: TaskType # Required. The type of the task. For more information, see the relevant documentation.
  4. Description: description # Optional. The description of the task, such as the features of the task.
  5. Properties: # The attributes of the task. The attribute list varies depending on the action used. For more information, see the relevant documentation.
  6. Property1: Value1 # The attribute that the action depends on.
  7. Property2: Value2
  8. Outputs: # The output parameters of the task. These parameters can be used as the input of subsequent tasks or the output of the template.
  9. outputParameterName1:
  10. Type: # Optional. The type of the output parameter. Valid values: List, Number, String, Boolean, and Json. Default value: String.
  11. ValueSelector: "jq selector" # The jQuery selector for selecting the required JSON data. For example, when you call an API operation for a task, the jQuery selector extracts the required information from the returned JSON data. For more information, see the examples of cloud product actions and public templates.
  12. # Parameters for process control
  13. OnError: "ACS::END/ACS::NEXT/other-task-name" # Optional. The process to be executed if an error occurs when the task is executed. Default value: END, indicating that the execution will end when an error occurs.
  14. OnSuccess: "ACS::NEXT/other-task-name/ACS::END" # Optional. The process to be executed when the task is successfully executed. Default value: NEXT, indicating that the next task will be executed after the current task is successfully executed.
  15. # Parameters for risk warning
  16. Risk: High/Normal # Optional. The level of the risk. For more information, see the relevant documentation.
  17. # Parameters for advanced control of the ACS::ExecuteAPI action
  18. Delay: duration # Optional. The time interval before a retry starts. It must be a positive integer, such as 10. Unit: seconds.
  19. Retries: times # Optional. The number of retries. It must be a positive integer.
  20. DelayType: delayType # Optional. The type of the time interval for retries. Valid values: Constant, Linear, and Exponential. If this parameter is set to Constant, the actual delay is the duration specified by the Delay parameter. If this parameter is set to Linear, the actual delay is the sum of the duration specified by the Delay parameter and the product of the values of the BackOff and Retries parameters. If this parameter is set to Exponential, the actual delay is the sum of the duration specified by the Delay parameter and the value of the BackOff parameter raised to the power of the value of the Retries parameter. Default value: Constant.
  21. BackOff: backOff # Optional. The backoff period before a retry starts. It must be a positive integer. This parameter is valid only when the DelayType parameter is set to Linear or Exponential.
  • JSON format (For more information, see the parameter description for the YAML format.)
  1. {
  2. "Tasks": [
  3. {
  4. "Name": "TaskName1",
  5. "Action": "TaskType",
  6. "Description": "description",
  7. "Properties": {
  8. "Property1": "Value1",
  9. "Property2": "Value2"
  10. },
  11. "Outputs": {
  12. "outputParameterName1": {
  13. "Type": null,
  14. "ValueSelector": "jq selector"
  15. }
  16. },
  17. "OnError": "ACS::END/ACS::NEXT/other-task-name",
  18. "OnSuccess": "ACS::NEXT/other-task-name/ACS::END",
  19. "Risk": "High/Normal",
  20. "Delay": "duration",
  21. "Retries": "times",
  22. "DelayType": "delayType",
  23. "BackOff": "backOff"
  24. }
  25. ]
  26. }