Logo Aliyun Ecs Manage

Aliyun Ecs Manage

Cộng đồng
cinience
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.

Tổng quan

Nhà phát hànhcinience
Kho mãalicloud-skills
Tên kỹ năngaliyun-ecs-manage
Sao
397
Bản fork
34
Tệp đi kèm
24
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 24 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được cinience công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Aliyun Ecs Manage trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/cinience/alicloud-skills/tree/main/skills/compute/ecs/aliyun-ecs-manage
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cinience/alicloud-skills.git /tmp/alicloud-skills
mkdir -p .claude/skills
cp -r /tmp/alicloud-skills/skills/compute/ecs/aliyun-ecs-manage .claude/skills/aliyun-ecs-manage
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Aliyun Ecs Manage trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Aliyun Ecs Manage ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Aliyun Ecs Manage với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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_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_types(region_id: str, zone_id: str | None = None, instance_type_family: str | None = None):
    client = create_client(region_id)
    req = ecs_models.DescribeInstanceTypesRequest(
        zone_id=zone_id,
        instance_type_family=instance_type_family,
    )
    resp = client.describe_instance_types(req)
    for t in resp.body.instance_types.instance_type:
        print(t.instance_type_id, t.cpu_core_count, t.memory_size)


if __name__ == "__main__":
    list_types("cn-hangzhou", "cn-hangzhou-k")

Common operation mapping

  • Instance lifecycle: RunInstances, CreateInstance, StartInstance(s), StopInstance(s), RebootInstance(s), DeleteInstance(s)
  • Instance details: DescribeInstances, DescribeInstanceStatus, DescribeInstanceAttribute
  • Spec changes: ModifyInstanceSpec, ModifyPrepayInstanceSpec, DescribeResourcesModification
  • System disk changes: ReplaceSystemDisk, ResetDisk
  • Data disks: CreateDisk, AttachDisk, DetachDisk, ResizeDisk, DescribeDisks
  • Snapshots: CreateSnapshot, CopySnapshot, DescribeSnapshots, DeleteSnapshot
  • Images: CreateImage, CopyImage, DescribeImages, DeleteImage, ModifyImageAttribute
  • Security groups: CreateSecurityGroup, AuthorizeSecurityGroup, RevokeSecurityGroup, DescribeSecurityGroupAttribute
  • Key pairs: CreateKeyPair, ImportKeyPair, DescribeKeyPairs, DeleteKeyPairs
  • ENI: CreateNetworkInterface, AttachNetworkInterface, DetachNetworkInterface, DescribeNetworkInterfaces
  • Tags: TagResources, UntagResources, ListTagResources
  • Monitoring/events: DescribeInstancesFullStatus, DescribeInstanceHistoryEvents, DescribeInstanceMonitorData

Query patterns

  • List instances: DescribeInstances (supports filters such as VpcId, VSwitchId, ZoneId, SecurityGroupId, InstanceIds)
  • Count instances: DescribeInstances with PageSize=1 and read TotalCount
  • Region discovery: DescribeRegions then loop all regions for inventory

Cloud Assistant (RunCommand) tips

  • Instances must be in Running state.
  • Ensure the Cloud Assistant agent is installed and online.
  • Use shell for Linux, PowerShell for Windows.
  • Poll results via DescribeInvocations and DescribeInvocationResults.

See references/command-assistant.md.

AccessKey priority (must follow, align with README)

  1. Environment variables: ALIBABACLOUD_ACCESS_KEY_ID / ALIBABACLOUD_ACCESS_KEY_SECRET / ALIBABACLOUD_REGION_ID Region policy: ALIBABACLOUD_REGION_ID is an optional default. If unset, decide the most reasonable region for the task; if unclear, ask the user.
  2. Shared config file: ~/.alibabacloud/credentials (region still from env)

Auth setup (README-aligned)

Environment variables:

bash
export ALIBABACLOUD_ACCESS_KEY_ID="your-ak"
export ALIBABACLOUD_ACCESS_KEY_SECRET="your-sk"
export ALIBABACLOUD_REGION_ID="cn-hangzhou"

Also supported by the Alibaba Cloud SDKs:

bash
export ALIBABACLOUD_ACCESS_KEY_ID="your-ak"
export ALIBABACLOUD_ACCESS_KEY_SECRET="your-sk"

Shared config file:

~/.alibabacloud/credentials

ini
[default]
type = access_key
access_key_id = your-ak
access_key_secret = your-sk

API discovery

  • Product code: Ecs
  • Default API version: 2014-05-26
  • Use OpenAPI metadata endpoints to list APIs and get schemas (see references).

Output policy

If you need to save responses or generated artifacts, write them under: output/aliyun-ecs-manage/

Resource usage query evidence example: output/aliyun-ecs-manage/ecs-usage-<instance-id>-<window>.json

Remote command evidence example: output/aliyun-ecs-manage/runcommand-<instance-id>-<name>.json

References

  • API overview: references/api_overview.md
  • Endpoints: references/endpoints.md
  • Cloud Assistant: references/command-assistant.md
  • DescribeInstances: references/describe-instances.md
  • Instances: references/instances.md
  • Disks: references/disks.md
  • Snapshots: references/snapshots.md
  • Images: references/images.md
  • Security groups: references/security-groups.md
  • Network interfaces: references/network-interfaces.md
  • Key pairs: references/keypairs.md
  • Tags: references/tags.md
  • Monitoring/events: references/monitoring-events.md
  • Sources: references/sources.md

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Aliyun Ecs Manage làm được gì?

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.

Vì sao nên dùng Aliyun Ecs Manage trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Aliyun Ecs Manage là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Aliyun Ecs Manage trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/cinience/alicloud-skills/tree/main/skills/compute/ecs/aliyun-ecs-manage. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Aliyun Ecs Manage?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Aliyun Ecs Manage với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Aliyun Ecs Manage với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Aliyun Ecs Manage có miễn phí không?

Có. Kỹ năng này được cinience phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇