Command Palette

Search for a command to run...

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

huawei-cloud-voucher-list

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

1. List Huawei Cloud BSS (费用中心) vouchers / coupons of a tenant account through KooCLI (hcloud BSS ListSubCustomerCoupons — read-only GET…

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

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

Huawei Cloud BSS Voucher (Coupon) List

Overview

Query the voucher / coupon list of a Huawei Cloud account through KooCLI hcloud BSS ListSubCustomerCoupons (official read-only GET /v2/promotions/benefits/coupons, verified in the huaweicloudsdkbss v2 client _list_sub_customer_coupons_http_info metadata). The skill is aimed at voucher inventory (代金券盘点), cost management (费用管理), and as a pre-query step for other BSS skills that need a coupon_id.

Architecture:

agent → python3 scripts/list_voucher.py → hcloud BSS ListSubCustomerCoupons --cli-region=<region>
      → Huawei Cloud BSS OpenAPI (global endpoint) → parsed JSON → table / --json / --names-only

(hcloud binary missing) → fallback: huaweicloudsdkbss v2 BssClient.list_sub_customer_coupons

Key properties:

  • Read-only by design — the only API ever invoked is the coupon list (GET). A write-intent guard scans user arguments and validates the operation name; mutating intents (create / delete / reclaim / transfer / adjust / ...) are rejected with an explicit message before any command runs.
  • CLI first, SDK fallback — KooCLI is the primary execution path; when the KooCLI binary is absent, the script falls back to the official huaweicloudsdkbss v2 SDK (list_sub_customer_coupons). BSS is a global service, so the SDK path uses GlobalCredentials + with_endpoints (https://bss.myhuaweicloud.com). Credentials are always read by the CLI profile / SDK environment — never handled by the script.
  • Full-field table output — the default table renders the union of all fields returned by the coupon list, with the numeric status / coupon_type enumerations rendered as human-readable labels.
  • Offline-testable — every code path (paging, filters, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.

Out of scope: every mutating BSS operation (create / reclaim / transfer / retrieve / adjust coupon quotas, claim / send / freeze / cancel coupons). Those require a dedicated write-capable skill and explicit user confirmation.

Prerequisites

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdkbss to enable the SDK fallback path.
  2. Active credential profile — configure credentials out-of-band (hcloud configure in your terminal, or credential environment variables). Never paste AK/SK into chat; the script never reads, echoes, or stores secrets itself — authentication is delegated entirely to the hcloud profile / SDK environment.
  3. IAM permission — read-only bss:coupon:list; least-privilege policy in references/iam-policies.md.
  4. Python 3.8+ (standard library only — argparse / json / subprocess).
  5. Outbound HTTPS access to bss.myhuaweicloud.com.
  6. Region — BSS is a global service; use cn-north-1 (the default here).

Workflow

  1. Confirm the target region (default cn-north-1); the coupon list is region-scoped to the global BSS endpoint.
  2. Confirm hcloud readiness (optional, read-only): hcloud configure list.
  3. Run the list script with the desired output mode and filters.
  4. Read the result — table for humans, --json for downstream tooling, --names-only for a compact inventory.
  5. Handle the empty / error cases per the Error Handling table below (the script prints an explicit hint for empty region, 403, and missing AK/SK).

Core Commands

# Full-field table (default)
python3 scripts/list_voucher.py --region cn-north-1

# Raw JSON of every returned field
python3 scripts/list_voucher.py --json

# Compact voucher (plan-name) list only
python3 scripts/list_voucher.py --names-only

# Filter by voucher status (numeric 1-5 or textual alias; forwarded
# server-side when recognised)
python3 scripts/list_voucher.py --status available
python3 scripts/list_voucher.py --status 2

# Filter by exact voucher ID (server-side query parameter)
python3 scripts/list_voucher.py --coupon-id CP0001

# Filter by plan name / coupon code (client-side: full list fetched, then
# filtered locally — the API has no name parameter)
python3 scripts/list_voucher.py --name spring

# Combine filters
python3 scripts/list_voucher.py --region cn-north-1 --status used --names-only

Equivalent direct KooCLI command (the script wraps exactly this call, with paging):

hcloud BSS ListSubCustomerCoupons --cli-region=cn-north-1 --offset=0 --limit=100

The coupon-list operation is ListSubCustomerCoupons (the underlying GET /v2/promotions/benefits/coupons). ListCoupons is accepted as a read-only alias for the limited voucher-list feature. When hcloud is available, confirm the exact parameter list with hcloud BSS ListSubCustomerCoupons --help.

Parameter Confirmation

| Parameter | Required | Description | Exa

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

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

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

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

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

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

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

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

FAQ

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

1. List Huawei Cloud BSS (费用中心) vouchers / coupons of a tenant account through KooCLI (hcloud BSS ListSubCustomerCoupons — read-only GET /v2/promotions/benefits/coupons), with an automatic fallback to the official huaweicloudsdkbss v2 SDK when hcloud is not installed. 2. Three output modes: full-field table (default, every returned field including 券ID/券码/状态/类型/面额/余额/有效期/促销计划), --json (raw response array), and --names-only (compact voucher / plan-name list). 3. Supports --status / --name / --coupon-id filtering, region override, and automatic offset paging. --coupon-id and --status are real coupon-list query parameters (status accepts 1-5 or textual aliases such as available / used / expired / reclaimed); --name is applied client-side because the API has no name parameter. 4. Explicit error hints for an empty voucher list (「当前区域无 BSS 代金券」), 403 / insufficient IAM permission (「无权限访问 BSS 代金券,请检查 IAM 权限」), missing or invalid AK/SK credentials, and hcloud not installed. 5. Built-in write-intent guard: any mutating intent (create / delete / update / reclaim / transfer / retrieve / adjust / send / freeze / cancel) or any operation other than the read-only coupon list is rejected before execution — this skill is strictly read-only. 6. Triggers include: "代金券盘点", "代金券列表", "查询代金券", "优惠券列表", "费用管理", "list BSS coupons", "list vouchers", "coupon inventory", "voucher list", "华为云代金券", "billing voucher query". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, filters, paging, error scenarios, SDK fallback, and the write-intent guard.

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

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

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

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

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

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