Use ChatOps Agent Skill to manage cloud resources
OOS ChatOps Agent Skill (alibabacloud-oos-chatops-agent) is based on Alibaba Cloud CloudOps Orchestration Service (OOS). It allows you to query and manage Alibaba Cloud resources in natural language on AI agent platforms, and to start or stop instances, view monitoring data and bills, and perform batch O&M operations.
Overview
ChatOps Agent Skill provides the following capabilities based on OOS:
-
Query cloud resources: Query the instance lists, details, and status of various cloud resources such as ECS, RDS, VPC, SLB, and security groups.
-
Perform resource operations: Start, stop, restart, and scale instances.
-
View monitoring data and bills: Obtain the monitoring metrics, health status, and billing information of resources.
-
Batch O&M: Use the batch execution capability of OOS to complete batch O&M tasks by describing your requirements in natural language.
Prerequisites
Before you use ChatOps Agent Skill, make sure that the following conditions are met:
-
AI agent platform: An AI agent platform that supports the Skill protocol (such as OpenClaw, Cursor, or Claude) is installed and configured.
-
Alibaba Cloud CLI version: Alibaba Cloud CLI 3.3.1 or later is required. Run
aliyun versionto check the current version, and upgrade it if the version is too early. -
Alibaba Cloud credentials: Alibaba Cloud credentials are configured. Environment variables (ALIBABA_CLOUD_ACCESS_KEY_ID / ALIBABA_CLOUD_ACCESS_KEY_SECRET), a configuration file (~/.aliyun/config.json), STS, RAM roles, and instance metadata are supported.
-
RAM permissions: Grant the
oos:Chatpermission to the RAM user or role corresponding to the credentials, and grant the read-only or operation permissions on the cloud resources that you want to manage.
Add the Skill
ChatOps Agent Skill is published on the Alibaba Cloud Skill platform. Run the installation command in a terminal, and make sure that Node.js (≥18) is installed. Select the command based on the Agent client that you use:
Qoder
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent qoder -y --full-depth
Qwen Code
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent qwen-code -y --full-depth
Claude Code
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent claude-code -y --full-depth
OpenClaw
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent openclaw -y --full-depth
Codex
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent codex -y --full-depth
Cursor
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent cursor -y --full-depth
Gemini CLI
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent gemini-cli -y --full-depth
GitHub Copilot
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-oos-chatops-agent --agent github-copilot -y --full-depth
After you run the command, restart the Agent client to use this Skill.
Configuration parameters
The Skill supports the following optional configuration parameters:
|
Variable |
Required |
Description |
|
|
No |
The target region for resource queries. Default value: cn-hangzhou. |
|
|
No |
The request timeout period in seconds. Default value: 300. For time-consuming operations such as batch O&M, we recommend that you set it to 600. |
Scenarios
The Skill supports the following scenarios. In the conversation interface of the AI agent platform, describe your requirements in natural language to trigger the corresponding process.
Query cloud resources
Query the instance lists and details of cloud resources such as ECS, RDS, VPC, and SLB.
Sample conversations:
-
"Show the ECS instance list in the Hangzhou region."
-
"List all running RDS instances."
-
"Query VPC and security group information."
Perform resource operations
Start, stop, and restart instances such as ECS and RDS instances.
Sample conversations:
-
"Restart the ECS instance i-bp1xxxxxxxx."
-
"Stop all expired instances in the Hangzhou region."
-
"Start i-bp1xxxxxxxx for me."
View monitoring data and bills
Obtain the monitoring metrics, health status, and billing information of resources.
Sample conversations:
-
"Show the CPU utilization of i-bp1xxxxxxxx."
-
"How much is the ECS bill this month?"
-
"Check the health status of the instances."
Batch O&M
Use the batch execution capability of OOS to complete O&M tasks on multiple instances.
Sample conversations:
-
"Restart all ECS instances in the Hangzhou region in batches."
-
"Add the env:production tag to all instances for me."
-
"Update the security group rules of instances in the Beijing region in batches."
FAQ
What do I do if credential configuration fails?
Make sure that Alibaba Cloud credentials are configured in one of the following ways:
-
Set the environment variables
ALIBABA_CLOUD_ACCESS_KEY_IDandALIBABA_CLOUD_ACCESS_KEY_SECRET. -
Configure the
~/.aliyun/config.jsonfile. -
Use an instance RAM role (when the Skill is deployed within an ECS instance).
What do I do if a request times out?
For batch operations or complex queries, set OOS_CHATOPS_TIMEOUT to a larger value (such as 600 seconds). If the request still times out, try to narrow the query scope (for example, specify a region or resource type).
What do I do if permissions are insufficient?
Make sure that the RAM user or role has the oos:Chat permission. To operate on specific resources, you must also grant the operation permissions on the corresponding resources (such as ecs:StopInstance and ecs:StartInstance).
Which cloud services are supported?
The cloud services that are currently supported for query and management include ECS, RDS, VPC, SLB, and security groups. The supported operations depend on the backend capabilities of OOS ChatOps and are continuously expanding.
How do I switch the target region?
Set the environment variable OOS_CHATOPS_REGION to the target region ID (such as cn-beijing or cn-shanghai). You can also specify the region directly in the conversation, for example, "Show the ECS instances in the Beijing region".