huawei-cloud-ecs-export-excel
БесплатноЗапускает вложенные скриптыНе проверен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-dev337 установок в других каталогахОб этом скилле
Huawei Cloud ECS Instance List → Excel Export
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), with a fallback to the
official huaweicloudsdkecs v2 SDK, and export the result into a local
.xlsx workbook (openpyxl). The skill is aimed at cloud resource inventory,
daily operations patrol, and Excel-report style deliverables.
Architecture:
agent → python3 scripts/list_ecs_export_excel.py → hcloud ECS ListServersDetails --cli-region=<region> --limit=N --offset=O
→ Huawei Cloud ECS OpenAPI (regional endpoint) → parsed JSON servers → export_xlsx (openpyxl) → .xlsx / table / json
(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 (create / delete / update / rebuild / resize / reboot / start / stop / attach / detach ...) are rejected with an explicit message before any command runs. The Excel file is generated on the local filesystem only — no ECS write happens. - CLI first, SDK fallback — KooCLI is the primary execution 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. - Well-formed .xlsx — a fixed header row (名称 / ID / 状态 / 规格 / vCPU /
内存 / 可用区 / 私网IP / 公网IP) plus one data row per instance, with an
optional summary row (
--summary) showing the total instance count. The workbook is saved via a temporary file + atomic rename, so an interrupted write never leaves a corrupt/partial .xlsx behind. - No broken files — an empty instance list, missing credentials or a permission failure print an explicit hint on stdout/stderr and do not produce a .xlsx file.
- Offline-testable — every code path (paging, filters, output modes, xlsx format, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.
Capability boundary: this skill lists 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 the report 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 huaweicloudsdkecsto enable 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.
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. - Run the script with the desired output mode (
--format xlsxfor the worksheet,table/jsonotherwise). - Read the result — for
xlsx, the printed path is the generated report; hand that file/路径 to the user. For table/json, display the result. - Handle the empty / error cases per the Error Handling table below.
Core Commands
# Default: query the region's ECS instances and generate an .xlsx report in cwd
python3 scripts/list_ecs_export_excel.py
# Specify region and an explicit output path (recommended)
python3 scripts/list_ecs_export_excel.py --region cn-north-4 \
--output /tmp/ecs_instances_cn-north-4.xlsx
# Append a summary row (total instance count)
python3 scripts/list_ecs_export_excel.py --summary
# Plain table / JSON for humans / tooling
python3 scripts/list_ecs_export_excel.py --format table
python3 scripts/list_ecs_export_excel.py --format json
# Server-side filters
python3 scripts/list_ecs_export_
Установить huawei-cloud-ecs-export-excel в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл huawei-cloud-ecs-export-excel?
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. Export the instance list into a well-formed local `.xlsx` workbook via openpyxl (headers 名称 / ID / 状态 / 规格 / vCPU / 内存 / 可用区 / 私网IP / 公网IP, optional summary row) — strictly local file generation, nothing is ever written back to the cloud. `--output` sets the file path (default `ecs_instances_<region>_<timestamp>.xlsx`). 3. Three output modes: `--format xlsx` (default) / `table` / `json`. Region aware: `--region` (default cn-north-4). Optional `--status` / `--name` server-side filters and `--page-size` (default 100); paging follows the reported `count`. 4. Explicit error classification: missing AK/SK credentials (「缺少 AK/SK 凭证」), hcloud not installed (falls back to SDK, else a clear hint), invalid/insufficient credentials (403 / 401 → IAM hint), KooCLI usage errors, and generic API/network failures. Empty instance lists produce a friendly hint and never a corrupt .xlsx. 5. Built-in write-intent guard: any mutating intent (create / delete / update / rebuild / resize / reboot / start / stop / attach / detach …) or any operation other than the read-only ListServersDetails is rejected before execution — this skill is strictly read-only. 6. Triggers include: "查询 ECS 生成 Excel", "ECS 实例列表导出 Excel", "ecs excel", "导出 ECS 实例为 Excel", "ECS 实例报表", "云服务器清单 Excel", "ECS instance list excel", "export ECS instances to excel", "ecs 报表". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, paging, xlsx format correctness, empty lists, error classification, SDK fallback, the extra-args injection position, and the write-intent guard.
Как установить скилл huawei-cloud-ecs-export-excel?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл huawei-cloud-ecs-export-excel запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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