CommunityCoding & Developmentgithub.com

huaweicloud/huawei-cloud-obs-upload

Upload a local file or directory to a specified Huawei Cloud OBS (Object Storage Service) bucket with obsutil, and set up a scheduled/periodic upload task (crontab) that syncs a local directory to an OBS bucket. Also lists OBS buckets with storage capacity and object count. Use this skill when the user wants to: (1) upload a specific local file or directory to a named OBS bucket, (2) set up a scheduled/periodic upload task that automatically syncs a local directory to a named OBS bucket, (3) list their OBS buckets and check capacity and object count. Triggers include: user mentions "upload to OBS bucket", "上传文件到OBS", "上传目录到OBS", "定时上传到OBS", "目录同步到OBS桶", "OBS scheduled upload", "OBS周期上传", "OBS bucket capacity check", "OBS桶容量查询". Generic phrases such as "object storage", "upload file" or "upload directory" alone are NOT sufficient to trigger this skill.

What is huawei-cloud-obs-upload?

The Huawei Cloud OBS Upload skill enables automated file and directory uploads to Huawei Cloud Object Storage Service (OBS) buckets using obsutil, while providing bucket listing and capacity statistics via the hcloud CLI and Cloud Eye Service (CES) metrics. It supports immediate one-time uploads as well as scheduled periodic uploads via crontab (Linux/macOS) or Task Scheduler (Windows), ensuring data is synced from a local directory to a remote bucket on a recurring basis. The skill strictly enforces security best practices: it never reads or displays AK/SK credentials in conversation, requires explicit user confirmation before any upload or scheduled task creation, and forbids destructive operations such as delete, copy, or bucket modification. Key preconditions include having hcloud CLI (KooCLI) >= 3.2.0 and obsutil >= 5.5.0 installed, with obsutil credentials configured by the user in their own terminal. The skill guides users through three primary workflows: listing all OBS buckets with their storage capacity and object count, uploading a specific local file or directory (with customer-decided preservation of directory structure), and setting up a crontab-based scheduled upload task.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/huaweicloud/huaweicloud-skills/tree/HEAD/skills/storage/obs/huawei-cloud-obs-upload

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Huawei Cloud OBS Upload Skill

Overview

Upload local files or directories to Huawei Cloud OBS buckets, list OBS buckets with capacity and object count, and schedule periodic uploads via crontab. Upload operations use obsutil; bucket listing/stats use hcloud obs ls + CES metrics.

Tool separation principle:

  • obsutil — File/directory upload, scheduled upload sync (upload core tool; hcloud CLI has no PutObject support)
  • hcloud CLI — Bucket listing via hcloud obs ls (obsutil mode), bucket capacity/object count stats via hcloud CES ShowMetricData
  • crontab / Task Scheduler — OS-level scheduled task for periodic upload (no daemon process dependency)

Security architecture:

  • AK/SK are never read, echoed, or printed in conversation
  • obsutil credentials are configured by the user in their terminal (never asked in conversation)
  • Delete operations are strictly forbidden (irreversible); out-of-scope operations are refused with guided alternatives
  • For directory uploads, whether to preserve directory structure (-flat) is decided by the customer's explicit answer, never assumed
  • Every upload (Task 2) and every scheduled-upload setup (Task 3) requires the user's explicit confirmation before executing either the command or the crontab write
  • The agent only executes the steps described in this skill for the exact user-specified bucket and path; it never performs any other OBS/CLI action on the user's behalf

⚠️ Data transmission notice

  • Upload transfers local files/directories to remote cloud storage and persists them there. Before uploading, clearly tell the user: "Uploading <path> will transmit the data to OBS bucket <Bucket> and store it in the cloud." If the user did not intend this, stop before executing.
  • Scheduled uploads repeatedly push data from a local directory to the cloud on a recurring schedule. Warn the user explicitly that the data will be transmitted and persisted remotely on each run.
  • Review the path to be uploaded before executing; if the path is broad (e.g., a home directory) or contains unexpected content, confirm the scope with the user before uploading.

⛔ Prohibited Operations (Security Constraints)

This skill strictly forbids the following operations, regardless of user requests. The forbidden actions are described semantically; no destructive command examples are provided.

Prohibited OperationReason
❌ Delete a bucketIrreversible; destroys the entire bucket and all objects
❌ Delete an objectIrreversible; deleted objects cannot be recovered (unless versioning is enabled)
❌ Batch delete objectsIrreversible; batch deletion has a wide impact
❌ Empty a bucketIrreversible; removes all objects in the bucket
❌ Download an objectThis skill is upload-only; download is a separate workflow
❌ Create a bucketBucket creation has a dedicated skill with full prerequisites
❌ Copy an object between bucketsCross-bucket object copy is out of this skill's scope
❌ Modify bucket lifecycle configurationStorage cost management is a separate bucket-level config task
❌ Restore an archived objectArchive restore is a separate workflow with retrieval modes and TTL
❌ Generate presigned URLsTemporary sharing requires SDK signing; not supported by CLI upload
❌ Modify bucket ACL or bucket policyPermission management is a separate security task
❌ Ask user to provide AK/SK directly in conversationCredentials must never appear in conversation
❌ Extract AK/SK from hcloud config filesCredentials are encrypted and cannot be used directly
❌ Skip obsutil credential check before OBS operationsOperations fail without configured credentials
❌ Use -flat for directory uploads without asking the customer-flat discards directory structure; must follow customer's explicit answer
❌ Guess local path, bucket name, or target prefixRequired parameters must be provided by the user

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."

If a user requests an out-of-scope operation, do not attempt to perform it. Inform the user with the recommended alternative from the table below:

OperationRecommended alternative
Download objectUse obsutil cp obs://<Bucket>/<Key> <LocalPath> manually, or the OBS console
Create bucketUse the dedicated skill huawei-cloud-obs-bucket-create, or the OBS console
Copy objectUse hcloud OBS CopyObject manually, or the OBS console
Lifecycle configurationUse the OBS console (Bucket > Lifecycle), or hcloud OBS SetBucketLifecycle
Restore archived objectUse obsutil restore obs://<Bucket>/<Key> manually, or the OBS console
Presigned URLUse Huawei Cloud SDK (Java/Python/Go) to generate presigned URLs, or the OBS console
Bucket ACL/PolicyUse the OBS console (Bucket > Permissions), or hcloud OBS SetBucketAcl/SetBucketPolicy

Architecture

Huawei Cloud OBS Upload Management
├── Task 1: ListBucketsWithStats   (List buckets with capacity and object count)
│   ├── 1a. hcloud obs ls: list all buckets
│   ├── 1b. CES metrics / OBS API: query bucket capacity and object count
│   └── 1c. Report bucket stats table to user
├── Task 2: UploadFile             (Upload local file or directory to target bucket)
│   ├── 2a. Confirm local path + bucket name + target prefix with user
│   ├── 2b. For directory: ask customer whether to preserve directory structure (decide -flat)
│   ├── 2c. Warn data persists remotely + get explicit user confirmation
│   ├── 2d. obsutil cp: single file (-flat) or directory (-r, optional -flat by customer answer)
│   └── 2e. Verify upload result
└── Task 3: ScheduledUpload       (Schedule periodic upload of local directory to target bucket)
    ├── 3a. Confirm local dir + bucket + prefix + schedule period with user
    ├── 3b. Ask customer whether to preserve directory structure (decide -flat)
    ├── 3c. Warn about persistence + get explicit user confirmation
    ├── 3d. Generate obsutil upload script (with/without -flat per customer answer)
    ├── 3e. Set crontab / Task Scheduler scheduled task
    └── 3f. Verify scheduled task is set

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.

hcloud version

Prerequisite check 2/3: obsutil >= 5.5.0 required (for upload features) File/directory upload requires the Huawei Cloud obsutil CLI tool. Run obsutil version to verify version >= 5.5.0. If not installed, see references/cli-installation-guide.md for installation guide.

obsutil version

Prerequisite check 3/3: obsutil credential configuration required

The hcloud obs module maps to obsutil under the hood, which requires separate AK/SK and Endpoint configuration. Before performing OBS operations, you must check whether obsutil credentials are configured:

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: Direct the user to configure obsutil credentials in their own terminal (do not ask the user to provide AK/SK directly in the conversation), with the security warning below:

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

⚠️ Security warning: putting AK/SK on the command line exposes them to shell history and OS process listings.
Prefer interactive configuration (`hcloud configure`) or environment variables (HW_ACCESS_KEY / HW_SECRET_KEY).
After configuration, clear your shell history if the plaintext command was used.

Retry after configuration is complete.

⚠️ hcloud parameter format requirements

hcloud (KooCLI) cloud-service API commands (uppercase module, e.g. hcloud CES ShowMetricData) must use the --param=value format (connected with equals sign); space-separated format is not supported.

✅ Correct: hcloud CES ShowMetricData --region=cn-south-1 --namespace=SYS.OBS

❌ Incorrect: hcloud CES ShowMetricData --region cn-south-1

Note: hcloud obs (lowercase, obsutil mode) directly maps to obsutil commands and uses obsutil parameter style (e.g. hcloud obs ls, hcloud obs config -i=...); the --param=value rule does not apply. There is no hcloud OBS ListBuckets command — use hcloud obs ls to list buckets.


Authentication

Security rules (must be followed):

  • 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

⚠️ Credential exposure warning (share with the user when credential configuration is discussed):

  • Passing AK/SK as command-line arguments (e.g., obsutil config -ak=... -sk=... or hcloud configure set --access-key-id=...) exposes the credentials to shell history, OS process listings, audit logs, terminal recordings, and copied documentation.
  • Prefer interactive configuration (hcloud configure) or environment variables (HW_ACCESS_KEY / HW_SECRET_KEY).
  • After configuring via a plaintext command, clear the shell history (history -c or remove the offending line from ~/.bash_history).
  • obsutil's credential config file (e.g., ~/.obsutilconfig) should have restricted permissions (e.g., 600).

⚠️ Important: Handling user-provided credentials

If a user attempts to provide AK/SK directly (e.g., "my AK is xxx, SK is yyy"):

  1. Stop immediately - Do not execute any commands
  2. Politely refuse and return the following message:
    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 HW_ACCESS_KEY=<your-access-key-id>
        export HW_SECRET_KEY=<your-access-key-secret>
    
    After configuration is complete, please retry your request.
    
  3. Do not continue executing any Huawei Cloud operations until credentials are configured

Check CLI configuration:

   hcloud configure list

Check whether the output contains valid configuration (AK/SK, IAM, etc.).

If no valid credentials exist, stop here.


IAM Permission Policies

Ensure the IAM user has the required permissions. See references/iam-policies.md for the full permission table.

Minimum required permissions:

  • obs:bucket:list — List buckets
  • obs:bucket:get — Get bucket attributes (capacity, object count)
  • obs:object:get — Read object information
  • obs:object:put — Upload objects

Permission boundaries:

  • Scope constraint: This skill may ONLY perform the following tool actions, and only on the user-specified buckets/paths after confirmation:
    • hcloud obs ls / obsutil ls — list buckets and objects for the user-specified scope
    • hcloud CES ShowMetricData / hcloud OBS GetBucketStorageInfo — read bucket capacity / object count
    • obsutil cp — upload the confirmed local file/directory to the confirmed bucket
    • crontab (Linux/macOS) or schtasks (Windows) — write/remove the confirmed scheduled upload task
  • All other CLI/tool operations (delete, download, copy, bucket creation, config modification, etc.) are strictly out of scope and must be refused.
  • Must stop if: credentials missing or invalid, user declines any confirmation, target bucket does not exist, or local path does not exist.
  • Prohibited actions: any delete operation, any out-of-scope operation listed above, modifying the tool list here, or executing any command beyond the confirmed scope.

Core Workflows

Task 1: List Buckets with Capacity and Object Count

List buckets via obsutil, then query bucket capacity and object count using CES capacity metrics or OBS API.

⚠️ Tool separation: hcloud obs ls for listing, hcloud CES ShowMetricData for stats

  • hcloud obs ls: list all buckets (obsutil mode; no --region parameter — region is set via hcloud obs config -e=...)
  • hcloud CES ShowMetricData / OBS API: query each bucket's capacity and object count

📄

... (truncated for translation)

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

huaweicloud/huawei-cloud-dws-io-diag

DWS cluster I/O overload root cause diagnosis skill, based on KooCLI v3.2.0+ and DWS Autopilot MCP Server. Automatically collects I/O metrics, analyzes root causes (customer-side / system-side) via three-stage decision tree, and outputs a standardized diagnosis report. Applicable to DWS cluster I/O usage too high, I/O alarms, disk I/O load anomaly scenarios. Trigger words: "I/O高", "I/O告警", "I/O诊断", "I/O过载", "IO高", "IO告警", "IO诊断", "IO过载", "磁盘IO负载异常", "util打满", "await高", "high I/O", "I/O alarm", "I/O diagnosis"

huaweicloud/huawei-cloud-ecs-manage

Use when managing Huawei Cloud ECS (Elastic Cloud Server / 弹性云服务器) instances — lifecycle management (create / start / stop / restart / delete), day-to-day change operations (resize / reinstall OS / reset password / replace keypair / bind & unbind EIP / change security group / add & remove NIC / attach & detach volume), instance querying, quota/flavor/image inspection, mandatory async-job polling after every write, and multi-step root-cause diagnosis of ECS instance creation failures (quota → flavor → image → network → keypair → disk). Provides 23 huawei_* actions: huawei_list_ecs_instances, huawei_get_ecs_instance, huawei_list_ecs_flavors, huawei_list_ecs_images, huawei_list_ecs_quotas, huawei_diagnose_ecs_create_failure, huawei_analyze_ecs_health, huawei_create_ecs_instance, huawei_start_ecs_instance, huawei_stop_ecs_instance, huawei_restart_ecs_instance, huawei_delete_ecs_instance, huawei_resize_ecs_instance, huawei_reinstall_ecs_os, huawei_reset_ecs_password, huawei_replace_ecs_keypair, huawei_bind_ecs_eip

huaweicloud/huawei-cloud-ges-graph

Provides access guide for Huawei Cloud Graph Database GES service. Covers Cypher queries, GQL queries, schema/label management, summary info queries, graph data editing and more. Use this skill when users want to operate Huawei Cloud graph database GES service via terminal.

huaweicloud/huawei-cloud-obs-website-host

Configure Huawei Cloud OBS static website hosting with Python SDK and a custom domain. Use when the user needs to enable or repair OBS website hosting, set index or error pages, expose an existing bucket for public website access through a custom domain, or connect that domain through Huawei Cloud DNS when Huawei manages the zone. Triggers include OBS static website hosting, website endpoint, index page, error page, public-read bucket website access, custom domain CNAME, Huawei Cloud DNS, setBucketWebsite. 中文触发词包括:OBS 静态网站托管、网站托管、自定义域名解析。

Related Skills