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-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-bymaps a friendly field name to a normalized record key;--order asc|descpicks 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);tablefor humans. - CLI first, SDK fallback — KooCLI is the primary path; when the hcloud
binary is absent the script falls back to the official
huaweicloudsdkecsv2 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
- Python 3.8+ with
openpyxl— runpython3 scripts/ensure_env.pyto install it automatically (also installshuaweicloudsdkcore/huaweicloudsdkecsfor the SDK fallback). See references/cli-installation-guide.md. - KooCLI (
hcloud) installed — see references/cli-installation-guide.md. Alternative:pip install huaweicloudsdkcore huaweicloudsdkecsfor the SDK fallback path. - 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.
- IAM permission — read-only
ecs:servers:list(or theECSReadOnlyPolicysystem policy); least-privilege policy in references/iam-policies.md. - 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
- (Optional) prepare the environment —
python3 scripts/ensure_env.pyinstalls any missing dependency (openpyxl / SDK). - Confirm the target region (default
cn-north-4). - Confirm KooCLI readiness (optional, read-only):
hcloud ECS ListServersDetails --cli-region=cn-north-4 --limit=1. - Choose the sort field and direction (
--sort-by/--order); omit--sort-byto keep the original query order. - Run the script with the desired output mode (
--format xlsxfor the worksheet,csv/json/tableotherwise). 6
Установить 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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic