Command Palette

Search for a command to run...

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

huawei-cloud-ecs-export-sorted

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

1. List the Huawei Cloud ECS (Elastic Cloud Server) instances of a tenant region through KooCLI (`hcloud ECS ListServersDetails`, the official read-only GET…

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

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

Huawei Cloud ECS Instance List → Sorted Export (xlsx / csv / json)

Overview

Query the ECS instance list of a tenant region through KooCLI hcloud ECS ListServersDetails (official read-only GET /v1/{project_id}/cloudservers/detail), with a fallback to the official huaweicloudsdkecs v2 SDK, sort the result locally by a chosen field (ascending / descending), and export it into a local .xlsx / .csv / .json report. The skill is aimed at cloud resource inventory, daily operations patrol, and Excel/CSV-report style deliverables.

Sorting runs entirely on the locally fetched result set: ListServersDetails has no server-side ordering parameter, so the sort is applied in memory after paging completes. This keeps the query read-only and the ordering deterministic.

Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).

Architecture:

agent → python3 scripts/list_ecs_export_sorted.py
      → hcloud ECS ListServersDetails --cli-region=<region> --limit=N --offset=O
      → Huawei Cloud ECS OpenAPI (regional endpoint)
      → parsed JSON servers → normalize → local sort (--sort-by / --order)
      → export_report (xlsx via openpyxl / csv) → .xlsx / .csv / .json / table

(hcloud binary missing) → fallback: huaweicloudsdkecs v2 EcsClient.list_servers_details
(missing openpyxl)      → run scripts/ensure_env.py  (auto pip install)

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 are rejected with an explicit message before any command runs. Report files are generated on the local filesystem only.
  • Local sorting — --sort-by maps a friendly field name to a normalized record key; --order asc|desc picks the direction. Numeric (vcpus, ram) and timestamp (created) fields compare natively, the rest case-insensitively as text. Records whose sort key is missing/unparseable are always placed last. With no --sort-by, the original query order is preserved.
  • Three export formats — xlsx (default, openpyxl), csv (UTF-8 BOM, Excel friendly), json (normalized records for tooling); table for humans.
  • CLI first, SDK fallback — KooCLI is the primary path; when the hcloud binary is absent the script falls back to the official huaweicloudsdkecs v2 SDK (list_servers_details). Credentials are read from the hcloud profile or the SDK environment — never handled by the script.
  • No broken files — empty lists, missing credentials or a permission failure print an explicit hint and do not produce a report file.
  • Offline-testable — every code path (sorting, formats, paging, filters, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.

Capability boundary: this skill lists and exports instances only. It does not manage instance lifecycle (create/delete/start/stop/reboot/resize/ rebuild), does not export flavors/images/keypairs, and does not write anything back to any cloud service. Those require a separate skill/Issue.

Prerequisites

  1. Python 3.8+ with openpyxl — run python3 scripts/ensure_env.py to install it automatically (also installs huaweicloudsdkcore / huaweicloudsdkecs for the SDK fallback). See references/cli-installation-guide.md.
  2. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdkecs for the SDK fallback path.
  3. KooCLI credentials configured out-of-band — the script never reads, echoes, or stores AK/SK itself; authentication is delegated to the active KooCLI profile. Never paste AK/SK into chat.
  4. IAM permission — read-only ecs:servers:list (or the ECSReadOnlyPolicy system policy); least-privilege policy in references/iam-policies.md.
  5. Outbound HTTPS access to ecs.<region>.myhuaweicloud.com.
  • skill-quality-cli — ensured by bash scripts/ensure_cli.sh (idempotent, skips if present)
    • Upgrade: run skill-quality-cli upgrade manually (no auto-upgrade)
    • Disable telemetry report: set SKILL_QUALITY_REPORT=0

Workflow

  1. (Optional) prepare the environment — python3 scripts/ensure_env.py installs any missing dependency (openpyxl / SDK).
  2. Confirm the target region (default cn-north-4).
  3. Confirm KooCLI readiness (optional, read-only): hcloud ECS ListServersDetails --cli-region=cn-north-4 --limit=1.
  4. Choose the sort field and direction (--sort-by / --order); omit --sort-by to keep the original query order.
  5. Run the script with the desired output mode (--format xlsx for the worksheet, csv / json / table otherwise). 6
Полный SKILL.md на ClawHub

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

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

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

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

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

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

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

FAQ

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

1. List the Huawei Cloud ECS (Elastic Cloud Server) instances of a tenant region through KooCLI (`hcloud ECS ListServersDetails`, the official read-only GET /v1/{project_id}/cloudservers/detail), with an automatic fallback to the official huaweicloudsdkecs v2 SDK (EcsClient.list_servers_details) when hcloud is not installed. 2. Sort the fetched instances **locally** by a chosen field — name / id / status / flavor / vCPU / 内存 / availability_zone / created / privateIps / publicIps (Chinese aliases accepted) — in ascending (`--order asc`) or descending (`--order desc`) order. Numeric and timestamp fields compare natively; records with a missing/unparseable value are always placed last. 3. Export the (optionally sorted) list into a local `.xlsx` workbook (openpyxl), a UTF-8-BOM `.csv`, or structured `.json`; `--format table` prints an aligned full-field table. `--output` sets the file path. Strictly local file generation — nothing is ever written back to the cloud. 4. Region aware: `--region` (default cn-north-4); optional server-side `--status` / `--name` filters and `--page-size` (default 100); paging follows the reported `count`. 5. Explicit error classification (missing AK/SK, invalid credentials / IAM 403, KooCLI usage error, unknown sort field, export failure, network) and a built-in write-intent guard that rejects any mutating ECS intent (create / delete / update / reboot / resize / start / stop / attach / detach …) before a single command runs — this skill is strictly read-only. 6. Triggers include: "ECS 列表导出并排序", "ECS 实例排序导出", "按创建时间排序导出 ECS", "ecs sorted export", "export ECS instances sorted", "ECS 实例报表排序", "sort ecs instances csv", "云服务器清单排序导出".

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

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

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

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

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

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