Read-only query of Huawei Cloud ECS, BMS, IMS, and AS resources via local Python scripts.
Coding
huawei-cloud-ecs-query
Try itQueries Huawei Cloud ECS (Elastic Cloud Server) resources in read-only mode. Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, launch templates, recycle bin, scheduled events, and tags. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check server status, view block devices, or inspect ECS resource attributes. Triggers include: 查询ECS, ECS实例查询, 云服务器查询, 弹性云服务器, ECS规格, ECS配额, 云服务器列表, ECS详情, query ECS, list ECS servers, show server details, ECS flavors, ECS quotas, ECS keypairs, server groups, block devices, ECS inventory, cloud server list, ecs list, ecs query, ecs show.
What it does
Queries Huawei Cloud ECS (Elastic Cloud Server) resources in read-only mode. Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, launch templates, recycle bin, scheduled events, and tags. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check server status, view block devices, or inspect ECS resource attributes. Triggers include: 查询ECS, ECS实例查询, 云服务器查询, 弹性云服务器, ECS规格, ECS配额, 云服务器列表, ECS详情, query ECS, list ECS servers, show server details, ECS flavors, ECS quotas, ECS keypairs, server groups, block devices, ECS inventory, cloud server list, ecs list, ecs query, ecs show.
The skill document
Huawei Cloud ECS Query
⚠️ Execution Method (Must Read): This skill executes queries via local Python scripts. Using hcloud, openstack, or other CLI tools or direct API calls is prohibited.
- Query scripts are located under the skill directory
scripts/ecs/- All scripts and environment check scripts are inside the skill package. You must use
skill action=execto execute them; do not run them directly in the shell- For specific script paths and parameters, see
references/guide.md- Do not attempt hcloud, openstack, curl IAM, or other CLI/API methods; this skill does not depend on those tools
- All paths are relative to the skill directory, which is the directory containing this SKILL.md
Overview
This skill is a standalone read-only query skill that queries Huawei Cloud ECS resources by calling the Huawei Cloud Python SDK (huaweicloudsdkecs) via local Python scripts.
This skill is applicable to the following scenarios:
- Query ECS instance lists and details (status, flavor, image, network, IP)
- Query available ECS flavors and sell policies
- Query ECS keypairs and security groups
- Query server block devices and volume attachments
- Query server network interfaces and NIC details
- Query server groups, tags, and quotas
- Query launch templates and recycle bin
- Query scheduled events and job status
- Obtain VNC remote console address
This skill does NOT handle the following:
- Creating ECS instances or resources
- Modifying ECS instances or resources
- Deleting ECS instances or resources
- Guessing or fabricating information that was not queried
Architecture
User Request → Skill → huaweicloudsdkecs (SDK) → Huawei Cloud ECS API
↓
ListServersDetails / ShowServer / ListFlavors / ...
↓
Structured JSON results
Prerequisites
Before use, you must run the environment check script to complete environment verification and dependency installation in one step:
- Linux / macOS:
skill action=exec: bash skill://scripts/check_env.sh - Windows:
skill action=exec: powershell -ExecutionPolicy Bypass -File skill://scripts/check_env.ps1
The script will check in order: Python >= 3.6 → install dependencies → verify SDK → verify credentials → verify service availability. If the environment check fails, fix the issue before continuing with other scripts.
Environment Variables:
| Variable | Required | Description |
|---|---|---|
| HW_ACCESS_KEY | Yes | Huawei Cloud AK |
| HW_SECRET_KEY | Yes | Huawei Cloud SK |
| HW_REGION_NAME | No | Default cn-north-4 |
| HW_PROJECT_ID | No | Project ID (automatically obtained via IAM API if not set) |
| HW_SECURITY_TOKEN | No | Required for temporary AK/SK |
Do not output the values of the above environment variables.
IAM Permissions — See references/iam-policies.md for least-privilege policy.
Workflow
- Environment Preparation — Execute the environment check script to ensure dependencies are installed and credentials are configured
- Identify Query — Based on user intent, read
references/guide.mdto determine the script path and parameters - Execute Query — Call the appropriate script with parameters via
skill action=exec - Format Results — Parse and present query results in a structured format
Core Commands
Instance Queries
# List all ECS instances (detailed)
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_servers_details.py --region=cn-north-4
# Show a specific ECS instance
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_server.py --region=cn-north-4 --server_id=
# List cloud servers (v1.1 API)
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_cloud_servers.py --region=cn-north-4
# List servers by tag
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_servers_by_tag.py --region=cn-north-4
Flavor Queries
# List ECS flavors
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_flavors.py --region=cn-north-4
# List flavor sell policies
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_flavor_sell_policies.py --region=cn-north-4
# List resize flavors
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_resize_flavors.py --region=cn-north-4 --source_flavor_id=
# Show flavor capacity
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_flavor_capacity.py --region=cn-north-4 --flavor_id=
Server Detail Queries
# List server block devices
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_block_devices.py --region=cn-north-4 --server_id=
# Show server block device
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_server_block_device.py --region=cn-north-4 --server_id= --volume_id=
# List server network interfaces
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_interfaces.py --region=cn-north-4 --server_id=
# List server volume attachments
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_volume_attachments.py --region=cn-north-4 --server_id=
# Show server tags
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_server_tags.py --region=cn-north-4 --server_id=
# Show server limits (quotas)
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_server_limits.py --region=cn-north-4
Keypair & Security Group Queries
# List SSH keypairs
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/nova_list_keypairs.py --region=cn-north-4
# Show SSH keypair details
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/nova_show_keypair.py --region=cn-north-4 --keypair_name=
# List server security groups
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/nova_list_server_security_groups.py --region=cn-north-4 --server_id=
Other Queries
# List server groups
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_groups.py --region=cn-north-4
# List availability zones
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_az_info.py --region=cn-north-4
# List project tags
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_server_tags.py --region=cn-north-4
# Show VNC remote console
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_server_remote_console.py --region=cn-north-4 --server_id=
# List recycle bin servers
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_recycle_bin_servers.py --region=cn-north-4
# List scheduled events
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/list_scheduled_events.py --region=cn-north-4
# Show job status
skill action=exec: skill://.venv/bin/python3 skill://scripts/ecs/show_job.py --region=cn-north-4 --job_id=
Parameter Confirmation
| Parameter | Required | Description |
|---|---|---|
| region | Yes | Huawei Cloud region, e.g., cn-north-4 |
| --project_id | No | Project ID; automatically obtained if not provided |
| --server_id | Yes (Show) | ECS server ID for detail query |
| --flavor_id | Yes (Flavor) | Flavor ID for flavor-specific queries |
| --keypair_name | Yes (Keypair) | Keypair name for keypair detail query |
| --job_id | Yes (Job) | Job ID for async task status query |
| --availability_zone | No | Availability zone filter |
For script-specific parameters, see references/guide.md.
Output Format
Query results are output in JSON format, containing the following common fields:
total: Total number of matching resourcesitems: Resource list, each resource containing key fields such as id, name, and status- Specific fields vary by resource type; see
references/guide.mdfor details
KooCLI Command Format Standard
When hcloud CLI is available, use the following format:
hcloud ECS ListServersDetails --cli-region= [--limit=] [--offset=]
hcloud ECS ShowServer --cli-region= --server_id=
hcloud ECS ListFlavors --cli-region= [--availability_zone=]
hcloud ECS ListServerGroups --cli-region=
hcloud ECS NovaListKeypairs --cli-region=
| Feature | Description | Example |
|---|---|---|
| Service name | ECS | hcloud ECS ListServersDetails |
| Operation name | PascalCase | ListServersDetails, ShowServer |
| Region parameter | --cli-region= | --cli-region=cn-north-4 |
| Simple parameter | --key=value | --server_id=xxx |
Reference Documents
- Query Guide — Script usage guide for all ECS query operations
- IAM Policies — Least-privilege IAM policy for ECS query operations
- CLI Installation Guide — hcloud CLI setup reference
- Verification Method — How to verify skill functionality
- Data Flow Diagram — Mermaid data flow diagram
- Acceptance Criteria — Acceptance criteria for this skill
Related skills
Queries the EIP (Elastic IP, 弹性公网IP) bound to a single Huawei Cloud ECS instance — given an ECS ID or ECS name, returns the associated public IP address, EIP ID, status, bandwidth and binding details, using the KooCLI `hcloud EIP ListPublicips` command (primary, filtered by `vnic.device_id`) or the huaweicloudsdkeip Python SDK (fallback). Provides a read-only per-instance EIP lookup for network troubleshooting, cost review and resource discovery. Use this skill whenever the user wants the EIP of a specific ECS. Triggers include: ECS EIP query, EIP of ECS, find ECS public IP, ECS 的EIP, 查询ECS的弹性公网IP, ECS公网IP, ECS绑定的EIP, 单个ECS的eip, 查询ECS的eip, 查看ECS的弹性IP, ECS外网IP, 获取ECS公网地址.
查询华为云账号下指定 Region 的弹性云服务器(ECS)实例列表,输出精简的实例名称 + ID 清单。 适合用于云资源盘点、运维巡检、自动化脚本前置查询。
Query Huawei Cloud ECS CPU, memory, disk, and network metrics through Cloud Eye Service (CES) with hcloud CLI.
Lists Huawei Cloud EIP (Elastic IP, 弹性公网IP) resources — enumerates all EIPs in a region with public IP address, EIP ID, status, bandwidth, associated instance and creation time, using the KooCLI `hcloud EIP ListPublicips` command (primary) or the huaweicloudsdkeip Python SDK (fallback). Provides read-only EIP inventory for network resource auditing, cost review and resource discovery. Use this skill whenever the user mentions EIP list query. Triggers include: list EIPs, EIP list, query EIP, enumerate EIPs, show EIPs, elastic IP list, public IP inventory, 查询弹性公网IP, EIP列表, 弹性公网IP列表, 查看EIP, 列出EIP, 获取EIP列表, 查询EIP, 查询公网IP.
Query the list of Huawei Cloud EVS (Elastic Volume Service) disks under the current tenant / project, focused on the EVS disk NAME list. Returns each disk's name, id, status and size; can also output a pure EVS name-only list. Supports filtering by status, name and pagination (limit/offset). Uses the KooCLI command `hcloud EVS ListVolumes --cli-region={region}` (primary) against the v2 API, or the huaweicloudsdkevs Python SDK (fallback). Read-only — never creates, modifies or deletes any disk. Use this skill whenever the user wants to list/inspect the EVS disks of the tenant or query the EVS disk name list, e.g. for disk inventory, daily inspection, or cost review. Triggers include: "list EVS", "EVS list", "query EVS names", "EVS name list", "云硬盘列表", "查询云硬盘", "EVS磁盘名称", "云硬盘名称", "list volumes", "list elastic volumes", "how many EVS disks".