Command Palette

Search for a command to run...

Назад к скиллам
скилл № 29950

huawei-cloud-voucher-claim

1. Claim (领取 / 划拨) an amount of a Huawei Cloud BSS (费用中心) voucher / coupon for an enterprise sub-account through the official BSS API POST…

БесплатноЗапускает вложенные скрипты
wlc-devот wlc-dev318 установок в других каталогах

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

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

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

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

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

Huawei Cloud BSS Voucher Claim (代金券领取 / 企业多账号划拨)

Overview

Claim (领取) an amount of a Huawei Cloud BSS voucher / coupon for an enterprise sub-account through the official BSS enterprise multi-account coupon-transfer operation (ClaimEnterpriseMultiAccountCoupon, service BSS) on the official API, POST /v2/enterprises/multi-accounts/transfer-coupon, verified in the huaweicloudsdkbss v2 client _claim_enterprise_multi_account_coupon_http_info metadata. An enterprise master account transfers (拨款) an amount of one of its coupons to one of its own enterprise sub-accounts — the sub-account thereby claims the coupon. The skill tries the KooCLI path first when the local KooCLI build exposes a BSS service; because the current KooCLI build reports Unsupported service: BSS, the skill runs the official huaweicloudsdkbss v2 SDK (BssClient.claim_enterprise_multi_account_coupon).

After a successful claim the skill runs the read-only coupon-list operation (ListSubCustomerCoupons / GET /v2/promotions/benefits/coupons) and prints the resulting coupon inventory — 券ID / 券码 / 面额 / 余额 / 有效期 / 状态.

Architecture:

agent → python3 scripts/claim_voucher.py --customer-id <c> --coupon-id <cp> --amount <v> --confirm
      → claim path: KooCLI claim operation (service BSS) when available,
                    else huaweicloudsdkbss v2 SDK
      → Huawei Cloud BSS OpenAPI (global endpoint) → sub_coupon_id
      → idempotency ledger (per customer/coupon/amount)
      → read-only ListSubCustomerCoupons (post-claim inventory)
      → human table (券ID/券码/面额/余额/有效期/状态) / --json

Key properties:

  • Write by design, safe by default — a claim transfers money / benefit to the target sub-account and is normally irreversible. A live claim requires the explicit --confirm flag; without it the run stops with a clear message and only prints the request preview. --dry-run previews the exact request (including the derived trans_id) without claiming anything.
  • Idempotent / no double-claim — the API's trans_id (交易序列号) is derived deterministically from (customer_id, coupon_id, amount) when not supplied, so a retry reuses the same serial number and the server rejects a duplicate submission (CBC.99007009). A local ledger records the (customer, coupon, amount) natural key so a retry inside the window does not even call the API.
  • Post-claim inventory — after a successful claim the script queries the read-only coupon list; coupon_id is filtered server-side and customer_id client-side (the list API has no customer_id parameter).
  • CLI first, SDK fallback — KooCLI is the primary execution path; when the KooCLI build does not expose a BSS service (current KooCLI) or the KooCLI binary is absent, the script falls back to huaweicloudsdkbss v2. BSS is a global service, so the SDK path uses GlobalCredentials + with_endpoints (https://bss.myhuaweicloud.com). Credentials are resolved by config.py (KooCLI profile for the CLI path; standard environment variables for the SDK path) — never handled by the skill.
  • Offline-testable — validation, command construction, idempotency, error grading, SDK fallback and all output modes are covered by unit tests that mock the KooCLI subprocess.

Out of scope: coupon queries beyond the post-claim inventory (use the read-only sibling skill), coupon reclaim / return / freeze / cancel, and partner issuance to resold sub-customers (a different BSS operation).

Prerequisites

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdkbss to enable the SDK fallback path.
  2. Credential profile — configure credentials out-of-band (hcloud configure in your terminal, or the standard credential environment variables). Never paste AK/SK into chat; config.py reads the hcloud profile / environment and never echoes or stores secrets.
  3. IAM write permission — the claim action plus the read-only coupon-list action (least-privilege policy in references/iam-policies.md). The calling identity must be the enterprise master account of the target sub-account.
  4. A transferable coupon (coupon_id) — only Huawei-issued coupons (测试类/商务类/活动类) support transfer; obtain it from the enterprise master account's transferable-coupon list.
  5. Python 3.8+ (standard library only — argparse / json / subprocess / decimal / hashlib).
  6. Outbound HTTPS access to bss.myhuaweicloud.com.
  7. Region — BSS is a global service; use cn-north-1 (the default here).

Workflow

  1. Confirm the danger — claiming vouchers is a money-moving, irreversible change. Obtain explicit user confirmation (the caller sets --confirm); the skill refuses to claim without it.
  2. Resolve the coupon — determine the enterprise sub-account `customer_id
Полный SKILL.md на ClawHub

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

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

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

FAQ

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

1. Claim (领取 / 划拨) an amount of a Huawei Cloud BSS (费用中心) voucher / coupon for an enterprise sub-account through the official BSS API POST /v2/enterprises/multi-accounts/transfer-coupon (operation ClaimEnterpriseMultiAccountCoupon) — the KooCLI path is attempted first when the local KooCLI build exposes a BSS service, with an automatic fallback to the official huaweicloudsdkbss v2 SDK otherwise. 2. After a successful claim the skill runs the read-only coupon-list API (ListSubCustomerCoupons — GET /v2/promotions/benefits/coupons) and prints the resulting coupon inventory: 券ID / 券码 / 面额 / 余额 / 有效期 / 状态 (table, --json, or --no-list to skip). 3. Zero-config operation: the invocation path is chosen automatically (CLI first, SDK fallback); credentials are loaded only from the hcloud profile or the standard Huawei Cloud environment variables. 4. Idempotent: the API's trans_id (交易序列号) is derived deterministically from (customer, coupon, amount) so a retry reuses it and the server rejects the duplicate submission (CBC.99007009); a local ledger additionally skips a retry inside the idempotency window. --force overrides, --no-idempotency disables. 5. Safe by default for a money-moving, irreversible operation: a live claim requires the explicit --confirm flag (otherwise the run only previews the request and exits 2); --dry-run previews the exact request. 6. Graded errors: ConfigError (missing/invalid parameters or credentials) / AuthError (401/403 / insufficient IAM permission) / ApiError (unexpected API, network, or duplicate trans_id), each with an actionable hint. 7. Write-intent guard: only the claim operation ever executes; reclaim / transfer-away / freeze / cancel / individually-issued-coupon mutation operations are rejected — this skill claims coupons only. 8. Offline unit tests (mocked hcloud subprocess) cover validation, command construction, idempotency, error grading, SDK fallback and all CLI modes. 9. Triggers include: "领取代金券", "代金券领取", "领取优惠券", "企业子账号领券", "划拨代金券",

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

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

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

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

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

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