CLI reference
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:
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:
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:
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. |