Query the Huawei Cloud BSS (Business Support System) account balance and its history across different time periods, and return a report. Supports three read-only queries: (1) current customer account balance (currency, total debt amount, per-account balances for cash/credit/reward/deposit), (2) balance change records (income/expense detail: recharge, consumption, refund, freeze, etc.) within a user-specified date range, and (3) monthly consumption summary for a user-specified billing cycle (YYYY-MM). Uses the huaweicloudsdkbss Python SDK (show_customer_account_balances, list_customer_account_change_records, show_customer_monthly_sum; v2 API GET /v2/accounts/customer-accounts/balances, /v2/accounts/customer-accounts/account-change-records, /v2/bills/customer-bills/monthly-sum) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_balance_history.py integrates the execution-quality reporting SDK and reports every run to the skillsopr
文档
huawei-cloud-billing-account-balance
试用Query the Huawei Cloud BSS (Business Support System) customer account balance of the current account and return a balance report. Returns the currency, total debt amount, and per-account balances (cash/balance account, credit account, reward account, deposit account) with amounts. Uses the huaweicloudsdkbss Python SDK (`show_customer_account_balances`, v2 API `GET /v2/accounts/customer-accounts/balances`) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_account_balance.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Read-only — never creates, modifies or deletes any billing resource. Use this skill whenever the user wants to check the personal Huawei Cloud account balance, remaining balance, debt, or billing account status, e.g. for cost review, before creating pay-per-use resources, or daily inspection. Triggers include: "账户余额", "余额查询", "查询余额", "账单余额", "我的余额", "欠费",
它能做什么
Query the Huawei Cloud BSS (Business Support System) customer account balance of the current account and return a balance report. Returns the currency, total debt amount, and per-account balances (cash/balance account, credit account, reward account, deposit account) with amounts. Uses the huaweicloudsdkbss Python SDK (`show_customer_account_balances`, v2 API `GET /v2/accounts/customer-accounts/balances`) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_account_balance.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Read-only — never creates, modifies or deletes any billing resource. Use this skill whenever the user wants to check the personal Huawei Cloud account balance, remaining balance, debt, or billing account status, e.g. for cost review, before creating pay-per-use resources, or daily inspection. Triggers include: "账户余额", "余额查询", "查询余额", "账单余额", "我的余额", "欠费", "account balance", "query balance", "billing balance", "balance check", "remaining balance", "debt amount", "账户欠款".
技能文档
Huawei Cloud Billing Account Balance Skill
Overview
This skill queries the customer account balance of the current Huawei Cloud account via the BSS (Business Support System) v2 API and returns a balance report: the billing currency, the total debt amount, and each sub-account balance (cash/balance account, credit account, reward account, deposit account) with its amount. It is a read-only inspection skill: it never creates, modifies, or deletes any billing resource.
Architecture:
Agent → scripts/query_account_balance.py (quality-reporting wrapper)
→ huaweicloudsdkbss Python SDK (BssClient.show_customer_account_balances)
→ Huawei Cloud BSS v2 API
API path (verified from huaweicloudsdkbss v2 SDK _show_customer_account_balances_http_info):
| Operation | Method | API Path |
|---|---|---|
| Show customer account balances | GET | /v2/accounts/customer-accounts/balances |
CLI availability: the KooCLI (
hcloud) does not support the BSS service (hcloud BSSreturns "Unsupported service: BSS"), so this skill uses the Python SDK as its only execution path. Seereferences/cli-installation-guide.mdfor SDK setup.
Execution-quality reporting: every invocation of
scripts/query_account_balance.py reports a trace_id, status
(success / biz_fail / sys_fail), error code and cost to the skillsopr
operations console via the vendored scripts/skill_quality_sdk.py. Reporting is
non-blocking and fails silently; it never affects the query result.
Applicable Scenarios:
- Balance check: "how much balance do I have left in my Huawei Cloud account?"
- Pre-purchase check: confirm enough balance before creating pay-per-use resources
- Debt monitoring: check the total debt amount (
debt_amount) for arrears - Daily inspection: snapshot of all sub-account balances (cash, credit, reward, deposit)
能力边界(Capability Boundary): 本 Skill 仅查询华为云账户余额(BSS 账户余额)。不查询/导出账单明细 (费用账单、流水账单)、不查询资源用量、不执行充值/退款/转账/开票等任何 资金操作,也不查询代金券/优惠券。若用户询问"查询消费明细/账单列表"、 "充值"、"开发票"等,请明确告知本 Skill 不提供该能力。
Prerequisites
- Python 3.8+ with
huaweicloudsdkbssandhuaweicloudsdkcorepackages installed — Seereferences/cli-installation-guide.md - Huawei Cloud AK/SK — provided via environment variables
(
HUAWEI_ACCESS_KEY/HUAWEI_SECRET_KEY, orHUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK). The AK/SK must belong to the account whose balance is queried. Never hardcode credentials into files. - IAM permissions —
bss:balance:view(or the system policyBSS ReadOnlyAccess) is required to query account balances. Seereferences/iam-policies.md - BSS is a global service — no region parameter is required; the SDK must
use
GlobalCredentialswith the endpointhttps://bss.myhuaweicloud.com.
Workflow
- Identify the intent — Confirm the user wants the current Huawei Cloud account balance / debt status.
- Check credentials — Ensure AK/SK environment variables are set for the target account.
- Run the query — Execute the wrapper script (SDK mode, see Core Commands).
- Present the report — Show currency, debt amount, and each sub-account
balance; highlight arrears if
debt_amount > 0. - Handle errors — Missing AK/SK, insufficient IAM permissions, or network failures are reported with a quality error code and a clear message.
Core Commands
Query account balance (default, text report)
python3 scripts/query_account_balance.py
Query account balance as JSON
python3 scripts/query_account_balance.py --format json
Disable quality reporting (local debugging)
SKILL_QUALITY_DISABLE=1 python3 scripts/query_account_balance.py
Parameter Confirmation
| Parameter | Required | Description | Example |
|---|---|---|---|
--format | No | Output format: text (default) or json | json |
--executor | No | Execution mode; sdk is the only supported mode for BSS | sdk |
HUAWEI_ACCESS_KEY | Yes (env) | Huawei Cloud access key | via environment |
HUAWEI_SECRET_KEY | Yes (env) | Huawei Cloud secret key | via environment |
Note: No
--cli-regionis needed — BSS is a global service and KooCLI does not support it. The SDK connects tohttps://bss.myhuaweicloud.com.
Reference Documents
- IAM Policies — Least-privilege IAM permissions
- CLI Installation Guide — Python SDK setup and authentication
- Verification Method — How to verify the skill works
- Dataflow Diagram — Request flow diagram
- Acceptance Criteria — Acceptance test checklist
相关技能
Query the Huawei Cloud account balance (cash/credit account available amount and debt) and the account change records (recharge/consume/refund/adjust) over a configurable time window, defaulting to the last 6 months. Uses the BSS (Business Support System) customer API via the huaweicloudsdkbss SDK, consistent with the console Billing Center. Use when the user wants to: (1) check the current Huawei Cloud account balance, (2) review income/expense records for the last ~half year, (3) verify recharge/consume history, (4) monitor account funds before deployments or renewals. Triggers include: "华为云余额", "账号余额", "账户余额", "查询余额", "余额查询", "近半年流水", "收支明细", "充值记录", "消费记录", "account balance", "Huawei Cloud balance", "balance query", "change records", "spending history", "billing", "BSS"
Query the Huawei Cloud BSS (Business Support System) bills and fees of the current account within ONE billing cycle (one month). Supports three read-only queries: (1) bill fee records (账单费用记录/账单明细) for a billing cycle (YYYY-MM), (2) resource fee records / 流水账单 for a billing cycle, and (3) monthly cost breakdown (月度成本分析). Uses the huaweicloudsdkbss Python SDK (list_customer_bills_fee_records, list_customerself_resource_records, list_customer_bills_monthly_break_down; v2 API GET /v2/bills/customer-bills/fee-records, /v2/bills/customer-bills/res-fee-records, /v2/costs/cost-analysed-bills/monthly-breakdown) — KooCLI does NOT support the BSS service, so the SDK is the only execution path. The shipped scripts/query_bills.py integrates the execution-quality reporting SDK and reports every run to the skillsopr operations console. Time scope is limited to one month (the current month by default) — no multi-month or unbounded range queries. Read-only — never creates, modifies or deletes any bill
Huawei Cloud BSS billing (not AWS/Azure/other clouds; refuses pricing quotes, real-name review, and any non-billing scope): balance, spend, attribution, reconciliation, coupons, stored-value cards, enterprise/partner billing. One-page briefing via hcloud. Use only when the user explicitly mentions 华为云 / Huawei Cloud / BSS and 余额/账单/对账/资源包/代金券/储值卡/企业或伙伴账务; refuses pay, renew, refund, delete.
Queries Huawei Cloud billing and pricing. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource...
Queries Huawei Cloud billing and fee details only when Terraform needs a billing or pricing inquiry. Covers balances, bills, coupons, cash coupons, stored-value cards, orders, refunds, costs, free resources, resource usage, enterprise accounts, and on-demand/period/ELB/NAT/DCS pricing. No write operations. Use this skill only when Terraform requires billing details, invoice/bill summaries, coupon or balance status, refund/order billing status, or pricing inquiry. Triggers: Terraform 账单查询, Terraform 费用查询, Terraform 价格询价, Terraform 询价, Terraform billing query, Terraform pricing inquiry, Terraform price quote, Terraform bill summary.