Command Palette

Search for a command to run...

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

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-devот 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 huaweicloudsdkecs v2 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

  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 to enable 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.

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. Run the script with the desired output mode (--format xlsx for the worksheet, table / json otherwise).
  5. Read the result — for xlsx, the printed path is the generated report; hand that file/路径 to the user. For table/json, display the result.
  6. 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_
Полный SKILL.md на ClawHub

Установить 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 запускает скрипты?

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

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

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