huawei-cloud-cdn-export-obs
БесплатноЗапускает вложенные скриптыНе проверен1. Query the Huawei Cloud CDN (Content Delivery Network) accelerated-domain list of a tenant through KooCLI (`hcloud CDN ListDomains`, the official read-only…
от wlc-dev194 установки в других каталогахОб этом скилле
Huawei Cloud CDN List → Local Export → OBS Upload
Overview
Query the CDN accelerated-domain list of a tenant through KooCLI
hcloud CDN ListDomains (official read-only GET /v1.0/cdn/domains, verified in
the huaweicloudsdkcdn v1 client _list_domains_http_info metadata), serialize
it to a local file, and upload that file to a user-specified OBS bucket/object
key. The skill is aimed at CDN inventory archiving, daily operations patrol, and
retaining an auditable snapshot of accelerated domains in object storage.
Architecture:
agent → python3 scripts/cdn_export_obs.py --bucket <b> --key <k>
→ list_cdn.list_domains ... hcloud CDN ListDomains --cli-region=<region>
→ export_results.export ... local json / csv / md (atomic write)
→ upload_obs.upload_file ... hcloud OBS cp <local> obs://<bucket>/<key>
→ upload_obs.verify_object hcloud OBS stat obs://<bucket>/<key>
(hcloud missing) → CDN: huaweicloudsdkcdn v1 CdnClient.list_domains
→ OBS: huaweicloudsdkobs v1 ObsClient.put_object / .head_object
(missing SDK) → run scripts/ensure_env.py (auto pip install)
Key properties:
- CDN side is read-only; the only write is the single OBS object upload. A
write-intent guard scans the CDN arguments and validates the operation name;
mutating CDN intents (create / delete / update / enable / disable / refresh /
preheat ...) are rejected before any command runs. On the OBS side, only
cp(upload) andstat/ls(existence / read-back) are allowed — bucket create/delete, object delete/copy/move, ACL/policy changes are refused. - CLI first, SDK fallback — KooCLI is the primary execution path; when the hcloud binary is absent the script falls back to the official SDKs. Credentials are read from the hcloud / obsutil profile or the SDK environment — never handled by the script.
- Overwrite protection by default — the target object is probed with a
read-only
statbefore the upload; if it exists and the user did not pass--overwrite, the upload is refused and no write happens. - Read-back verification by default — the uploaded object is re-read and its
size compared with the local file (
--no-verifyto skip). - Offline-testable — every code path (query, paging, serialization, upload, overwrite protection, verification, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.
Capability boundary: this skill does not manage CDN lifecycle (create / delete / enable / disable a domain, origin or config changes, refresh / preheat tasks) and does not manage OBS buckets or other objects (create/delete a bucket, delete/copy/move an object, ACL/policy/lifecycle). Those require a dedicated write-capable skill and explicit user confirmation.
Prerequisites
- KooCLI (
hcloud) installed with the obsutil component — see references/cli-installation-guide.md. The CDN query uses the KooCLI CDN service; the upload uses the obsutil-backed OBS module. Alternative:pip install huaweicloudsdkcore huaweicloudsdkcdn huaweicloudsdkobsto enable the SDK fallback paths. - Credentials configured out-of-band — the CDN CLI path reads the active hcloud profile; the OBS module reads AK/SK/endpoint from the obsutil config; the SDK fallbacks read AK/SK from whitelisted environment variables. Never paste AK/SK into chat; the script never reads, echoes or stores secrets.
- IAM permission — read-only
cdn:domain:listfor the query andobs:object:put(plusobs:object:getmetadata) for the upload/read-back; least-privilege policy in references/iam-policies.md. - Python 3.8+ (standard library only — argparse / json / csv / subprocess /
os). The SDK fallback needs the official SDKs (install via
ensure_env.py). - Outbound HTTPS access to
cdn.myhuaweicloud.comandobs.<region>.myhuaweicloud.com.
Workflow
- (Optional) prepare the environment —
python3 scripts/ensure_env.pyinstalls any missing SDK dependency. - Confirm the target region (default
cn-north-4) and the local export format (--format json|csv|md). - Confirm the OBS target — a bucket name (
--bucket) is required for the upload step;--keydefaults to the export file name. If no bucket is given, the skill only exports locally. - Run the entry script with optional CDN filters.
- Confirm before overwriting — by default an already-existing target object
is refused; the user must explicitly pass
--overwriteto replace it. - Read the result — the local file path, the object URL, and the read-back
verification outcome are printed (or
--jsonfor tooling). - Handle the empty / error cases per the Error Handling table below.
Core Commands
# Default: query the region's CDN domains, export JSON, upload to
Установить huawei-cloud-cdn-export-obs в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл huawei-cloud-cdn-export-obs?
1. Query the Huawei Cloud CDN (Content Delivery Network) accelerated-domain list of a tenant through KooCLI (`hcloud CDN ListDomains`, the official read-only GET /v1.0/cdn/domains), with an automatic fallback to the official huaweicloudsdkcdn v1 SDK (CdnClient.list_domains) when hcloud is not installed. 2. Serialize the result into a local file — `--format json` (raw array, default) / `csv` (RFC-4180 flat table) / `md` (Markdown table whose first column is 域名) — written atomically (temp file + rename). 3. Upload the result file to a user-specified OBS bucket + object key through KooCLI's obsutil-backed OBS module (`hcloud OBS cp`), with a fallback to the official huaweicloudsdkobs v1 SDK (ObsClient.put_object) when hcloud is absent. 4. Read-back verification by default: after upload the object metadata is re-read (`hcloud OBS stat` / ObsClient.head_object) and its size compared with the local file. 5. Overwrite protection by default: an already-existing target object is refused (exit 1) unless the user explicitly passes `--overwrite`. 6. Explicit error classification: empty domain list is not an error; missing AK/SK, no permission (403), hcloud missing, KooCLI usage errors, bad local output path, and already-existing object are each reported with a dedicated hint. A write-intent guard rejects any mutating CDN operation (create / delete / update / enable / disable / refresh / preheat ...). 7. Triggers include: "CDN 列表导出 OBS", "CDN 域名列表上传 OBS", "查询 CDN 并上传 OBS", "CDN 盘点归档到 OBS", "导出 CDN 加速域名到对象存储", "cdn list export obs", "upload CDN domains to OBS", "archive CDN domains", "华为云 CDN 列表导出". 8. Offline unit tests (mocked hcloud subprocess) cover the CDN query, paging, serialization (json/csv/md), OBS upload, overwrite protection, read-back verification, error classification, SDK fallback, and the write-intent guard.
Как установить скилл huawei-cloud-cdn-export-obs?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл huawei-cloud-cdn-export-obs запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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