aliyun-ecs-manage
Use when managing Alibaba Cloud Elastic Compute Service (ECS) via OpenAPI/SDK, including listing or creating instances, starting/stopping/rebooting, managing disks/snapshots/images/security groups/key pairs/ENIs, querying status, and troubleshooting workflows for this product.
What this skill does
Category: service
# Elastic Compute Service (ECS)
## Validation
```bash
mkdir -p output/aliyun-ecs-manage
python -m py_compile skills/compute/ecs/aliyun-ecs-manage/scripts/list_instances_all_regions.py
python -m py_compile skills/compute/ecs/aliyun-ecs-manage/scripts/query_instance_usage.py
python -m py_compile skills/compute/ecs/aliyun-ecs-manage/scripts/run_remote_command.py
echo "py_compile_ok" > output/aliyun-ecs-manage/validate.txt
```
Pass criteria: command exits 0 and `output/aliyun-ecs-manage/validate.txt` is generated.
## Output And Evidence
- Save list/summarize outputs under `output/aliyun-ecs-manage/`.
- Keep command arguments and region scope in each evidence file.
Use Alibaba Cloud OpenAPI (RPC) with official SDKs or OpenAPI Explorer to manage ECS resources.
Prefer the Python SDK for all examples and execution.
## Prerequisites
- Prepare AccessKey (RAM user/role with least privilege).
- Choose the correct region and endpoint (public/VPC).
- ECS OpenAPI is RPC style; prefer SDK or OpenAPI Explorer to avoid manual signing.
## API behavior notes (from ECS docs)
- Most list/describe APIs support pagination via `PageNumber` + `PageSize` or `NextToken` + `MaxResults`.
- `DescribeInstances` returns an empty list if the RAM user/role lacks permissions; use `DryRun` to validate permissions.
- For `DescribeInstances`, `NextToken` + `MaxResults` is the recommended paged query pattern; use the returned `NextToken` to fetch subsequent pages.
- `DescribeInstances` requires `RegionId` in the request even if the client has a region set.
- Filters are ANDed; set only the filters you need.
## Workflow
1) Confirm region, resource identifiers, and desired action.
2) Find API group and exact operation name in `references/api_overview.md`.
3) Call API with Python SDK (preferred) or OpenAPI Explorer.
4) Verify results with describe/list APIs.
5) If you need repeatable inventory or summaries, use `scripts/` and write outputs under `output/aliyun-ecs-manage/`.
## SDK priority
1) Python SDK (preferred)
2) OpenAPI Explorer
3) Other SDKs (only if Python is not feasible)
### Python SDK quickstart (list instances)
Virtual environment is recommended (avoid PEP 668 system install restrictions).
```bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install alibabacloud_ecs20140526 alibabacloud_tea_openapi alibabacloud_credentials
```
```python
from alibabacloud_ecs20140526.client import Client as Ecs20140526Client
from alibabacloud_ecs20140526 import models as ecs_models
from alibabacloud_tea_openapi import models as open_api_models
def create_client(region_id: str) -> Ecs20140526Client:
config = open_api_models.Config(
# Use env vars or shared config files per AccessKey priority.
region_id=region_id,
endpoint=f"ecs.{region_id}.aliyuncs.com",
)
return Ecs20140526Client(config)
def list_instances(region_id: str):
client = create_client(region_id)
resp = client.describe_instances(ecs_models.DescribeInstancesRequest(
region_id=region_id,
page_number=1,
page_size=50,
))
for inst in resp.body.instances.instance:
print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)
if __name__ == "__main__":
list_instances("cn-hangzhou")
```
### Python SDK scripts (recommended for inventory)
- List all instances across regions (TSV/JSON): `scripts/list_instances_all_regions.py`
- Query resource usage (CPU/Memory/Network) for one instance: `scripts/query_instance_usage.py`
- Run remote commands via Cloud Assistant (RunCommand): `scripts/run_remote_command.py`
- Summarize instance specs across regions: `scripts/summary_instance_specs.py`
- Summarize instance counts by region (optional status breakdown): `scripts/summary_instances_by_region.py`
- Summarize instance counts by status: `scripts/summary_instances_by_status.py`
- Summarize instance counts by instance type: `scripts/summary_instances_by_instance_type.py`
- Summarize instance counts by VPC: `scripts/summary_instances_by_vpc.py`
- Summarize instance counts by security group: `scripts/summary_instances_by_security_group.py`
### Python SDK: query one instance resource usage
Install dependencies (add CMS SDK):
```bash
python -m pip install alibabacloud_ecs20140526 alibabacloud_cms20190101 alibabacloud_tea_openapi alibabacloud_credentials
```
Example (last 1 hour, 5-minute period):
```bash
python skills/compute/ecs/aliyun-ecs-manage/scripts/query_instance_usage.py \
--instance-id i-xxxxxxxxxxxxxxxxx \
--region-id cn-shanghai \
--hours 1 \
--period 300 \
--summary-only \
--output output/aliyun-ecs-manage/ecs-usage-i-xxxxxxxxxxxxxxxxx-1h.json
```
Recommended default metrics:
- `CPUUtilization`
- `memory_usedutilization`
- `InternetInRate`, `InternetOutRate`
- `IntranetInRate`, `IntranetOutRate`
### Python SDK: run remote command on one ECS instance
Example (`ps -ef`):
```bash
python skills/compute/ecs/aliyun-ecs-manage/scripts/run_remote_command.py \
--instance-id i-xxxxxxxxxxxxxxxxx \
--region-id cn-shanghai \
--command 'ps -ef' \
--output output/aliyun-ecs-manage/runcommand-i-xxxxxxxxxxxxxxxxx-ps-ef.json
```
Behavior:
- Submit `RunCommand` with `RunShellScript`.
- Poll `DescribeInvocationResults` until final status.
- Decode base64 stdout and save normalized JSON evidence.
### Python SDK: list instances for all regions
```python
from alibabacloud_ecs20140526.client import Client as Ecs20140526Client
from alibabacloud_ecs20140526 import models as ecs_models
from alibabacloud_tea_openapi import models as open_api_models
def create_client(region_id: str) -> Ecs20140526Client:
config = open_api_models.Config(
region_id=region_id,
endpoint=f"ecs.{region_id}.aliyuncs.com",
)
return Ecs20140526Client(config)
def list_regions() -> list[str]:
client = create_client("cn-hangzhou")
resp = client.describe_regions(ecs_models.DescribeRegionsRequest())
return [r.region_id for r in resp.body.regions.region]
def list_instances_all_regions():
for region_id in list_regions():
client = create_client(region_id)
req = ecs_models.DescribeInstancesRequest(
region_id=region_id,
page_number=1,
page_size=100,
)
resp = client.describe_instances(req)
print(f"== {region_id} ({resp.body.total_count}) ==")
for inst in resp.body.instances.instance:
print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)
if __name__ == "__main__":
list_instances_all_regions()
```
### Python SDK: paginated instance listing
```python
from alibabacloud_ecs20140526.client import Client as Ecs20140526Client
from alibabacloud_ecs20140526 import models as ecs_models
from alibabacloud_tea_openapi import models as open_api_models
def create_client(region_id: str) -> Ecs20140526Client:
config = open_api_models.Config(
region_id=region_id,
endpoint=f"ecs.{region_id}.aliyuncs.com",
)
return Ecs20140526Client(config)
def list_instances_paged(region_id: str):
client = create_client(region_id)
page_number = 1
page_size = 100
while True:
resp = client.describe_instances(ecs_models.DescribeInstancesRequest(
region_id=region_id,
page_number=page_number,
page_size=page_size,
))
for inst in resp.body.instances.instance:
print(inst.instance_id, inst.instance_name, inst.instance_type, inst.status)
total = resp.body.total_count
if page_number * page_size >= total:
break
page_number += 1
if __name__ == "__main__":
list_instances_paged("cn-hangzhou")
```
### Python SDK: list instance types and pricing inputs
```python
from alibabacloud_ecs20140526.client import Client as Ecs20140526Client
from alibabacloud_ecs20140526 import models as ecs_models
from alibabacloud_tea_openapi import models as open_apiRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.