Install the skill above, then run this in your AI tool:
/huawei-cloud-obs-stats <your description>
About
## Overview
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
|
Skill instructions
Huawei Cloud OBS Statistics Skill
Overview
Query Huawei Cloud OBS (Object Storage Service) statistics: list buckets with capacity and object counts, query extranet/intranet download traffic with month-over-month comparison, and query total requests with month-over-month comparison.
⛔ Prohibited Operations (Security Constraints)
This skill strictly forbids the following delete operations, regardless of user requests:
Prohibited Operation
API/Command
Reason
❌ Delete bucket
DeleteBucket / obsutil rm -bucket
Irreversible; destroys the entire bucket and all objects
❌ Delete object
DeleteObject / obsutil rm
Irreversible; deleted objects cannot be recovered (unless versioning is enabled)
❌ Batch delete objects
DeleteObjects / obsutil rm -r
Irreversible; batch deletion has a wide impact
❌ Empty bucket
obsutil rm -bucket -r
Irreversible; removes all objects in the bucket
If a user requests a delete operation, you must refuse and inform:
"Per security constraints, this skill does not allow delete operations (delete bucket/object/batch delete/empty bucket). Please use the Huawei Cloud OBS console or obsutil manually."
Architecture
code
Huawei Cloud OBS Statistics
├── ListBucketsWithStats (List buckets with capacity and object counts)
├── GetTraffic (Query extranet/intranet download traffic with MoM comparison)
└── GetRequests (Query total requests with MoM comparison)
Prerequisites
Prerequisite check 1/3: Huawei Cloud CLI (hcloud / KooCLI) >= 3.2.0 required
Run hcloud version to verify version >= 3.2.0. If not installed or version is too low,
see references/cli-installation-guide.md for installation guide.
bash
hcloud version
Prerequisite check 2/3: obsutil >= 5.5.0 required (for OBS bucket listing)
The hcloud OBS module uses obsutil under the hood. Bucket listing requires the obsutil CLI tool.
Run obsutil version to verify version >= 5.5.0. If not installed,
see references/cli-installation-guide.md for installation guide.
The hcloud OBS module uses obsutil under the hood, which requires separate AK/SK and Endpoint configuration.
Before performing OBS operations, you must check whether obsutil credentials are configured:
bash
hcloud obs ls -limit=1
If the response is Please set ak, sk and endpoint in the configuration file! or InvalidAccessKeyId, obsutil credentials are not configured.
Resolution: Provide the following example command and have the user configure it in their terminal (do not ask the user to provide AK/SK directly in the conversation):
code
obsutil credentials are not configured. Please run the following command in your terminal to configure (AK/SK can be obtained from the Huawei Cloud console "My Credentials" page):
hcloud obs config -i=<YourAK> -k=<YourSK> -e=obs.<Region>.myhuaweicloud.com
Example (Guangzhou region):
hcloud obs config -i=<YourAK> -k=<YourSK> -e=obs.cn-south-1.myhuaweicloud.com
Common Endpoints:
cn-north-4 → obs.cn-north-4.myhuaweicloud.com
cn-east-3 → obs.cn-east-3.myhuaweicloud.com
cn-south-1 → obs.cn-south-1.myhuaweicloud.com
cn-southwest-2 → obs.cn-southwest-2.myhuaweicloud.com
Retry after configuration is complete.
Prohibited actions:
❌ Do not ask the user to provide AK/SK directly in the conversation
❌ Do not extract AK/SK from hcloud config files (credentials are encrypted and cannot be used directly)
❌ Do not skip the credential check before performing OBS operations
⚠️ hcloud parameter format requirements
hcloud (KooCLI) all parameters must use the --param=value format (connected with equals sign); space-separated format is not supported.
Prohibited from reading, echoing, or printing AK/SK values
Prohibited from asking the user to input AK/SK directly in the conversation
Prohibited from using hcloud configure set to pass plaintext credential values
Prohibited from accepting AK/SK directly provided by the user in the conversation
Only allowed to read credentials from environment variables or configured CLI config files
⚠️ Important: Handling user-provided credentials
If a user attempts to provide AK/SK directly (e.g., "my AK is xxx, SK is yyy"):
Stop immediately - Do not execute any commands
Politely refuse and return the following message:
code
For account security, please do not provide Huawei Cloud Access Key ID and Access Key Secret directly in the conversation.
Please use one of the following secure methods to configure credentials:
Method 1: Interactive configuration (recommended)
hcloud configure
# Enter AK/SK as prompted; credentials will be securely stored in a local config file
Method 2: Environment variable configuration
export HUAWEICLOUD_SDK_AK=<your-access-key-id>
export HUAWEICLOUD_SDK_SK=<your-access-key-secret>
After configuration is complete, please retry your request.
Do not continue executing any Huawei Cloud operations until credentials are configured
Check CLI configuration:
bash
hcloud configure list
Check whether the output contains valid configuration (AK/SK, IAM, etc.).
Task 1: List Buckets with Capacity and Object Counts
List buckets via obsutil, then query bucket capacity and object count via CES. Prefer the CES capacity_total metric for capacity and CES object_num_all metric for object count (efficient for batch queries, 30-min collection). Do not use GetBucketStorageInfo (not supported by hcloud OBS module).
Download/upload traffic statistics with MoM comparison. Options: --direction, --compare, --metric. Comparison disabled by default. See Core Commands above for usage.
Total request statistics (GET/PUT/POST/DELETE/HEAD) with MoM comparison. Options: --include-errors, --compare, --metric. Comparison disabled by default. See Core Commands above for usage.
Usage examples:
bash
# Traffic: last 30 days download traffic
python3 scripts/obs_traffic_stats.py --region <Region> --bucket <BucketName> --period last_30d
# Traffic: this month download + upload traffic
python3 scripts/obs_traffic_stats.py --region <Region> --bucket <BucketName> --period this_month --direction both
# Requests: last 30 days request count
python3 scripts/obs_request_stats.py --region <Region> --bucket <BucketName> --period last_30d
# Requests: this month request count (with 4xx/5xx error stats)
python3 scripts/obs_request_stats.py --region <Region> --bucket <BucketName> --period this_month --include-errors
# Custom date range
python3 scripts/obs_request_stats.py --region <Region> --bucket <BucketName> --from <FromDate> --to <ToDate>
The scripts incorporate key lessons learned: traffic vs. bandwidth metrics, hcloud dimension parameter format, precise time range matching, OBS lacking a single request_count metric, etc.
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/huaweicloud/huawei-cloud-obs-stats/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@huaweicloud/huawei-cloud-obs-stats@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: |
Generate Huawei Cloud Terraform configurations and execute deployment with user-guided approval. Use this skill when users want to create Huawei Cloud infrastructure as Terraform, whether they ask explicitly for Terraform or describe goa...
Run aipm add @huaweicloud/huawei-cloud-obs-stats@1.0.0 in a project that has AIPM initialized.
Supported tools
@huaweicloud/huawei-cloud-obs-stats@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.