
Huawei Cloud Billing Scout
- 213 installs
- 19 repo stars
- Updated July 31, 2026
- huaweicloud/huaweicloud-skills
Install and verify Huawei Cloud KooCLI (hcloud) so you can inspect billing and manage cloud services from the terminal.
About
Huawei Cloud Billing Scout centers on getting KooCLI (hcloud)—Huawei’s official CLI for 100+ cloud services—installed, updated, and verified on your machine. Solo builders and small teams use it when they need repeatable terminal access to Huawei Cloud (including billing and account/service operations) instead of clicking through consoles alone. The skill walks through minimum version expectations, the curl-based installer, architecture detection on Linux, and smoke checks like hcloud version and hcloud --help. It fits the Operate phase when you are wiring credentials, confirming the CLI works in CI or on a laptop, and preparing to script cost or resource queries. Intermediate complexity: you should be comfortable with shell, PATH, and cloud access keys. Pair it with your org’s security review before storing AK/SK on developer machines.
- One-click KooCLI install via official hcloud_install.sh (interactive or -y non-interactive)
- Version gate: stay within one major version of latest; verify with hcloud version and update with hcloud update
- Linux aarch64/x86_64 install paths and post-install PATH verification
- Supports managing 100+ Huawei Cloud services through hcloud after configuration
Huawei Cloud Billing Scout by the numbers
- 213 all-time installs (skills.sh)
- +21 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #453 of 1,042 Cloud & Infrastructure skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/huaweicloud/huaweicloud-skills --skill huawei-cloud-billing-scoutAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 213 |
|---|---|
| repo stars | ★ 19 |
| Last updated | July 31, 2026 |
| Repository | huaweicloud/huaweicloud-skills ↗ |
What it does
Install and verify Huawei Cloud KooCLI (hcloud) so you can inspect billing and manage cloud services from the terminal.
Files
Huawei Cloud · How Much Spent & Why Charged · Read-Only Reconciliation
Huawei Cloud Read-Only Billing — Spend, Charges & Reconciliation
Using hcloud ≥7.2.2 and BSS read-only IAM, answer in one conversation: how much spent, why charged, where the difference is, what evidence is still missing. Query only, no modifications, no account operations on behalf of users.
Prerequisites
Prerequisite check: Huawei Cloud CLI (hcloud) >= 7.2.2 required
Runhcloud versionto verify version >= 7.2.2, andhcloud configure listto check profile exists.
Run hcloud configure set --cli-lang=cn — BSS requires Chinese mode.If not installed or version is too low, see references/cli-installation-guide.md for installation guide.
hcloud version
hcloud configure list
hcloud configure set --cli-lang=cnPrinciples
North Star — Any assertion must be reducible to the quadruple "fact × grain × money_basis × scope/billing_period"; irreducible assertions only list gaps, no conclusions.
- Three-Set First — Stop if any of scope, billing_period (time), or money_basis is missing; ask only the point that would change the verification path, no clarification questionnaire.
- Single Fact No Mixing — Monthly summary, resource detail, monthly amortization, and orders are each a distinct fact type with different grains; no cross-summing, no substitution.
- Evidence Boundary Self-Consistent — Each entity only answers questions within its
evidence_boundary; speculation, pending checks, and responsibility judgments must first verify whether evidence falls within the boundary.
Division of Labor
SKILL.md defines behavior; semantic/catalog.yml defines entry points and required context; semantic/billing-ontology.yml defines facts, grains, money_basis, and source_operations; references/related-commands.md defines copyable BSS templates and pagination limits.
Four types of billing questions and routing: see references/semantic/catalog.yml.
Verification Path
Huawei Cloud Gate — Before matching in catalog.yml: if user has not indicated Huawei Cloud / BSS / this skill's billing scope, and cannot be determined from conversation as the Huawei Cloud account for current hcloud profile, first ask one confirmation "Query current configured Huawei Cloud account and billing period?"; without confirmation, no BSS query execution. Non-Huawei Cloud or other cloud vendor billing → only state out of scope, no evidence gathering.
| Phase | Task | Reference File | Forbidden |
|---|---|---|---|
| Lock Money Basis | Lock three-set | catalog.yml → required_context | Ask one at a time if missing, not all together |
| Select Entry Point | Match triggers to get entry_point, obtain ontology_entities | catalog.yml → entry_points | No cross-entry-point summing or borrowing |
| Gather Evidence | Minimal read-only queries within evidence_boundary; first query copy from related-commands.md current entry #### template | billing-ontology.yml + related-commands.md | No --help to discover operations; no self-constructed JSON; no full detail list first |
| Deliver | Conclusion first then facts; conclusion must be reducible to quadruple | This document "Response Requirements" | No sending command process; no transferring investigation burden |
Two defaults and one fixed config only valid during evidence gathering phase:
- Reconciliation — When user has expressed read-only intent, default to current profile and current (or given) billing period, gather evidence per
related-commands.mdreconciliationorder; ask one ID at a time only when blocking ID is missing. - Enterprise / Partner — When ontology requires
customer_idor other prerequisite IDs, first provide read-only acquisition path or one clarification, then make responsibility judgment. - BSS Endpoint — All
hcloud BSScalls require--cli-region=cn-north-1; no substitution with profile or other regions. [Fixed config, non-adjustable]
Hard Constraints (Non-Negotiable)
The following three are derived from principles, non-negotiable.
Read-Only
No write operations that change funds, orders, resources, or identity status; refuse payment, refund, unsubscribe, delete, recovery, create, update, send verification code, change balance. Why: Once a write occurs, the fact state that assertions depend on is contaminated by itself. List*/Show* with Change in name are still read-only ledgers, not in this category.
No Leak
No output of credentials, long identifiers that can restore identity, complete business IDs, profile / region. Why: Identity dimension disclosure exceeds evidence_boundary response scope; delivery value is unrelated to disclosure degree.
No Extrapolation
Pagination, partial time windows, sampling, and zero or low-amount results cannot be stated as whole account, all services, final billing, or no subsequent charges. Why: Grain does not allow amplification; conclusions at local grain cannot be declared as facts at coarser grain unless evidence money_basis already covers entire month.
Response Requirements
Briefing-style delivery: conclusion first, facts later; only write what was found, state money_basis clearly.
- Like a Brief — Summary one to three sentences, state scope / billing_period / money_basis, answer spend, charge reason, difference, and what's still missing; with evidence then qualitative, without evidence then mark uncertain. Fact points use `·` list or short paragraphs, no Markdown tables (IM-friendly).
- Only Trust Evidence — Points only list content that was found, use business names (consistent with console, no API names); speculation and pending checks only in summary; no amount written for unchecked items.
- Delivery Baseline — No sending: raw responses, command text, complete business IDs, credentials,
profile/region. Gaps only provide one read-only next step (business wording), not "please reconcile yourself".
Boundaries
- Service Scope — Only BSS read-only billing (balance/bill/reconciliation/resource package/coupon/stored-value card/enterprise/partner). Non-Huawei Cloud or other cloud vendor billing not in scope.
- Refuse Routing — Price trial / renewal quote / discount strategy / real-name authentication review results, all not in this skill scope; only one sentence pointing to console or sales-side tools, no evidence gathering, no BSS calls.
- Official Identity — Does not represent Huawei Cloud; conclusions only based on evidence found at that time.
- Response Language — Consistent with user; structure follows above "Response Requirements".
- Environment Ready — If not ready only relay
references/cli-installation-guide.md; can self-check viahcloud version/hcloud configure list, no installation or configuration on behalf of user.
References
| Reference | Description |
|---|---|
references/semantic/catalog.yml | Thin routing layer that maps scope/time/money_basis to billing-ontology.yml entities |
references/semantic/billing-ontology.yml | Semantic ontology defining facts, scope, money basis, and read-only BSS operations |
references/related-commands.md | Provides copyable BSS CLI command templates with parameter formats |
references/iam-policies.md | Defines minimum IAM read-only permissions required for BSS queries |
references/cli-installation-guide.md | Huawei Cloud KooCLI Installation Guide |
Huawei Cloud KooCLI Installation Guide
Overview
Huawei Cloud KooCLI (hcloud) is the official Huawei Cloud command-line tool that supports managing 100+ cloud services. This guide provides complete installation, configuration, and verification processes.
Version Requirements
- Minimum version: One major version before the latest major version (e.g., if current is 7.x.x, then not lower than 6.x.x)
- Latest version: Refer to https://support.huaweicloud.com/wtsnew-hcli/index.html
- Verification command:
hcloud version - Update command:
hcloud update
Quick Installation (All Platforms)
One-click Installation
# Download and run official installation script (interactive)
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh
# Non-interactive installation (skip confirmation)
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -yVerify Installation
# Check version
hcloud version
# Expected output: Current KooCLI version: 7.2.2
# Check help
hcloud --helpInstallation Methods for Each Platform
1. Linux Systems
Detect System Architecture
echo $HOSTTYPE
# x86_64: AMD 64-bit system
# aarch64: ARM 64-bit systemStep-by-step Installation
# AMD 64-bit system
curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-linux-amd64.tar.gz"
tar -zxvf huaweicloud-cli-linux-amd64.tar.gz
sudo mv hcloud /usr/local/bin/
# ARM 64-bit system
curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-linux-arm64.tar.gz"
tar -zxvf huaweicloud-cli-linux-arm64.tar.gz
sudo mv hcloud /usr/local/bin/2. macOS Systems
Detect System Architecture
echo $HOSTTYPE
# If empty, use:
uname -a
# x86_64: AMD 64-bit system (Intel chips)
# arm64: ARM 64-bit system (Apple Silicon)Step-by-step Installation
# Intel chips (AMD 64-bit)
curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-mac-amd64.tar.gz"
tar -zxvf huaweicloud-cli-mac-amd64.tar.gz
sudo mv hcloud /usr/local/bin/
# Apple Silicon (ARM 64-bit)
curl -LO "https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-mac-arm64.tar.gz"
tar -zxvf huaweicloud-cli-mac-arm64.tar.gz
sudo mv hcloud /usr/local/bin/3. Windows Systems
Installation Steps
1. Download: https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/huaweicloud-cli-windows-amd64.zip 2. Extract ZIP file to get hcloud.exe 3. Add the directory containing hcloud.exe to PATH environment variable
Verify Installation
hcloud version
# Expected output: Current KooCLI version: 7.2.24. Docker Environment
Using Official Image
# Pull and run
docker run --rm -it swr.cn-north-4.myhuaweicloud.com/huawei-cloud/koocli:latest versionCustom Image
FROM ubuntu:latest
RUN apt-get update -y && apt-get install curl -y
RUN curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -y
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/hcloud"]Build and use:
# Build image
docker build -t hcloudcli .
# Run command
docker run --rm -it hcloudcli versionPost-installation Configuration
Auto-completion Configuration
# Enable auto-completion
hcloud auto-complete on
# Reload shell configuration
# Bash: source ~/.bashrc
# Zsh: source ~/.zshrcMulti-environment Configuration
# Create development environment configuration
hcloud configure init --cli-profile dev
# Create test environment configuration
hcloud configure init --cli-profile test
# Create production environment configuration
hcloud configure init --cli-profile prod
# View all configurations
hcloud configure list
# Use specific configuration
hcloud ECS NovaListServers --cli-profile=dev --cli-region=cn-north-4Troubleshooting
Common Installation Issues
Insufficient Permissions
# Linux/macOS: Use sudo
sudo bash ./hcloud_install.sh
# Or install to user directory
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -d ~/.local/binCommand Not Found
# Check PATH
echo $PATH
which hcloud
# Manually add to PATH
export PATH=$PATH:/usr/local/bin
# Or
export PATH=$PATH:$(pwd)sha256sum Command Not Found
# Ubuntu/Debian:
sudo apt-get install coreutils
# CentOS/RHEL:
sudo yum install coreutils
# macOS:
brew install coreutilsNetwork Issues
# Test network connection
ping cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com
# Use proxy
export http_proxy=http://proxy:port
export https_proxy=http://proxy:portUpdates and Maintenance
Update KooCLI
# Interactive update
hcloud update
# Or reinstall latest version
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh -yUninstall KooCLI
# Linux/macOS manual uninstallation:
sudo rm -f /usr/local/bin/hcloud
sudo rm -rf /usr/local/hcloud/
rm -rf ~/.hcloud/
# Windows manual uninstallation:
# 1. Delete hcloud.exe file
# 2. Remove relevant directory from PATH
# 3. Delete C:\Users\{username}\.hcloud\ directoryClean Cache
# Clean KooCLI cache
rm -rf ~/.hcloud/cache/
# Clean downloaded files
rm -f hcloud_install.sh huaweicloud-cli-*.tar.gz huaweicloud-cli-*.zipBest Practices
Version Management
- Use fixed versions for production environments
- Use latest versions for test environments
- Record installed version numbers
Environment Isolation
- Create independent configurations for different environments
- Use environment variables to store sensitive information
- Regularly backup configuration files
Automated Deployment
#!/bin/bash
set -e
# Download installation script
curl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh
# Install KooCLI
bash ./hcloud_install.sh -y
# Verify installation
hcloud versionDocker Best Practices
# Use volume to persist configuration
docker run --rm -it \
-v ~/.hcloud:/root/.hcloud \
swr.cn-north-4.myhuaweicloud.com/huawei-cloud/koocli:latest \
version
# Create alias to simplify usage
alias hcloud-docker='docker run --rm -it -v ~/.hcloud:/root/.hcloud swr.cn-north-4.myhuaweicloud.com/huawei-cloud/koocli:latest'Version Compatibility
- KooCLI 7.2.2+: Supports
--cli-x-project-idparameter - KooCLI 6.2.4+: Supports
--cli-auth-typeparameter - KooCLI 5.3.4+: Supports SSO configuration parameters
---
Tip: This guide provides complete KooCLI installation and configuration processes. Please strictly follow security rules to protect credential security.
IAM Minimum Permissions
Objective: BSS billing read-only first; product resource read-only only for cross-validation "whether resources currently found in bills can still be queried".
IAM Actions vary by account type, site, and service version. This document provides permission design guidelines; before implementation, refer to IAM Permission Best Practices, API Explorer and hcloud <SERVICE> <Operation> --help.
Permission Layers
| Layer | Purpose | When Needed |
|---|---|---|
| BSS Core Read-Only | Balance, bills, details, costs, orders, coupons, resource packages | Default required |
| Multi-Account Read-Only | Enterprise master/sub-account/associated account billing | When explicitly querying multi-account or enterprise allocation |
| Product Read-Only | Resource existence, status cross-validation | After BSS has located service and resource ID |
Do not add write permissions for payment, renewal, unsubscribe, recovery, create, update, delete, send verification code, transfer, etc.
BSS Core Read-Only
| KooCLI Operation | Read Content |
|---|---|
ShowCustomerAccountBalances | Balance, debt amount |
ShowCustomerMonthlySum | Monthly summary bill |
ListCustomerBillsFeeRecords | Consumption transaction bill |
ListCustomerselfResourceRecords | Resource consumption records |
ListCustomerselfResourceRecordDetails | Resource details, usage details |
ListCustomerBillsMonthlyBreakDown | Monthly amortized cost |
ListCustomerAccountChangeRecords | Cash/credit account transactions |
ListCustomerCouponChangeRecords | Coupon transactions |
ListStoredValueCards | Stored-value card list |
ListCustomerOrders | Order list |
ShowCustomerOrderDetails | Order details |
ShowRefundOrderDetails | Unsubscribe/refund order evidence |
ListOrderCouponsByOrderId | Order available coupons |
ListOrderDiscounts | Order available discounts |
ListFreeResourceInfos | Resource package list |
ListFreeResourceUsages | Resource package remaining quota |
ListFreeResourcesUsageRecords | Resource package deduction details |
ListCosts | Cost analysis |
ListResourceUsageSummary | CDN/OBS/IEC/VPC usage summary |
ListResourceUsage | CDN/OBS/IEC/VPC resource usage details |
ListQuotaCoupons | Partner coupon quota |
ListIssuedCouponQuotas | Issued coupon quota |
ListCouponQuotasRecords | Coupon quota operation records |
ListIssuedPartnerCoupons | Issued coupons |
ListPartnerCouponsRecord | Coupon issue/recovery records |
ListSubCustomerCoupons | Partner own coupons |
ListServiceTypes | Cloud service type dictionary |
ListResourceTypes | Resource type dictionary |
ListUsageTypes | Usage type dictionary |
ListMeasureUnits | Measurement unit dictionary |
ListConversions | Measurement unit conversion |
ListServiceResources | Service to resource type relation |
ListProvinces | Province dictionary |
ListCities | City dictionary |
ListCounties | District/county dictionary |
Policy skeleton (illustrative; before implementation, refer to actual Actions in IAM console/API Explorer):
{
"Version": "1.1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bss:*:get",
"bss:*:list"
],
"Resource": "*"
}
]
}If IAM does not accept wildcard read-only Actions, explicitly list query Actions according to actual API. Do not use write operations to supplement permissions.
Multi-Account Read-Only
Only use when enterprise master/sub-account relationship and authorization are established; regular accounts may return 403. Partner/resale interfaces also require confirmation of authorization relationship and account scope; cannot automatically expand from current account to customer list.
| Operation | Purpose |
|---|---|
ListEnterpriseOrganizations | Enterprise organization structure |
ListEnterpriseSubCustomers | Enterprise sub-account list |
ListEnterpriseMultiAccount | Enterprise sub-account recoverable balance; requires balance_type, sub_customer_id |
ShowMultiAccountTransferAmount | Enterprise master transferable balance |
ListMultiAccountTransferCoupons | Enterprise master transferable coupons |
ListMultiAccountRetrieveCoupons | Enterprise sub-account recoverable coupons |
ListConsumeSubCustomers | Sub-customers with consumption |
ListSubcustomerMonthlyBills | Sub-customer monthly bills |
ListSubCustomerBillDetail | Sub-customer bill details |
ListSubCustomers | Partner customer list |
ListSubCustomerNewTag | Customer new customer tag |
ListCustomerOnDemandResources | Resale customer on-demand resources |
ListPayPerUseCustomerResources | Annual/monthly package resources |
ListCustomersBalancesDetail | Resale customer balance |
ListPartnerBalances | Partner/reseller balance |
ListPartnerAccountChangeRecords | Partner transaction records |
ListPartnerAdjustRecords | Partner adjustment records |
ListIndirectPartners | Secondary reseller list |
Financially independent sub-accounts, partners, and resale customers have additional constraints. When interface returns no permission, do not bypass or expand query.
Product Read-Only
Product APIs are only used for cross-validation, not as billing fact source.
| Service | Read-Only Example |
|---|---|
| ECS | Cloud server List/Show |
| EVS | Cloud disk List/Show |
| EIP/VPC | Elastic IP, bandwidth, VPC, subnet List/Show |
| OBS | Bucket, usage, statistics query |
| CDN | Domain, traffic, bandwidth statistics query |
| RDS | Instance List/Show |
| DCS | Cache instance List/Show |
| LTS | Log group, log stream List/Show |
| CBR | Repository, backup List/Show |
| ELB/NAT | Load balancer, listener, NAT gateway List/Show |
If product API cannot find resource, it only indicates "current API did not find". Bill may still come from historical billing period, delayed billing, sub-resource, shared bandwidth, backup, snapshot, traffic, marketplace, or projects not supporting enterprise project aggregation.
Permission Failure Handling
| Phenomenon | Handling |
|---|---|
403 Forbidden | Record operation name, account scope, interface family; suggest supplementing minimum read-only permission |
| Sub-account data empty | Check enterprise master/sub-account authorization relationship and method parameter |
| Dictionary cannot find service name | Keep original code, prompt need to check official service type dictionary |
| Product resource not found | Return to BSS bill evidence, do not infer bill error |
Command Contract Appendix
This document only retains operation contracts: purpose, required fields, templates, and limits. Routing see semantic/catalog.yml (required_context; triggers as auxiliary, full triggers/refusal see SKILL.md), semantic boundary see semantic/billing-ontology.yml entity evidence_boundary.
Command Format Standard
Service name always `BSS` — Do not use account, bill or other hcloud sub-services; balance, bills, reconciliation are all under BSS List* / Show*.
Core format: hcloud BSS <Operation> --param=value --cli-region=<region> --cli-output=json (<Operation> must be operation name in current entity source_operations)
Format Rules
| Element | Format | Example |
|---|---|---|
| Service name | Fixed BSS | hcloud BSS ShowCustomerAccountBalances |
| Operation name | List* / Show* | ListCosts, ShowCustomerMonthlySum |
| Regular parameter | --key=value | --bill_cycle=2024-12, --limit=10 |
| Array parameter | --key.1=value1 | --resource_ids.1=<resource_id> |
| Nested object | --key.sub_key=value | --time_condition.begin_time=2024-12-01 |
Global Constraints
- Command whitelist — Consistent with current entity
source_operations; onlyhcloud BSS <Operation>. First query must copy this document####template; if no template then stop. Do not use--helpto discover op or construct parameters; if template still errors, can use--helpfor that op only to verify fields (seeSKILL.mdverification path). - Only execute
List*/Show*;List*/Show*withChangein name are still read-only queries (e.g., account/coupon transactions), not write operations. - Refuse payment, renewal, refund, unsubscribe, recovery, create, update, delete, send verification code, change balance or resources.
- Default
limit<=10,offset=0; find prerequisite IDs at most recent 3 billing periods, 3 pages per command,limit<=50per page. - Array and object parameters only use verified dot notation; if no template then stop, do not try JSON strings.
- Account, customer, resource, order, transaction, coupon, card, partner IDs default desensitized.
customer_billing
| Operation | Purpose | Required | Note |
|---|---|---|---|
ShowCustomerAccountBalances | Balance, debt, account composition snapshot | - | Current profile first query; see template |
ShowCustomerMonthlySum | Monthly consumption summary | bill_cycle | Full account billing period overview; cannot filter by enterprise project (enterprise project ranking use ListCosts) |
ListCustomerBillsFeeRecords | Billing period transaction, payment status, transaction reconciliation | bill_cycle | Cost center transaction side; billing period must be same month; see template |
ListCustomerselfResourceRecords | Locate continuously charging resources | cycle | Resource ID default desensitized |
ListCustomerselfResourceRecordDetails | Resource detail daily level | cycle | Export bill/resource detail side; see template; may have precision difference with summary |
ListCustomerBillsMonthlyBreakDown | Monthly amortization | shared_month | Recent 18 months; non-cash deduction basis |
ListCustomerAccountChangeRecords | Account transaction | balance_type | Read-only; not applicable for partner resale customers |
ListStoredValueCards | Stored-value card status and face value | status | Card ID default desensitized |
cost_and_usage
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListCosts | Cost analysis aggregation, TopN, trend | See template | amount_type/cost_type use string enum; operator=0 include, 1 exclude |
ListResourceUsageSummary | CDN/OBS/IEC/VPC usage summary | See template | 95 billing and usage verification |
ListResourceUsage | Resource usage details | See template | First get resource and usage type from summary or detail |
cost_and_usage Example Templates
ListCosts enums: amount_type = PAYMENT_AMOUNT (payable) or NET_AMOUNT (paid); cost_type = ORIGINAL_COST or AMORTIZED_COST. Filter keys: REGION_CODE, ENTERPRISE_PROJECT_ID (not ENTERPRISE_PROJECT). Filter empty → write "no records for that project/condition"; Prohibited: remove filter to query full account ranking.
ListCosts
By region (billing period 2025-04):
hcloud BSS ListCosts \
--amount_type=PAYMENT_AMOUNT \
--cost_type=ORIGINAL_COST \
--time_condition.begin_time=2025-04-01 \
--time_condition.end_time=2025-04-30 \
--time_condition.time_measure_id=1 \
--groupby.1.key=CLOUD_SERVICE_TYPE \
--groupby.1.type=dimension \
--filters.1.filter_factor.key=REGION_CODE \
--filters.1.filter_factor.value.1=cn-north-1 \
--filters.1.operator=0 \
--cli-region=<region> \
--cli-output=json \
--limit=10 \
--offset=0By enterprise project + cloud service ranking (EP-FINANCE example):
hcloud BSS ListCosts \
--amount_type=PAYMENT_AMOUNT \
--cost_type=ORIGINAL_COST \
--time_condition.begin_time=2025-04-01 \
--time_condition.end_time=2025-04-30 \
--time_condition.time_measure_id=1 \
--groupby.1.key=CLOUD_SERVICE_TYPE \
--groupby.1.type=dimension \
--filters.1.filter_factor.key=ENTERPRISE_PROJECT_ID \
--filters.1.filter_factor.value.1=EP-FINANCE \
--filters.1.operator=0 \
--cli-region=<region> \
--cli-output=json \
--limit=10 \
--offset=0ShowCustomerAccountBalances
Balance/debt first query:
hcloud BSS ShowCustomerAccountBalances \
--cli-region=<region> \
--cli-output=jsonListCustomerBillsFeeRecords
Cost center billing period transaction (reconciliation transaction side):
hcloud BSS ListCustomerBillsFeeRecords \
--bill_cycle=2025-04 \
--cli-region=<region> \
--cli-output=json \
--limit=10 \
--offset=0ListCustomerselfResourceRecordDetails
Export resource details (reconciliation export side):
hcloud BSS ListCustomerselfResourceRecordDetails \
--cycle=2025-04 \
--cli-region=<region> \
--cli-output=json \
--limit=10 \
--offset=0reconciliation (Minimum Read-Only Sequence)
Default current profile; if billing period not given use current billing period (delivery summary states clearly). Recommended sequence:
1. ListCustomerBillsFeeRecords — Cost center billing period transaction. 2. ListCustomerselfResourceRecordDetails — Same month resource details. 3. If still cannot connect difference, then query ListCustomerOrders / ShowCustomerOrderDetails.
Insufficient evidence no blame; do not use ShowCustomerMonthlySum to replace this sequence.
discount_entitlement
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListFreeResourceInfos | Resource package list | - | Array parameters only use .1, .2 increment; see template below |
ListFreeResourceUsages | Resource package remaining quota | free_resource_ids.1 | Usually no pagination; see template below |
ListFreeResourcesUsageRecords | Package deduction details | See template | Span ≤90 days |
ListCustomerCouponChangeRecords | Coupon transaction | balance_type | Coupon ID, transaction ID default desensitized |
ListQuotaCoupons | Partner coupon quota | - | Read-only quota; see template below |
ListIssuedCouponQuotas | Issued coupon quota | - | Master reseller scenario |
ListCouponQuotasRecords | Coupon quota operation records | - | Read-only records |
ListIssuedPartnerCoupons | Issued coupons | - | Coupon ID, customer ID default desensitized |
ListPartnerCouponsRecord | Coupon issue/recovery records | - | Read-only records; see template below |
ListSubCustomerCoupons | Partner own coupons | - | Read-only |
ListOrderCouponsByOrderId | Order available coupons | order_id | Near payment, read-only explanation |
discount_entitlement Example Templates
ListFreeResourceInfos
hcloud BSS ListFreeResourceInfos \
--service_type_code_list.1=hws.service.type.obs \
--cli-region=<region> \
--cli-output=jsonListFreeResourceUsages
hcloud BSS ListFreeResourceUsages \
--free_resource_ids.1=<free_resource_id> \
--cli-region=<region> \
--cli-output=jsonListQuotaCoupons
hcloud BSS ListQuotaCoupons \
--quota_ids.1=<quota_id> \
--quota_status_list.1=0 \
--cli-region=<region> \
--cli-output=jsonListPartnerCouponsRecord
hcloud BSS ListPartnerCouponsRecord \
--coupon_ids.1=<coupon_id> \
--operation_types.1=1 \
--cli-region=<region> \
--cli-output=jsonorder_evidence
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListCustomerOrders | Order list | - | Only query evidence, do not guide payment |
ShowCustomerOrderDetails | Order details | order_id | Order ID default desensitized |
ShowRefundOrderDetails | Unsubscribe/downgrade refund details | order_id | Only explain refund evidence, do not execute unsubscribe refund |
ListOrderDiscounts | Order available discounts | order_id | Near payment, read-only explanation |
enterprise_multi_account
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListEnterpriseOrganizations | Enterprise organization structure | - | Enterprise master account scenario |
ListEnterpriseSubCustomers | Enterprise sub-account list | - | Sub-account ID default desensitized |
ListEnterpriseMultiAccount | Sub-account recoverable balance | See template | Read-only; do not recover |
ShowMultiAccountTransferAmount | Master account transferable | balance_type | Read-only; do not transfer |
ListMultiAccountTransferCoupons | Master account transferable coupons | - | Read-only; do not issue |
ListMultiAccountRetrieveCoupons | Sub-account recoverable coupons | sub_customer_id | Read-only; do not recover |
ListConsumeSubCustomers | Sub-customers with consumption | bill_cycle | Enterprise/partner entry |
ListSubcustomerMonthlyBills | Sub-customer monthly bills | cycle, charge_mode | Customer ID desensitized |
ListSubCustomerBillDetail | Sub-customer details | bill_cycle, customer_id | First confirm authorization |
partner_resale
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListSubCustomers | Partner customer list | - | Customer information sensitive, default summary |
ListSubCustomerNewTag | New customer tag | - | Read-only; see template |
ListCustomerOnDemandResources | Resale on-demand resources | customer_id | Resource ID desensitized; see template |
ListPayPerUseCustomerResources | Annual/monthly package resources | - | Historical naming; see template |
ListCustomersBalancesDetail | Resale balance | See template | Sensitive; see template |
ListPartnerBalances | Partner/reseller balance | - | Partner perspective |
ListPartnerAccountChangeRecords | Partner transaction records | balance_type | Read-only transaction |
ListPartnerAdjustRecords | Partner adjustment records | - | Read-only records; do not execute transfer or recovery |
ListIndirectPartners | Secondary reseller list | - | Master reseller scenario |
partner_resale Example Templates
ListSubCustomerNewTag
hcloud BSS ListSubCustomerNewTag \
--customer_ids.1=<customer_id> \
--cli-region=<region> \
--cli-output=jsonListCustomerOnDemandResources
hcloud BSS ListCustomerOnDemandResources \
--customer_id=<customer_id> \
--resource_ids.1=<resource_id> \
--cli-region=<region> \
--cli-output=jsonListPayPerUseCustomerResources
hcloud BSS ListPayPerUseCustomerResources \
--resource_ids.1=<resource_id> \
--status_list.1=2 \
--cli-region=<region> \
--cli-output=jsonListCustomersBalancesDetail
hcloud BSS ListCustomersBalancesDetail \
--customer_infos.1.customer_id=<customer_id> \
--cli-region=<region> \
--cli-output=jsonreference_dimensions
| Operation | Purpose | Required | Note |
|---|---|---|---|
ListServiceTypes | Cloud service type dictionary | - | Translate service_type_code |
ListResourceTypes | Resource type dictionary | - | Translate resource_type_code |
ListUsageTypes | Usage type dictionary | - | Translate usage_type |
ListMeasureUnits | Measurement unit dictionary | - | Translate amount and usage units |
ListConversions | Measurement unit conversion | - | For unit conversion |
ListServiceResources | Service to resource type relation | service_type_code | Service/resource mapping dictionary |
ListProvinces | Province dictionary | - | Partner sales platform geography |
ListCities | City dictionary | province_code | Partner sales platform geography |
ListCounties | District/county dictionary | city_code | Partner sales platform geography |
Out of Scope (Refuse Routing)
| Category | Refuse Reason | Alternative |
|---|---|---|
| Price trial / renewal quote / discount strategy | Not billed fact; pricing cannot be used as deduction evidence | Console price calculator or sales-side pricing tool |
| Real-name authentication review result | Identity dimension not within BSS billing boundary | Console account center |
| Non-Huawei Cloud billing | Only serve Huawei Cloud BSS | Corresponding cloud vendor tool |
Product-Side Read-Only Cross-Validation
BSS is billing fact source. Product API only answers "whether resource can currently be found", does not overturn historical bill; Only after BSS has clues, then query product-side List / Show / Get.
name: BillingOntology
type: semantic_ontology
description: 事实、粒度、金额口径、只读 source_operations;查证流与答复纪律见 SKILL.md。
default_scope:
account: 当前 KooCLI profile
method: oneself
time_window: 最小可答范围
money_basis:
billed: [consume_amount, official_amount, discount_amount]
paid: [cash_amount, credit_amount, coupon_amount, stored_value_card_amount]
outstanding: [debt_amount]
amortized: [amortized_cost]
protected_identifiers:
- account_id
- customer_id
- sub_customer_id
- indirect_partner_id
- resource_id
- order_id
- trade_id
- coupon_id
- quota_id
- card_id
entities:
- name: AccountBalance
kind: fact
domain: customer_billing
source_operations: [BSS/ShowCustomerAccountBalances]
grain: 账户×时点
summary: 余额、欠费、账户构成
dimensions: [account_type, currency]
measures: [amount, debt_amount]
evidence_boundary: 时点快照;非扣因归因
- name: MonthlyBillSummary
kind: fact
domain: customer_billing
source_operations: [BSS/ShowCustomerMonthlySum]
grain: 账期×服务×资源类型×计费模式
summary: 月/上月花费、服务或项目汇总
required_context: [bill_cycle]
dimensions: [bill_cycle, service_type_code, resource_type_code, charging_mode, bill_type]
measures: [consume_amount, cash_amount, coupon_amount, debt_amount]
evidence_boundary: 账期汇总;非详单/订单
- name: BillingStatement
kind: fact
domain: customer_billing
source_operations: [BSS/ListCustomerBillsFeeRecords]
grain: 账期流水行
summary: 账单、交易、支付、对账差异
required_context: [bill_cycle]
dimensions: [bill_cycle, bill_date, service_type_code, resource_type_code, trade_id, status]
measures: [official_amount, consume_amount, cash_amount]
evidence_boundary: 流水证据;非资源存续
- name: ResourceBillRecord
kind: fact
domain: customer_billing
source_operations: [BSS/ListCustomerselfResourceRecords]
grain: 资源消费记录
summary: 持续扣费资源定位
required_context: [cycle]
dimensions: [cycle, bill_date, cloud_service_type, resource_type, resource_id, region, enterprise_project_id, charge_mode]
measures: [amount, usage, free_resource_usage]
evidence_boundary: 资源级扣费;非日级详单
- name: ResourceBillDetail
kind: fact
domain: customer_billing
source_operations: [BSS/ListCustomerselfResourceRecordDetails]
grain: 资源详单行
summary: 日级/用量级下钻
required_context: [cycle]
dimensions: [cycle, bill_date, res_instance_id, cloud_service_type, region, enterprise_project_id, resource_type_code, charge_mode, bill_type]
measures: [consume_amount, cash_amount, coupon_amount, debt_amount]
evidence_boundary: 账单行解释;行合计可与汇总有精度差
- name: AccountChangeRecord
kind: fact
domain: customer_billing
source_operations: [BSS/ListCustomerAccountChangeRecords]
grain: 现金/授信/储值交易
summary: 账户收支流水
required_context: [balance_type]
dimensions: [balance_type, trade_time, trade_type, revenue_expense_type, trade_id]
measures: [amount]
evidence_boundary: 结算流水;非资源消费归因
- name: StoredValueCard
kind: fact
domain: customer_billing
source_operations: [BSS/ListStoredValueCards]
grain: 储值卡
summary: 卡状态、有效期、面额
dimensions: [card_id, status, effective_time, expire_time]
measures: [amount]
evidence_boundary: 卡状态;非单笔消费来源
- name: CostAnalysis
kind: fact
domain: cost_and_usage
source_operations: [BSS/ListCosts]
grain: 时间桶×分组维度
summary: 成本 TopN、趋势、聚合归因
required_context:
- amount_type
- cost_type
- time_condition.begin_time
- time_condition.end_time
- time_condition.time_measure_id
- groupby.1.key
- groupby.1.type
dimensions: [time_condition, amount_type, cost_type, groupby]
measures: [cost]
evidence_boundary: 聚合视图;非流水/详单
- name: AmortizedCost
kind: fact
domain: cost_and_usage
source_operations: [BSS/ListCustomerBillsMonthlyBreakDown]
grain: 摊销月×服务/资源/账号
summary: 摊销 vs 现金扣费
required_context: [shared_month]
dimensions: [shared_month, service_type_code, resource_type_code, resource_id, enterprise_project_id]
measures: [amortized_cost, cash_amount]
evidence_boundary: 摊销口径;非当月现金流水
- name: ResourceUsage
kind: fact
domain: cost_and_usage
source_operations: [BSS/ListResourceUsageSummary, BSS/ListResourceUsage]
grain: 用量汇总或明细行
summary: CDN/OBS/IEC/VPC 流量带宽与 95 计费
required_context:
summary: [bill_cycle, service_type_code, resource_type_code, usage_type]
detail: [bill_cycle, service_type_code, resource_type_code, usage_type, resource_id]
dimensions: [bill_cycle, service_type_code, resource_type_code, usage_type, resource_id]
measures: [usage, measure_id]
evidence_boundary: 用量非费用;金额回账单/成本/详单
- name: FreeResourcePackage
kind: fact
domain: discount_entitlement
source_operations:
- BSS/ListFreeResourceInfos
- BSS/ListFreeResourceUsages
- BSS/ListFreeResourcesUsageRecords
grain: 资源包/余量/抵扣记录
summary: 资源包库存、余量、抵扣
dimensions: [product_id, product_name, status, effective_time, expire_time, free_resource_id]
measures: [amount, original_amount]
evidence_boundary: 包可抵扣性;账单需连详单/流水
- name: CouponChangeRecord
kind: fact
domain: discount_entitlement
source_operations: [BSS/ListCustomerCouponChangeRecords]
grain: 代金券交易
summary: 券消费/回收/过期
required_context: [balance_type]
dimensions: [balance_type, coupon_id, trade_time, trade_type, revenue_expense_type, trade_id]
measures: [amount]
evidence_boundary: 券流水;非订单折扣/资源包
- name: CouponQuota
kind: fact
domain: discount_entitlement
source_operations:
- BSS/ListQuotaCoupons
- BSS/ListIssuedCouponQuotas
- BSS/ListCouponQuotasRecords
- BSS/ListIssuedPartnerCoupons
- BSS/ListPartnerCouponsRecord
- BSS/ListSubCustomerCoupons
grain: 券额度/发放/操作记录
summary: 伙伴券额度、发放、客户券
dimensions: [coupon_id, quota_id, customer_id, status, operation_time]
measures: [quota_amount, coupon_amount]
evidence_boundary: 只读额度记录;不发放/回收/抵扣
- name: OrderEvidence
kind: fact
domain: order_evidence
source_operations:
- BSS/ListCustomerOrders
- BSS/ShowCustomerOrderDetails
- BSS/ShowRefundOrderDetails
- BSS/ListOrderCouponsByOrderId
- BSS/ListOrderDiscounts
grain: 订单/退款/券/折扣证据
summary: 订单、退款、降配、订单侧折扣
dimensions: [order_id, customer_id, service_type_code, status]
measures: [order_amount, refund_amount, discount_amount]
evidence_boundary: 交易来源;消费归因回账单
- name: EnterpriseAndPartnerContext
kind: scope
domain: account_scope
summary: 企业/伙伴/代售范围与授权边界
subentities: [EnterpriseAccountContext, EnterpriseBilling, PartnerAccountContext, PartnerBilling]
evidence_boundary: 权限失败≠账务不存在;仅范围/授权不足
- name: EnterpriseAccountContext
kind: scope_fact
domain: account_scope
source_operations:
- BSS/ListEnterpriseOrganizations
- BSS/ListEnterpriseSubCustomers
- BSS/ListEnterpriseMultiAccount
- BSS/ShowMultiAccountTransferAmount
- BSS/ListMultiAccountTransferCoupons
- BSS/ListMultiAccountRetrieveCoupons
grain: 组织/子客户/拨款/可回收券
summary: 企业主可查组织与子账号范围
- name: EnterpriseBilling
kind: scope_fact
domain: account_scope
source_operations:
- BSS/ListConsumeSubCustomers
- BSS/ListSubcustomerMonthlyBills
- BSS/ListSubCustomerBillDetail
grain: 子客户账单汇总或明细
summary: 企业子账号账单与分摊
- name: PartnerAccountContext
kind: scope_fact
domain: account_scope
source_operations:
- BSS/ListSubCustomers
- BSS/ListSubCustomerNewTag
- BSS/ListIndirectPartners
- BSS/ListCustomerOnDemandResources
- BSS/ListPayPerUseCustomerResources
- BSS/ListCustomersBalancesDetail
- BSS/ListPartnerBalances
grain: 伙伴客户/经销商/标签/资源/余额
summary: 伙伴/代售可查询对象
- name: PartnerBilling
kind: scope_fact
domain: account_scope
source_operations: [BSS/ListPartnerAccountChangeRecords, BSS/ListPartnerAdjustRecords]
grain: 伙伴流水或调账
summary: 伙伴流水、调账、客户侧收支
- name: ReferenceDimensions
kind: dimension_catalog
domain: reference_dimensions
source_operations:
- BSS/ListServiceTypes
- BSS/ListResourceTypes
- BSS/ListUsageTypes
- BSS/ListMeasureUnits
- BSS/ListConversions
- BSS/ListServiceResources
- BSS/ListProvinces
- BSS/ListCities
- BSS/ListCounties
summary: code/单位/地理翻译
dimensions: [ServiceType, ResourceType, UsageType, MeasureUnit, ServiceResourceRelation, Geography]
evidence_boundary: 字典补上下文;非扣费事实
name: HuaweiCloudBillingSemanticCatalog
type: semantic_catalog
description: 薄路由;scope/time/money_basis → ontology_entities。provider_gate、workflow、拒答、触发词补全归 SKILL.md。
coverage:
expected_query_operations: 53
source_version: KooCLI 7.2.2
entry_points:
balance_and_debt:
required_context:
scope: [current_profile]
time: [point_in_time]
money_basis: [outstanding, billed]
triggers: [华为云余额, 华为云欠费]
ontology_entities: [AccountBalance, AccountChangeRecord, StoredValueCard]
monthly_spend:
required_context:
scope: [current_profile]
time: [bill_cycle]
money_basis: [billed, amortized]
triggers: [华为云本月花费, 华为云月度汇总]
ontology_entities: [MonthlyBillSummary, CostAnalysis, AmortizedCost]
charge_attribution:
required_context:
scope: [current_profile]
time: [bill_cycle, date_range]
money_basis: [billed]
triggers: [华为云扣费原因, 华为云哪个资源在扣费]
ontology_entities: [ResourceBillRecord, ResourceBillDetail, OrderEvidence]
reconciliation:
required_context:
scope: [current_profile]
time: [bill_cycle]
money_basis: [billed, paid]
triggers: [华为云账单对账, 华为云汇总和明细不一致]
ontology_entities: [BillingStatement, MonthlyBillSummary, ResourceBillDetail, OrderEvidence]
entitlement_and_deduction:
required_context:
scope: [current_profile]
time: [bill_cycle, point_in_time]
money_basis: [billed, paid]
triggers: [华为云资源包, 华为云优惠券]
ontology_entities: [FreeResourcePackage, CouponChangeRecord, CouponQuota, StoredValueCard]
account_scope:
required_context:
scope: [enterprise, partner, sub_customer]
time: [bill_cycle, point_in_time]
money_basis: [billed, outstanding]
triggers: [华为云企业主账号, 华为云伙伴账务]
ontology_entities:
- EnterpriseAndPartnerContext
- EnterpriseAccountContext
- EnterpriseBilling
- PartnerAccountContext
- PartnerBilling
reference_dimensions:
required_context:
scope: [current_profile]
time: [not_applicable]
money_basis: [not_applicable]
triggers: [华为云服务编码, 华为云计量单位]
ontology_entities: [ReferenceDimensions]