Command Palette

Search for a command to run...

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

huawei-cloud-obs-list-excel

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

1. List the OBS (Object Storage Service) buckets of a Huawei Cloud account through the KooCLI obsutil-backed OBS module (`hcloud OBS ls`, the read-only…

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

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

Huawei Cloud OBS Bucket List → Excel Export

Overview

Query the OBS bucket list of a Huawei Cloud account through KooCLI's obsutil-backed OBS module (hcloud OBS ls — the read-only ListBuckets operation), with a fallback to the official huaweicloudsdkobs v1 SDK, and export the result into a local .xlsx workbook (openpyxl). The skill is aimed at resource inventory, daily operations patrol, and Excel-report style deliverables.

Architecture:

agent → python3 scripts/list_obs_buckets_excel.py → hcloud OBS ls [-limit=N] [-e=obs.<region>.myhuaweicloud.com]
      → Huawei Cloud OBS OpenAPI (ListBuckets) → parsed buckets → export_xlsx (openpyxl) → .xlsx / table / json

(hcloud binary missing) → fallback: huaweicloudsdkobs v1 ObsClient.list_buckets
(missing openpyxl)     → run scripts/ensure_env.py  (auto pip install)

Key properties:

  • Read-only by design — the only API ever invoked is ListBuckets (GET). A write-intent guard scans user arguments and validates the operation name; mutating intents (create / delete / upload / download / copy / remove / restore / sync ...) are rejected with an explicit message before any command runs. The Excel file is generated on the local filesystem only — no OBS 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 huaweicloudsdkobs SDK (list_buckets). Credentials are read from the hcloud/obsutil profile or the SDK environment — never handled by the script.
  • Well-formed .xlsx — a fixed header row (桶名称 / 创建时间 / 区域 / 存储类别 / 桶策略) plus one data row per bucket, with an optional summary row (--summary) showing the total bucket 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 bucket 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 (parsing, output modes, xlsx format, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.

Capability boundary: this skill lists buckets only. It does not list objects inside a bucket, does not report bucket quota/usage, and does not export object-level inventories. Those require a separate skill/Issue.

Out of scope: every mutating OBS action (bucket create/delete, object upload/download/copy/delete, ACL/policy/encryption/lifecycle changes) and any write of the Excel file back into OBS.

Prerequisites

  1. Python 3.8+ with openpyxl — run python3 scripts/ensure_env.py to install it automatically (also installs huaweicloudsdkcore / huaweicloudsdkobs for the SDK fallback). See references/cli-installation-guide.md.
  2. KooCLI (hcloud) installed with the obsutil component — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdkobs to enable the SDK fallback path.
  3. obsutil credentials configured out-of-band — the hcloud OBS module reads AK/SK/endpoint from the obsutil config file (~/.obsutilconfig), separate from the KooCLI account profile. Never paste AK/SK into chat; the script never reads, echoes, or stores secrets itself.
  4. IAM permission — read-only obs:bucket:list (or the OBS ReadOnlyAccess system policy); least-privilege policy in references/iam-policies.md.
  5. Outbound HTTPS access to obs.<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); it selects the OBS endpoint.
  3. Confirm hcloud/obsutil readiness (optional, read-only): hcloud OBS ls -limit=1 (or hcloud version).
  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 account's buckets and generate an .xlsx report in cwd
python3 scripts/list_obs_buckets_excel.py

# Specify region and an explicit output path (recommended)
python3 scripts/list_obs_buckets_excel.py --region cn-north-4 \
  --output /tmp/obs_buckets_cn-north-4.xlsx

# Append a summary row (total bucket count)
python3 scripts/list_obs_buckets_excel.py --summary

# Plain table / JSON for humans / tooling
python3 scripts/list_obs_buckets_excel.py --format table
python3 scripts/list_obs_buckets_excel.py --format json

# Cust
Полный SKILL.md на ClawHub

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

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

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

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

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

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

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

FAQ

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

1. List the OBS (Object Storage Service) buckets of a Huawei Cloud account through the KooCLI obsutil-backed OBS module (`hcloud OBS ls`, the read-only ListBuckets operation), with an automatic fallback to the official huaweicloudsdkobs v1 SDK (`ObsClient.list_buckets`) when hcloud is not installed. 2. Export the bucket list into a well-formed local `.xlsx` workbook via openpyxl (headers 桶名称 / 创建时间 / 区域 / 存储类别 / 桶策略, optional summary row) — strictly local file generation, nothing is ever written back to OBS. `--output` sets the file path (default `obs_buckets_<region>_<timestamp>.xlsx`). 3. Three output modes: `--format xlsx` (default) / `table` / `json`. Region aware: `--region` (default cn-north-4) selects the OBS endpoint; optional `--endpoint` overrides it. `--page-size` caps the returned 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 / InvalidAccessKeyId → IAM hint), and generic API/network failures. Empty bucket lists produce a friendly hint and never a corrupt .xlsx. 5. Built-in write-intent guard: any mutating intent (create / delete / upload / download / copy / remove / restore / sync / modify …) or any operation other than the read-only `ls` is rejected before execution — this skill is strictly read-only. 6. Triggers include: "查询 OBS 生成 Excel", "OBS 桶列表导出 Excel", "obs excel", "导出 OBS 桶列表为 Excel", "桶列表报表", "桶清单 Excel", "OBS bucket list excel", "export OBS buckets to excel", "桶报表". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, parsing, xlsx format correctness, empty lists, error classification, SDK fallback, and the write-intent guard.

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

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

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

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

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

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