All Products
Search
Document Center

CLI Reference

Last Updated: Jun 11, 2020

This topic describes how to use Alibaba Cloud Command Line Interface (CLI) to call the Operation Orchestration Service (OOS) API. Make sure that you have installed and configured Alibaba Cloud CLI V3.0.19 or later.

You can use Alibaba Cloud CLI to call the OOS API to create a template, execute a template, or check the execution result. For information about the required request parameters and how to call the OOS API, see API overview. If an error occurs when you call an API operation, you can refer to the corresponding API document for troubleshooting suggestions.

Create a template

Run the following command to create a template and specify its name and content:

  1. aliyun oos CreateTemplate --region cn-hangzhou --TemplateName MyTemplate --Content '{"FormatVersion": "OOS-2019-06-01", "Tasks": [{"Action": "ACS::ExecuteApi", "Properties": {"API": "DescribeInstances", "Service": "Ecs", "Parameters": {"Status": "{{ Status }}"}}, "Name": "foo"}], "Description": "Descirbe instances of given status", "Parameters": {"Status": {"Type": "String", "Description": "(Required) The status of the Ecs instance."}}}'

Execute a template

Run the following command to execute the MyTemplate template:

  1. aliyun oos StartExecution --region cn-hangzhou --TemplateName MyTemplate --Parameters '{"Status":"Running"}'

Check the execution result

Run the following command to query the execution result based on the execution ID returned in the previous step:

  1. aliyun oos ListExecutions --region cn-hangzhou --ExecutionId "<ExecutionId>"

Common request parameters

Name Example Description
Action CreateTemplate The name of the OOS API operation that you use Alibaba Cloud CLI to call. For more information, see API overview.
region cn-hangzhou The unique ID of the region where API Gateway is located. For more information, see the list of regions that OOS supports.