Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

huawei-cloud-ecs-list

БесплатноЗапускает вложенные скриптыНе проверен

1. List Huawei Cloud ECS (Elastic Cloud Server) instances in a tenant region through KooCLI (hcloud ECS ListServersDetails — read-only GET…

wlc-devот wlc-dev591 установка в других каталогах

Об этом скилле

Huawei Cloud ECS Instance List

Overview

Query the ECS instance list of a tenant region through KooCLI hcloud ECS ListServersDetails (official read-only GET /v1/{project_id}/cloudservers/detail, verified in the huaweicloudsdkecs v2 client _list_servers_details_http_info metadata). The skill is aimed at cloud resource inventory, daily operations patrol, and as a pre-query step for other ECS skills that need a server_id.

Architecture:

agent → python3 scripts/list_ecs.py → hcloud ECS ListServersDetails --cli-region=<region>
      → Huawei Cloud ECS OpenAPI (regional endpoint) → parsed JSON → table / --json / --names-only
                                                       → stdout only (no file is written)

(hcloud binary missing) → fallback: huaweicloudsdkecs v2 EcsClient.list_servers_details

Key properties:

  • Read-only by design — the only API ever invoked is ListServersDetails (GET). A write-intent guard scans the user arguments and validates the operation name; mutating intents (create / delete / update / rebuild / resize / reboot / start / stop / attach / detach ...) are rejected with an explicit message before any command runs.
  • CLI first, SDK fallback — KooCLI is the primary execution path; when the hcloud binary is absent, the script falls back to the official huaweicloudsdkecs v2 SDK (list_servers_details). Credentials are always read by the CLI profile / SDK environment — never handled by the script.
  • Full-field table output — the default table renders the union of all fields returned by ListServersDetails, with flavor flattened into name/vcpus/ram, addresses split into private/public IPs, and the OS-EXT-AZ:availability_zone attribute surfaced as availability_zone.
  • Stdout only — the script prints to stdout in every mode; it never creates or writes a file.
  • Offline-testable — every code path (paging, filters, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.

Out of scope: every mutating ECS action (create / delete / start / stop / restart / resize flavor / rebuild / attach-detach volume / change image / change password). Those require a dedicated write-capable skill and explicit user confirmation.

Prerequisites

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkecs to enable the SDK fallback path.
  2. Active credential profile — configure credentials out-of-band (hcloud configure in your terminal, or credential environment variables). Never paste AK/SK into chat; the script never reads, echoes, or stores secrets itself — authentication is delegated entirely to the hcloud profile / SDK environment.
  3. IAM permission — read-only ecs:servers:list; least-privilege policy in references/iam-policies.md.
  4. Python 3.8+ (standard library only — argparse / json / subprocess).
  5. Outbound HTTPS access to *.myhuaweicloud.com.

Workflow

  1. Confirm the target region (default cn-north-4); every ECS call is region-scoped.
  2. Confirm hcloud readiness (optional, read-only): hcloud configure list.
  3. Run the list script with the desired output mode and filters.
  4. Read the result — table for humans, --json for downstream tooling, --names-only for a compact inventory. Output is printed to stdout only; the script writes no file.
  5. Handle the empty / error cases per the Error Handling table below (the script prints an explicit hint for empty region, 403, and missing AK/SK).

Core Commands

# Full-field table (default)
python3 scripts/list_ecs.py --region cn-north-4

# Raw JSON of every returned field
python3 scripts/list_ecs.py --json

# Compact instance-name + ID inventory
python3 scripts/list_ecs.py --names-only

# Filter by instance status (server-side ECS query parameter)
python3 scripts/list_ecs.py --status ACTIVE

# Filter by instance name (server-side ECS query parameter, fuzzy)
python3 scripts/list_ecs.py --name ecs-web

# Combine filters
python3 scripts/list_ecs.py --region cn-south-1 --status ACTIVE --names-only

Equivalent direct KooCLI call (the script wraps exactly this operation, with paging) — illustrative, requires KooCLI installed:

hcloud ECS ListServersDetails --cli-region=cn-north-4 --limit=100 --offset=0

Parameter Confirmation

Parameter Required Description Example
--region / -r No Huawei Cloud region (default cn-north-4) cn-south-1
--json No Output the raw server array as JSON —
--names-only No Output instance-name + ID inventory —
--status No Filter by instance state — server-side ECS ListServersDetails parameter ACTIVE, BUILD, ERROR, SHUTOFF, REBUILD, RESIZE
Полный SKILL.md на ClawHub

Установить huawei-cloud-ecs-list в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-ecs-list?

1. List Huawei Cloud ECS (Elastic Cloud Server) instances in a tenant region through KooCLI (hcloud ECS ListServersDetails — read-only GET /v1/{project_id}/cloudservers/detail), with an automatic fallback to the official huaweicloudsdkecs v2 SDK when hcloud is not installed. 2. Output modes: full-field table (default, every returned field including 名称/ID/状态/规格(vCPU/内存)/可用区/私网IP/公网IP), --json (raw response array), and --names-only (compact instance-name + ID inventory). All output goes to stdout only — the script never writes a file. 3. Supports --status / --name server-side filtering (both are real ListServersDetails query parameters), region override, and automatic offset paging. 4. Explicit error hints for empty instance lists (「当前区域无 ECS 实例」), 403 / insufficient IAM permission (「无权限访问 ECS,请检查 IAM 权限」), missing or invalid AK/SK credentials, and hcloud not installed. 5. Built-in write-intent guard: any mutating intent (create / delete / update / rebuild / resize / reboot / start / stop / attach / detach) or any operation other than ListServersDetails is rejected before execution — this skill is strictly read-only. 6. Triggers include: "list ECS instances", "ECS instance list", "ECS 实例列表", "查询ECS实例", "云服务器列表", "ECS inventory", "list cloud servers", "华为云ECS列表". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, filters, paging, error scenarios, SDK fallback, and the write-intent guard.

Как установить скилл huawei-cloud-ecs-list?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-ecs-list запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-ecs-list с