huawei-cloud-obs-list-pdf
БесплатноЗапускает вложенные скриптыНе проверен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-dev192 установки в других каталогахОб этом скилле
Huawei Cloud OBS Bucket List → PDF 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 .pdf report (reportlab preferred, fpdf2
fallback). The skill is aimed at resource inventory, daily operations patrol,
and PDF-report style deliverables.
The read-only query paradigm (region-aware bucket listing) is shared with the other OBS query skills in this repository; this skill adds the local PDF export layer on top of it.
Architecture:
agent → python3 scripts/list_obs_buckets_pdf.py → hcloud OBS ls [-limit=N] [-e=obs.<region>.myhuaweicloud.com]
→ Huawei Cloud OBS OpenAPI (ListBuckets) → parsed buckets → export_pdf (reportlab/fpdf2) → .pdf / table / json
(hcloud binary missing) → fallback: huaweicloudsdkobs v1 ObsClient.list_buckets
(no PDF backend installed) → 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 PDF 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
huaweicloudsdkobsSDK (list_buckets). Credentials are read from the hcloud/obsutil profile or the SDK environment — never handled by the script. - Well-formed .pdf — a fixed header row (桶名称 / 创建时间 / 区域 / 存储类别 /
桶策略) plus one data row per bucket, with an optional summary row
(
--summary) showing the total bucket count. The PDF is saved via a temporary file + atomic rename, so an interrupted write never leaves a corrupt/partial .pdf behind. - Two PDF backends — reportlab is preferred (renders Chinese with the
built-in CID font
STSong-Light, no external TTF needed); fpdf2 is the fallback when reportlab is unavailable. - 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 .pdf file.
- Offline-testable — every code path (parsing, output modes, PDF 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 PDF file back into OBS.
Prerequisites
- Python 3.8+ with reportlab (or fpdf2) — run
python3 scripts/ensure_env.pyto install it automatically (also installshuaweicloudsdkcore/huaweicloudsdkobsfor the SDK fallback). See references/cli-installation-guide.md. - KooCLI (
hcloud) installed with the obsutil component — see references/cli-installation-guide.md. Alternative:pip install huaweicloudsdkcore huaweicloudsdkobsto enable the SDK fallback path. - obsutil credentials configured out-of-band — the
hcloud OBSmodule 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. - IAM permission — read-only
obs:bucket:list(or theOBS ReadOnlyAccesssystem policy); least-privilege policy in references/iam-policies.md. - Outbound HTTPS access to
obs.<region>.myhuaweicloud.com.
Workflow
- (Optional) prepare the environment —
python3 scripts/ensure_env.pyinstalls any missing dependency (reportlab/fpdf2 + SDK). - Confirm the target region (default
cn-north-4); it selects the OBS endpoint. - Confirm hcloud/obsutil readiness (optional, read-only):
hcloud OBS ls -limit=1(orhcloud version). - Run the script with the desired output mode (
--format pdffor the report,table/jsonotherwise). - Read the result — for
pdf, 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 account's buckets and generate a .pdf report in cwd
python3 scripts/list_obs_buckets_pdf.py
# Specify region and an
Установить huawei-cloud-obs-list-pdf в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл huawei-cloud-obs-list-pdf?
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 `.pdf` report via reportlab (preferred) or fpdf2 (fallback) — 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>.pdf`). 3. Three output modes: `--format pdf` (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 .pdf. 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 生成 PDF", "OBS 桶列表导出 PDF", "obs pdf", "导出 OBS 桶列表为 PDF", "桶列表 PDF 报表", "桶清单 PDF", "OBS bucket list pdf", "export OBS buckets to pdf", "桶报表 PDF". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, parsing, PDF format correctness, empty lists, error classification, SDK fallback, and the write-intent guard.
Как установить скилл huawei-cloud-obs-list-pdf?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл huawei-cloud-obs-list-pdf запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic