SuperAPI AI Directory

huawei-cloud-voucher-assistant

Office & productivity

View repository

Updated 10-17 03:33

About this skill

[!IMPORTANT] This Skill is the Huawei Cloud "Coupons"purchase discount consultation assistant. When a user is purchasing Huawei Cloud services and wants to know what discounts are available, this Skill uses the authorized Huawei Cloud account permissions (AK/SK) to read coupon balances and details and provide deductible options; when the balance is insufficient, it recommends lower-spec alternatives and a "coupon + cash" combination. Itdoes not place orders directly(order placement is handled by the corresponding service Skill), and it also does not query bills/usage details (that is the responsibility of huawei-cloud-billing-scout ).

Overview

Huawei Cloud Coupon Assistant: when a user is purchasing Huawei Cloud services and wants to know about discounts, read the "Coupon" balance and details and provide the deductible amount; when the balance is insufficient, recommend lower-spec options and combined payment plans.

Scenario Description

This Skill's positioning isdiscount plan consultation at purchase time:

  • Discount query: when a user purchases Huawei Cloud services, query which coupons/discounts can be deducted
  • Insufficient balance recommendation: when the balance is insufficient for full deduction, recommend lower-spec services or a "coupon + cash" combination

Use Cases

  • "I want to buy an ECS, is there any coupon I can use?"
  • "What discount plans are available? How much can the coupon offset?"
  • "How much is left on my Huawei Cloud coupon?"
  • "Which cloud services can this coupon be used for?"
  • "What should I do if the balance is not enough to buy this ECS?"
  • "I want to buy a c7.large.2, is the coupon enough to cover it? If not, what plan do you recommend?"

Prerequisites

  • Python 3.6+(python or python3 in PATH ), pure standard library, zero third-party dependencies
  • Network access:bss.myhuaweicloud.com(BSS)+ devdata.huaweicloud.com(Growth Center fwdo task list)
  • Huawei Cloud AK/SK: environment variables HW_ACCESS_KEY/HW_SECRET_KEY or HUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK
  • HW_DOMAIN_ID(optional): tenant ID (BSS global services require the X-Domain-Id header to participate in signing)
  • The task list (fwdo anonymous) works with zero configuration; coupon queries require AK/SK, and return a prompt when not configured. Analysis-type actions can always run offline (see Data Source)
  • skill-quality-cli — ensured by bash scripts/ensure_cli.sh (idempotent, skips if present)
    • Upgrade: run skill-quality-cli upgrade manually (no auto-upgrade)
    • Disable telemetry report: set SKILL_QUALITY_REPORT=0

All hcloud commands in this skill are wrapped with skill-quality-cli run for telemetry. No manual action required.

Data Source

Dual data sources, automatic selection:

  1. BSS OpenAPI(AK/SK signing): existing coupon account balance/details.
  2. Growth Center frontend API (fwdo anonymous): public task list (zero configuration, no Cookie/CSRF/appcode required). Underlying client:scripts/data/bss_client.py(BSS)、scripts/data/hdcommunity_client.py(fwdo)。

Data reading is implemented throughreplaceable Adapter implementations, with the unified interface defined in scripts/data/。

  • Coupons:coupon_api.py get_adapter() —— with AK/SK → BSS; otherwise → None.
  • Task list:growth_api.py get_adapter() —— fwdo anonymous, always available.
Adapter Responsibility Authentication Status
coupon_api.py BssCouponAdapter Existing coupon account balance/details AK/SK + X-Domain-Id (SDK-HMAC-SHA256 signing) ✅ Connected
growth_api.py HdgrowthWebAdapter Growth Center public task list None (fwdo anonymous) ✅ Connected

Configuration(environment variables):

Environment variable Description Required
HW_ACCESS_KEY / HW_SECRET_KEY Huawei Cloud AK/SK (BSS voucher query) No
HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK Same as above (alternative environment variable name) No
HW_DOMAIN_ID Tenant ID (BSS global services require the X-Domain-Id header for signing) No
HDGROW_WEB_BASE Growth Center web domain, default https://devdata.huaweicloud.com No

BSS voucher query (GET /v2/promotions/benefits/coupons) uses SDK-HMAC-SHA256 signing + X-Domain-Id header, with AK/SK read from environment variables. Voucher deduction requires the BSS order system (specify coupon_id when creating the order). The list of services eligible for vouchers is provided by the local knowledge base references/voucher-taxonomy.md . The fwdo anonymous task list contains only public fields (excluding personal completion status); points balance requires a fwdu login session and is not provided by this skill.

scripts/analyzer.py(analysis layer) is decoupled from the table abovedecoupled, relying only on structured input, and can run offline and be unit-tested.

Core Workflow and Core Commands

Main entry scripts/voucher_assistant.py dispatches by action, action naming follows huawei_<service>_<action>(snake_case)。

Query type (R3, read-only auto-execute)

python scripts/voucher_assistant.py list_vouchers
python scripts/voucher_assistant.py list_tasks
python scripts/voucher_assistant.py recommend_tasks
python scripts/voucher_assistant.py list_voucher_applicable_services

Analysis type (R3, read-only auto-execute, local logic can run without a data source)

python scripts/voucher_assistant.py analyze_voucher_coverage --balance 100 --price 80
python scripts/voucher_assistant.py recommend_discount_plan --balance 50 --price 80 --alt "ecs:c7.large.2:40"

Management type (R2, preview + confirmation, depends on data source integration)

python scripts/voucher_assistant.py apply_voucher --order-ref <ref> --amount <amt> --confirm

When a management-type action isnot connected to a data sourceordoes not include --confirm , it only outputs a preview plan and does not execute any real changes.

Action Reference

Action Level Description
huawei_list_vouchers R3 Voucher balance + details (face value/validity period/status)
huawei_list_tasks R3 Growth Center public task list (fwdo anonymous, zero configuration, includes period type)
huawei_recommend_tasks R3 Recommend tasks worth prioritizing based on points earnings from the task list
huawei_list_voucher_applicable_services R3 Cloud services eligible for vouchers + deduction rules
huawei_analyze_voucher_coverage R3 Determine whether the balance is enough to buy the target service (sufficient/partial/insufficient)
huawei_recommend_discount_plan R3 Recommend low-spec / combined payment options when the balance is insufficient
huawei_apply_voucher R2 Voucher deduction at purchase (preview + confirmation, requires BSS order system)

Decision Flow

购买华为云服务时 → 主动提醒 + 抵扣闭环
   ┌─────────────────────────────────────────────────────┐
   │ 读取代金券余额 (list_vouchers)                       │
   │ ├─ 有可用代金券 → 计算覆盖 → 提醒抵扣 → apply_voucher │
   │ │                             ⚠️ 需 BSS/订单        │
   │ └─ 余额不足 → ① 推荐低规格 ② 现金组合               │
   │              (recommend_discount_plan)               │
   └─────────────────────────────────────────────────────┘

Parameters

Parameter Required Description
action ✅ The above action names (excluding the huawei_ prefix)
--balance Analysis type Voucher balance (analyze_voucher_coverage/recommend_discount_plan, manually passed in when the data source is not connected)
--price Analysis type Target price (required for the same two analysis-type actions)
--alt Analysis type Low-spec alternative service:spec:price, can be specified multiple times (recommend_discount_plan)
--order-ref Deduction type Order/purchase reference (apply_voucher)
--amount Deduction type Deduction amount
--confirm Management type Deduction is executed only with explicit confirmation; by default it is preview only
--top-n Recommendation type Number of recommended tasks to return (recommend_tasks, default 5)

Reference Documentation

Document Description
references/voucher-taxonomy.md Knowledge base of voucher rules/eligible services/deduction rules (local offline)
references/acceptance-criteria.md Acceptance criteria
references/iam-policies.md IAM permission description
references/verification-method.md Verification method

Notes

  • This Skill is anauxiliary decision-maker, and does not place orders directly; ordering is done by the corresponding service Skill.
  • Deduction requires explicit confirmation (--confirm), and the amount must be re-verified and must not exceed the balance.
  • Data sources: ① BSS (AK/SK) to query voucher balance/details; ② fwdo anonymous query of the growth center's public task list (zero configuration). When AK/SK is not configured, voucher queries return a configuration prompt, and the task list is always available. Voucher redemption requires the BSS order system.
  • The list of services eligible for vouchers is provided by references/voucher-taxonomy.md 's local knowledge base (BSS does not directly provide this field).
  • The fwdo anonymous task list contains only public fields (excluding personal completion status/points balance); task cycle types: LIMIT (one-time only) / DAILY / WEEKLY / MONTHLY.