npx skills add ...
npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-obs-bucket-create
Skill specialized for creating buckets on Huawei Cloud OBS. Use this skill when users need to create OBS buckets, set bucket properties, configure access permissions, or need guidance on the bucket creation process. Trigger conditions: "创建OBS桶", "华为云存储桶", "存储空间创建", "create OBS bucket", "Huawei Cloud storage bucket", "OBS bucket", "Huawei Cloud bucket", "storage creation" or when setting up Huawei Cloud object storage.
npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-obs-bucket-create
This skill is used for creating buckets on Huawei Cloud Object Storage Service (OBS). It provides a simple, interactive bucket creation process, including bucket name validation, region selection, access permission configuration, and other advanced options.
Applicable Scenarios:
Required check: Huawei Cloud CLI (hcloud / KooCLI) >= 3.2.0
If not installed, or version is lower than 3.2.0, refer to cli-installation-guide.md for KooCLI installation. KooCLI has built-in obsutil tool, if KooCLI version check passes, obsutil check can be skipped.
If Huawei Cloud credentials are not configured, prompt the user to execute the following command:
Huawei Cloud OBS credentials do not inherit from Huawei Cloud credentials and need to be set separately.
hcloud configure list to check credential status.Bucket name bucket-name is a required condition for creating an OBS bucket. If the context does not specify a bucket name, prompt the user that a specific bucket name is needed, no other text prompts required.
Bucket name rules are as follows:
- 3-63 characters, starting with a number or letter, supporting lowercase letters, numbers, "-", ".".
- IP address format is not allowed.
- Cannot start or end with "-" or ".".
- Two adjacent "." are not allowed (e.g., "my..bucket").
- Adjacent "." and "-" are not allowed (e.g., "my-.bucket" and "my.-bucket")."
If the bucket name does not comply with the specification. Remind the user to reset the bucket name.
Get the region for the OBS bucket to be created from the context. If no region is specified, use the "endpoint" parameter in the ~/.obsutilconfig file as the region by default. Return prompt text:
Once a bucket is created successfully, the region cannot be changed, please choose carefully. The region you want to create the bucket in is ${region}
If the bucket list contains the bucket name created this time and the bucket information is output normally, prompt that the creation is successful and list the basic information of the bucket.
| Option | Description | Possible Values |
|---|---|---|
-acl=xxx | Access Control List | private, public-read, public-read-write |
-location=xxx | Region | cn-north-4, cn-east-2, etc. |
-az=xxx | Availability Zone | multi-az |
-sc=xxx | Default Storage Class | standard, warm, cold, deep-archive |
project-name-environment-purpose-20250527batch_create_buckets.sh script to batch create multiple buckets| Document | Description |
|---|---|
| KooCLI Installation Guide | KooCLI installation guide |
| Common Errors and Solutions | Error troubleshooting |
# Create with recommended configuration
hcloud OBS mb obs://bucket-name [-acl=xxx] [-location=xxx] [-fs] [-az=xxx] [-sc=xxx]# Batch create multiple buckets. Script exit code 6 from Huawei Cloud CLI is normal behavior, not an execution error
./scripts/batch_create_buckets.sh <bucket-name-prefix> <regions># List all buckets to confirm creation success
hcloud OBS ls
# Check bucket properties
hcloud OBS stat obs://bucket-namehcloud OBS mb obs://bucket-name [-acl=xxx] [-location=xxx] [-fs] [-az=xxx] [-sc=xxx]hcloud OBS lshcloud OBS stat obs://${bucket-name}