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-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
--confirmflag; without it the run stops with a clear message and only prints the request preview.--dry-runpreviews the exact request (including the derivedtrans_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_idis filtered server-side andcustomer_idclient-side (the list API has nocustomer_idparameter). - 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
huaweicloudsdkbssv2. BSS is a global service, so the SDK path usesGlobalCredentials+with_endpoints(https://bss.myhuaweicloud.com). Credentials are resolved byconfig.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
- KooCLI (
hcloud) installed — see references/cli-installation-guide.md. Alternative:pip install huaweicloudsdkcore huaweicloudsdkbssto enable the SDK fallback path. - 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.pyreads the hcloud profile / environment and never echoes or stores secrets. - 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.
- A transferable coupon (
coupon_id) — only Huawei-issued coupons (测试类/商务类/活动类) support transfer; obtain it from the enterprise master account's transferable-coupon list. - Python 3.8+ (standard library only — argparse / json / subprocess / decimal / hashlib).
- Outbound HTTPS access to
bss.myhuaweicloud.com. - Region — BSS is a global service; use
cn-north-1(the default here).
Workflow
- 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. - Resolve the coupon — determine the enterprise sub-account `customer_id
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…