Answers from the documentation; checking which model is on duty
Hi - I answer from the OpenSmartRoute documentation: routing, the API, plans and quotas, self-hosting. Ask away, or open a support ticket if you need a person.
Grounded in the docs - follow a source before acting on it.
Imported from huaweicloud/huaweicloud-skills (skills/storage/obs/huawei-cloud-obs-lifecycle-management/SKILL.md). Install upstream with npx skills add huaweicloud/huaweicloud-skills --skill huawei-cloud-obs-lifecycle-management. Copyright stays with the author.
Huawei Cloud OBS Lifecycle Management Skill
Manage OBS lifecycle policies end-to-end: query rules, list objects, diagnose ineffective rules, analyze storage cost, preview the impact of a rule, and create/update/delete rules with mandatory
preview and user confirmation.
Overview
This skill manages the OBS (Object Storage Service) lifecycle configuration of a bucket. A lifecycle rule automates object housekeeping: transition objects to colder storage classes (Infrequent
Access / Archive / Deep Archive) or expire (delete) them after N days, optionally filtered by object key prefix or tags.
User Request └── Action Router ├── Query (R3) → hcloud obs lifecycle get / hcloud obs ls (read-only, auto-run) ├── Analyze (R3) → diagnose / cost / preview (read-only, auto-run) └── Manage (R2/R1) → create / update / delete lifecycle rules (ALWAYS preview first + explicit user confirmation)
Capability Matrix
#
Action
Capability
Mode
Severity
1
huawei_list_obs_lifecycle_rules
List all lifecycle rules of a bucket
CLI
R3 Query
2
huawei_get_obs_lifecycle_rule
Get one lifecycle rule by ID (rule details)
CLI
R3 Query
3
huawei_list_obs_objects
List objects in a bucket (diagnosis comparison)
CLI
R3 Query
4
huawei_diagnose_obs_lifecycle
Diagnose why a lifecycle rule is not taking effect
CLI
R3 Analysis
5
huawei_analyze_obs_lifecycle_cost
Analyze lifecycle policy and storage cost trade-off
CLI
R3 Analysis
6
huawei_preview_obs_lifecycle
Dry-run preview: objects a rule would affect
CLI
R3 Analysis
7
huawei_create_obs_lifecycle_rule
Create a lifecycle rule
CLI
R2 Mgmt
8
huawei_update_obs_lifecycle_rule
Update a lifecycle rule
CLI
R2 Mgmt
9
huawei_delete_obs_lifecycle_rule
Delete a lifecycle rule
CLI
R1 Mgmt
Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).
Prerequisites
Requirement
Description
hcloud CLI
Installed and authenticated. See references/cli-installation-guide.md
KooCLI version
>= 3.2.0 (verify with hcloud version)
obsutil
>= 5.5.0 — the hcloud OBS module maps 1:1 to obsutil commands (verify with obsutil version)
obsutil credentials
Configured via hcloud obs config (interactive, prompts for AK/SK/endpoint) or obsutil config; or via HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK env vars. AK/SK are never hardcoded in this skill or its scripts, and never passed as plaintext CLI args
IAM permissions
obs:bucket:GetLifecycleConfiguration, obs:bucket:PutLifecycleConfiguration, obs:object:ListObject, obs:bucket:GetBucketLocation (least-privilege policy in references/iam-policies.md)
Region note: with the obsutil passthrough mode, the region is part of the endpoint (obs.{region}.myhuaweicloud.com), not a --cli-region flag. Choose the endpoint matching the bucket's
region (e.g. obs.cn-south-1.myhuaweicloud.com).
skill-quality-cli — ensured by bash scripts/ensure_cli.sh (idempotent, skips if present)
Upgrade: run skill-quality-cli upgrade manually (no auto-upgrade)
Disable telemetry report: set SKILL_QUALITY_REPORT=0
Workflow
Query (R3) — read-only, agent may run automatically
1. (optional) skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls -limit=1 → list buckets, pick one2. skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get → current rules (JSON)3. skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket}/{prefix} -limit={limit} -s → objects for comparison
Analyze (R3) — read-only, agent may run automatically
1. Call huawei_diagnose_obs_lifecycle / huawei_analyze_obs_lifecycle_cost / huawei_preview_obs_lifecycle with the bucket (+ rule id/prefix/days as needed)2. The analyzer script combines lifecycle config + object listing + bucket stat, then returns the diagnosis / cost estimate / affected-object preview3. Present findings to the user; for a Manage action, ask for confirmation
Manage (R2/R1) — ALWAYS preview + confirm before mutating
1. huawei_preview_obs_lifecycle (dry-run) → show exactly which objects the rule would affect2. Show the user the rule JSON that will be applied (create/update) or removed (delete)3. WAIT for explicit user confirmation4. Execute the put (create/update) or put-back (delete single rule)5. huawei_list_obs_lifecycle_rules → verify the resulting configuration
⚠️ Mutating-operation security rule (mandatory):huawei_create_obs_lifecycle_rule,
huawei_update_obs_lifecycle_rule and huawei_delete_obs_lifecycle_rulemust not be
executed without: (1) a dry-run preview of the affected scope and (2) explicit user
confirmation. -method=delete deletes the entire lifecycle configuration of a bucket
at once — use it only after double-confirmation.
Core Commands
List / Get Lifecycle Rules
> **⚠️ Mandatory: every `hcloud` command in this skill MUST be wrapped with `skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- ` — bare `hcloud` calls are strictly forbidden.**# List all lifecycle rules of a bucket (JSON output)skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get# Persist the rule configuration to a file for review or editingskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get -localfile={rule_file}# Get one rule by ID (filter client-side)skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get -localfile={rule_file}python3 -c "import json;c=json.load(open('{rule_file}'));print(json.dumps([r for r in c['Rules'] if r['ID']=='{rule_id}'],indent=2))"
Parameter
Required
Description
obs://{bucket}
Yes
Target bucket URL
-method=get
Yes
Operation: get (read) lifecycle rules
-localfile={rule_file}
No
Save rules JSON to a local file
-config={config}
No
Custom obsutil config file path
-e={endpoint}
No
Endpoint override (defaults to configured endpoint)
List Objects
# List objects (brief mode, limit 100 by default, max 1000)skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket} -limit={limit} -s# List objects under a prefix (folder) — used for diagnosis comparisonskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket}/{prefix} -limit={limit} -s# Estimated summary of the bucket (size / object count)skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket} -limit=1 -du
Parameter
Required
Description
obs://{bucket}[/{prefix}]
Yes
Bucket URL, optional prefix/folder
-limit={limit}
No
Max objects returned (default 100, max 1000)
-s
No
Brief mode (key + LastModified + size only)
-d
No
List objects and sub-folders of current folder
-v
No
List object versions
-marker={marker}
No
Pagination marker (continue from last key)
-bf=raw
No
Raw byte format for sizes
Diagnose Ineffective Lifecycle Rules (R3)
# One-shot diagnosis: rule config vs object actual statepython3 scripts/obs_lifecycle_analyzer.py diagnose --bucket {bucket} --prefix {prefix}# Diagnosis dimensions covered:# 1. Rule status disabled (Status != Enabled)# 2. Prefix/filter mismatch (object keys do not start with rule prefix / tags differ)# 3. Age not elapsed (object LastModified + expiration days > now)# 4. Rule order / overlapping prefixes (first matching rule wins)# 5. Versioning: Expiration deletes current version; NoncurrentVersion* handles old versions# 6. Object already in colder class / already expired# 7. Bucket-level blockers (no rule for this prefix at all)
Parameter
Required
Description
--bucket
Yes
Bucket name (no obs:// prefix)
--prefix
No
Restrict object scan to a key prefix
--limit
No
Max objects scanned (default 1000)
--rule-id
No
Focus diagnosis on a specific rule ID
Analyze Lifecycle Cost (R3)
python3 scripts/obs_lifecycle_analyzer.py cost --bucket {bucket} --prefix {prefix}# Output: per-rule transition plan (class + days), affected object count/size,# and a standard-vs-IA-vs-Archive/DeepArchive monthly cost comparison (approximation).# NOTE: this is a storage-class cost estimation; actual billed amounts come from# BSS billing data and may differ by region/pricing tier.
Parameter
Required
Description
--bucket
Yes
Bucket name
--prefix
No
Restrict object scan to a key prefix
--limit
No
Max objects scanned (default 1000)
--price-file
No
Custom JSON price table (see references/lifecycle-rule-format.md)
Preview Lifecycle Rule (dry-run, R3)
# Preview: which objects a rule WOULD affect (expire / transition) if applied nowpython3 scripts/obs_lifecycle_analyzer.py preview \ --bucket {bucket} --prefix {prefix} --rule-id {rule_id} --days {days}# Shorter form: preview from an existing rule by IDpython3 scripts/obs_lifecycle_analyzer.py preview --bucket {bucket} --rule-id {rule_id}# Output: per-rule matched object list (key, LastModified, age, action) + count + total size
Parameter
Required
Description
--bucket
Yes
Bucket name
--rule-id
No
Preview impact of an existing rule (by ID)
--prefix
No
Rule prefix to simulate
--days
No
Expiration/transition days to simulate
--action
No
expire or transition (default: from the rule)
--limit
No
Max objects scanned (default 1000)
Create Lifecycle Rule (R2) — preview + confirm first
# 1. Dry-run preview of the intended scopepython3 scripts/obs_lifecycle_analyzer.py preview --bucket {bucket} --prefix {prefix} --days {days}# 2. Build the rule JSON (see references/lifecycle-rule-format.md for the full schema)# cat > /tmp/new-rule.json <<'EOF'# {"Rules":[{"ID":"{rule_id}","Prefix":"{prefix}","Status":"Enabled","Expiration":{"Days":{days}}}]}# EOF# 3. IMPORTANT: obsutil PUT replaces the ENTIRE lifecycle configuration —# merge the new rule into the EXISTING rules first (the analyzer does this):python3 scripts/obs_lifecycle_analyzer.py create-rule \ --bucket {bucket} --rule-id {rule_id} --prefix {prefix} --action expire --days {days}# 4. Confirm with user, then apply (the script prints the final merged JSON and asks for confirmation)
Parameter
Required
Description
--bucket
Yes
Bucket name
--rule-id
Yes
Rule ID (unique within the bucket, 1-255 chars)
--prefix
Yes
Object key prefix the rule applies to ({prefix} or empty for whole bucket)
--action
Yes
expire (delete objects) or transition (change storage class)
--days
Yes*
Expiration/transition days after last modified (required for expire; with transition, --storage-class required)
--storage-class
No
Target class for transition: WARM (IA) / COLD (Archive) / DEEP_ARCHIVE
--apply
No
Skip the preview+confirm gate (for scripted automation — only after user confirmation was given elsewhere)
Update Lifecycle Rule (R2) — preview + confirm first
# Update = get current config → modify the target rule → put back.# --action selects which action to modify:# expire → touch Expiration only# transition → touch Transitions[].Days/StorageClass only# Omitted → updates the action the rule already has; REQUIRED when the rule# has BOTH Expiration and Transitions (never guess, never add an action type# silently — a transition update must not touch/add Expiration).python3 scripts/obs_lifecycle_analyzer.py update-rule \ --bucket {bucket} --rule-id {rule_id} --action transition --days {new_days}# change the transition storage class toopython3 scripts/obs_lifecycle_analyzer.py update-rule \ --bucket {bucket} --rule-id {rule_id} --action transition --days {new_days} --storage-class WARM# verify the resultskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get
# Delete ONE rule: remove it from the config and put backpython3 scripts/obs_lifecycle_analyzer.py delete-rule --bucket {bucket} --rule-id {rule_id}# DESTRUCTIVE: delete the ENTIRE lifecycle configuration (use only after double-confirmation)skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=delete
⚠️ The single-rule delete flow (preferred) removes only {rule_id} and keeps all other rules intact. The -method=delete form wipes all rules of the bucket — irreversible.
KooCLI Command Format Standard
obsutil passthrough mode — hcloud obs is a dedicated OBS module that maps 1:1 to obsutil commands. It intentionally does not use the standard hcloud <Service> <Operation> --cli-region=<region> syntax:
Feature
Description
Example
Service name
obs (lowercase, fixed)
hcloud obs
Operation
obsutil verb, lowercase
lifecycle, ls, stat, config, mb
Bucket URL
obs://{bucket}
obs://my-bucket
obsutil options
-key=value / -flag
-method=get, -limit=100, -s
Region / endpoint
Encoded in the endpoint obs.{region}.myhuaweicloud.com (configured once via hcloud obs config), not--cli-region
-e=obs.cn-south-1.myhuaweicloud.com
Rule JSON
Lifecycle configuration in the obsutil JSON schema (see references/lifecycle-rule-format.md)
Expiration or transition days after last modification
-limit
list objects / analyze / preview
Max objects to scan (default 100, max 1000)
--action
create/update/preview
expire or transition
Quality telemetry: every run reports automatically through skill-quality-cli
(see the Dependency note in Overview and the skill-quality-cli
section of references/cli-installation-guide.md). Opt out with SKILL_QUALITY_REPORT=0.
The analyzer script itself contains no reporting code — telemetry is attached by the
skill-quality-cli run wrapper around every hcloud command.
Error Code Convention
Prefix
Category
Examples
U
User input
U01 missing param, U03 no data found, U04 permission denied
C
Config
C01 missing AK/SK / obsutil not configured
N
Network
N01 timeout, N02 connection failed
B
Code bug
B01 exception in analyzer
P
Platform
P01 scheduler error
Critical Warnings
Action
Warning
huawei_create_obs_lifecycle_rule
Replaces the whole lifecycle configuration — always merge with existing rules. Requires preview + confirmation.
huawei_update_obs_lifecycle_rule
Modifies object housekeeping behavior; preview the new scope + confirm.
huawei_delete_obs_lifecycle_rule
Irreversible — deleted rules are not recoverable. Preview + double-confirm.
Deletes the entire lifecycle configuration of the bucket. Use only after double-confirmation.
Authentication
Mode 1: env-based (recommended for scripts)
export HUAWEI_ACCESS_KEY={ak}export HUAWEI_SECRET_KEY={sk}# obsutil picks these up from its own config; configure once interactively# (hcloud prompts for AK/SK/endpoint, keeps them out of shell history):skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs config
Security rule: never type or paste AK/SK into the chat, and never pass
AK/SK as plaintext CLI args (-i={ak} -k={sk} leaks via shell history /
process list). Configure credentials out-of-band (interactive hcloud obs config / env vars / shell profile), then re-run. This skill never hardcodes
credentials and its scripts read them only from the environment / obsutil config.
Mode 2: obsutil config file (interactive)
skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs config -e=obs.{region}.myhuaweicloud.com # prompts for AK/SK;# orobsutil config # prompts for AK/SK/endpointskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls -limit=1 # verify connectivity
Install huawei-cloud-obs-lifecycle-management and it becomes one more candidate the router can pick - when it fits.
A listing is a routing target with a manifest: what it does, which domains it covers, what it costs and who publishes it. Once installed it sits beside your own models and tools, is scored like any other candidate for each request, and shows up in the trace when it wins. Ratings come from workspaces that installed it, one per account.
When a provider is down or over quota the request moves on; the trace says it did.
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
# after Install: the listing is in your workspace's routing pool - a plan picks it for its slotcurl-s-X POST https://api.opensmartroute.ai/api/v1/route -H 'Authorization: Bearer $OSR_API_KEY' -H 'Content-Type: application/json' -d '{"text": "...", "plan": true}'
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.
{
"ocm": "1",
"id": "huaweicloud-huaweicloud-skills-huawei-cloud-obs-lifecycl-5dad37",
"kind": "skill",
"name": "huawei-cloud-obs-lifecycle-management",
"description": "Manage Huawei Cloud OBS (Object Storage Service) lifecycle policies: list/get lifecycle rules, list bucket objects, diagnose why a lifecycle rule is not taking effect, analyze lifecycle-vs-storage-cost trade-offs, dry-run preview which objects a rule would affect, and create/update/delete lifecycle rules (R2/R1 require preview + user confirmation). All operations run through the hcloud CLI OBS module (obsutil passthrough). Use when the user wants to: check why objects are not being transitioned or expired (lifecycle not working), list or query OBS lifecycle rules, create/update/delete lifecycle rules, preview the object scope a rule would affect before applying it, or estimate cost savings from transitioning objects to colder storage classes. Triggers include: \"OBS生命周期\", \"生命周期规则\", \"生命周期策略\", \"不生效\", \"未生效\", \"过期删除\", \"转储\", \"归档\", \"低频\", \"lifecycle\", \"lifecycle rule\", \"lifecycle policy\", \"expiration\", \"transition\", \"storage class\", \"OBS lifecycle not working\", \"obs lifecycle diagnose\", \"dry-run\", \"preview lifecycle r",
"publisher": "huaweicloud",
"version": "1.0.0",
"capabilities": {
"domains": [
"data_analysis",
"customer_support"
],
"tags": [
"skill-md",
"huawei-cloud",
"obs",
"lifecycle",
"object-storage",
"skills-sh"
],
"languages": [
"en"
]
},
"quality_prior": 0.6,
"examples": [
"Manage Huawei Cloud OBS (Object Storage Service) lifecycle policies: list/get lifecycle rules, list bucket objects, diagnose why a lifecycle rule is not taking effect, analyze lifecycle-vs-storage-cost trade-offs, dry-run preview which objects a rule would affect, and create/update/delete lifecycle rules (R2/R1 require preview + user confirmation). All operations run through the hcloud CLI OBS module (obsutil passthrough). Use when the user wants to: check why objects are not being transitioned or expired (lifecycle not working), list or query OBS lifecycle rules, create/update/delete lifecycle rules, preview the object scope a rule would affect before applying it, or estimate cost savings from transitioning objects to colder storage classes. Triggers include: \"OBS生命周期\", \"生命周期规则\", \"生命周期策略\", \"不生效\", \"未生效\", \"过期删除\", \"转储\", \"归档\", \"低频\", \"lifecycle\", \"lifecycle rule\", \"lifecycle policy\", \"expiration\", \"transition\", \"storage class\", \"OBS lifecycle not working\", \"obs lifecycle diagnose\", \"dry-run\", \"preview lifecycle r"
],
"primary": false,
"metadata": {
"source": {
"provider": "skills.sh",
"repository": "https://github.com/huaweicloud/huaweicloud-skills",
"path": "skills/storage/obs/huawei-cloud-obs-lifecycle-management/SKILL.md",
"ref": "HEAD",
"url": "https://github.com/huaweicloud/huaweicloud-skills/blob/HEAD/skills/storage/obs/huawei-cloud-obs-lifecycle-management/SKILL.md",
"key": "huaweicloud/huaweicloud-skills/skills/storage/obs/huawei-cloud-obs-lifecycle-management/SKILL.md"
}
},
"instructions": "# Huawei Cloud OBS Lifecycle Management Skill\n\n> Manage OBS lifecycle policies end-to-end: query rules, list objects, diagnose ineffective rules, analyze storage cost, preview the impact of a rule, and create/update/delete rules with mandatory\n> preview and user confirmation.\n\n## Overview\n\nThis skill manages the **OBS (Object Storage Service) lifecycle configuration** of a bucket. A lifecycle rule automates object housekeeping: transition objects to colder storage classes (Infrequent\nAccess / Archive / Deep Archive) or expire (delete) them after N days, optionally filtered by object key prefix or tags.\n\n```text\nUser Request\n └── Action Router\n ├── Query (R3) → hcloud obs lifecycle get / hcloud obs ls (read-only, auto-run)\n ├── Analyze (R3) → diagnose / cost / preview (read-only, auto-run)\n └── Manage (R2/R1) → create / update / delete lifecycle rules\n (ALWAYS preview first + explicit user confirmation)\n```\n\n### Capability Matrix\n\n| # | Action | Capability | Mode | Severity |\n|---|--------|-----------|------|----------|\n| 1 | `huawei_list_obs_lifecycle_rules` | List all lifecycle rules of a bucket | CLI | R3 Query |\n| 2 | `huawei_get_obs_lifecycle_rule` | Get one lifecycle rule by ID (rule details) | CLI | R3 Query |\n| 3 | `huawei_list_obs_objects` | List objects in a bucket (diagnosis comparison) | CLI | R3 Query |\n| 4 | `huawei_diagnose_obs_lifecycle` | Diagnose why a lifecycle rule is not taking effect | CLI | R3 Analysis |\n| 5 | `huawei_analyze_obs_lifecycle_cost` | Analyze lifecycle policy and storage cost trade-off | CLI | R3 Analysis |\n| 6 | `huawei_preview_obs_lifecycle` | Dry-run preview: objects a rule would affect | CLI | R3 Analysis |\n| 7 | `huawei_create_obs_lifecycle_rule` | Create a lifecycle rule | CLI | R2 Mgmt |\n| 8 | `huawei_update_obs_lifecycle_rule` | Update a lifecycle rule | CLI | R2 Mgmt |\n| 9 | `huawei_delete_obs_lifecycle_rule` | Delete a lifecycle rule | CLI | R1 Mgmt |\n\n**Dependency**: Quality telemetry is collected automatically via `skill-quality-cli` (installed by `scripts/ensure_cli.sh` if absent).\n\n## Prerequisites\n\n| Requirement | Description |\n|-------------|-------------|\n| **hcloud CLI** | Installed and authenticated. See `references/cli-installation-guide.md` |\n| **KooCLI version** | `>= 3.2.0` (verify with `hcloud version`) |\n| **obsutil** | `>= 5.5.0` — the hcloud OBS module maps 1:1 to obsutil commands (verify with `obsutil version`) |\n| **obsutil credentials** | Configured via `hcloud obs config` (interactive, prompts for AK/SK/endpoint) or `obsutil config`; or via `HUAWEICLOUD_SDK_AK` / `HUAWEICLOUD_SDK_SK` env vars. AK/SK are **never** hardcoded in this skill or its scripts, and never passed as plaintext CLI args |\n| **IAM permissions** | `obs:bucket:GetLifecycleConfiguration`, `obs:bucket:PutLifecycleConfiguration`, `obs:object:ListObject`, `obs:bucket:GetBucketLocation` (least-privilege policy in `references/iam-policies.md`) |\n\n> **Region note:** with the obsutil passthrough mode, the region is part of the endpoint (`obs.{region}.myhuaweicloud.com`), not a `--cli-region` flag. Choose the endpoint matching the bucket's\n> region (e.g. `obs.cn-south-1.myhuaweicloud.com`).\n- **`skill-quality-cli`** — ensured by `bash scripts/ensure_cli.sh` (idempotent, skips if present)\n - Upgrade: run `skill-quality-cli upgrade` manually (no auto-upgrade)\n - Disable telemetry report: set `SKILL_QUALITY_REPORT=0`\n## Workflow\n\n### Query (R3) — read-only, agent may run automatically\n\n```text\n1. (optional) skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls -limit=1 → list buckets, pick one\n2. skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get → current rules (JSON)\n3. skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket}/{prefix} -limit={limit} -s → objects for comparison\n```\n\n### Analyze (R3) — read-only, agent may run automatically\n\n```text\n1. Call huawei_diagnose_obs_lifecycle / huawei_analyze_obs_lifecycle_cost /\n huawei_preview_obs_lifecycle with the bucket (+ rule id/prefix/days as needed)\n2. The analyzer script combines lifecycle config + object listing + bucket stat,\n then returns the diagnosis / cost estimate / affected-object preview\n3. Present findings to the user; for a Manage action, ask for confirmation\n```\n\n### Manage (R2/R1) — ALWAYS preview + confirm before mutating\n\n```text\n1. huawei_preview_obs_lifecycle (dry-run) → show exactly which objects the rule would affect\n2. Show the user the rule JSON that will be applied (create/update) or removed (delete)\n3. WAIT for explicit user confirmation\n4. Execute the put (create/update) or put-back (delete single rule)\n5. huawei_list_obs_lifecycle_rules → verify the resulting configuration\n```\n\n> ⚠️ **Mutating-operation security rule (mandatory):** `huawei_create_obs_lifecycle_rule`,\n> `huawei_update_obs_lifecycle_rule` and `huawei_delete_obs_lifecycle_rule` **must not** be\n> executed without: (1) a dry-run preview of the affected scope and (2) explicit user\n> confirmation. `-method=delete` deletes the **entire** lifecycle configuration of a bucket\n> at once — use it only after double-confirmation.\n\n## Core Commands\n\n### List / Get Lifecycle Rules\n\n```bash\n> **⚠️ Mandatory: every `hcloud` command in this skill MUST be wrapped with `skill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- ` — bare `hcloud` calls are strictly forbidden.**\n\n\n# List all lifecycle rules of a bucket (JSON output)\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get\n\n# Persist the rule configuration to a file for review or editing\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get -localfile={rule_file}\n\n# Get one rule by ID (filter client-side)\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get -localfile={rule_file}\npython3 -c \"import json;c=json.load(open('{rule_file}'));print(json.dumps([r for r in c['Rules'] if r['ID']=='{rule_id}'],indent=2))\"\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `obs://{bucket}` | Yes | Target bucket URL |\n| `-method=get` | Yes | Operation: get (read) lifecycle rules |\n| `-localfile={rule_file}` | No | Save rules JSON to a local file |\n| `-config={config}` | No | Custom obsutil config file path |\n| `-e={endpoint}` | No | Endpoint override (defaults to configured endpoint) |\n\n### List Objects\n\n```bash\n# List objects (brief mode, limit 100 by default, max 1000)\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket} -limit={limit} -s\n\n# List objects under a prefix (folder) — used for diagnosis comparison\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket}/{prefix} -limit={limit} -s\n\n# Estimated summary of the bucket (size / object count)\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls obs://{bucket} -limit=1 -du\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `obs://{bucket}[/{prefix}]` | Yes | Bucket URL, optional prefix/folder |\n| `-limit={limit}` | No | Max objects returned (default 100, max 1000) |\n| `-s` | No | Brief mode (key + LastModified + size only) |\n| `-d` | No | List objects and sub-folders of current folder |\n| `-v` | No | List object versions |\n| `-marker={marker}` | No | Pagination marker (continue from last key) |\n| `-bf=raw` | No | Raw byte format for sizes |\n\n### Diagnose Ineffective Lifecycle Rules (R3)\n\n```bash\n# One-shot diagnosis: rule config vs object actual state\npython3 scripts/obs_lifecycle_analyzer.py diagnose --bucket {bucket} --prefix {prefix}\n\n# Diagnosis dimensions covered:\n# 1. Rule status disabled (Status != Enabled)\n# 2. Prefix/filter mismatch (object keys do not start with rule prefix / tags differ)\n# 3. Age not elapsed (object LastModified + expiration days > now)\n# 4. Rule order / overlapping prefixes (first matching rule wins)\n# 5. Versioning: Expiration deletes current version; NoncurrentVersion* handles old versions\n# 6. Object already in colder class / already expired\n# 7. Bucket-level blockers (no rule for this prefix at all)\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--bucket` | Yes | Bucket name (no `obs://` prefix) |\n| `--prefix` | No | Restrict object scan to a key prefix |\n| `--limit` | No | Max objects scanned (default 1000) |\n| `--rule-id` | No | Focus diagnosis on a specific rule ID |\n\n### Analyze Lifecycle Cost (R3)\n\n```bash\npython3 scripts/obs_lifecycle_analyzer.py cost --bucket {bucket} --prefix {prefix}\n\n# Output: per-rule transition plan (class + days), affected object count/size,\n# and a standard-vs-IA-vs-Archive/DeepArchive monthly cost comparison (approximation).\n# NOTE: this is a storage-class cost estimation; actual billed amounts come from\n# BSS billing data and may differ by region/pricing tier.\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--bucket` | Yes | Bucket name |\n| `--prefix` | No | Restrict object scan to a key prefix |\n| `--limit` | No | Max objects scanned (default 1000) |\n| `--price-file` | No | Custom JSON price table (see `references/lifecycle-rule-format.md`) |\n\n### Preview Lifecycle Rule (dry-run, R3)\n\n```bash\n# Preview: which objects a rule WOULD affect (expire / transition) if applied now\npython3 scripts/obs_lifecycle_analyzer.py preview \\\n --bucket {bucket} --prefix {prefix} --rule-id {rule_id} --days {days}\n\n# Shorter form: preview from an existing rule by ID\npython3 scripts/obs_lifecycle_analyzer.py preview --bucket {bucket} --rule-id {rule_id}\n\n# Output: per-rule matched object list (key, LastModified, age, action) + count + total size\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--bucket` | Yes | Bucket name |\n| `--rule-id` | No | Preview impact of an existing rule (by ID) |\n| `--prefix` | No | Rule prefix to simulate |\n| `--days` | No | Expiration/transition days to simulate |\n| `--action` | No | `expire` or `transition` (default: from the rule) |\n| `--limit` | No | Max objects scanned (default 1000) |\n\n### Create Lifecycle Rule (R2) — preview + confirm first\n\n```bash\n# 1. Dry-run preview of the intended scope\npython3 scripts/obs_lifecycle_analyzer.py preview --bucket {bucket} --prefix {prefix} --days {days}\n\n# 2. Build the rule JSON (see references/lifecycle-rule-format.md for the full schema)\n# cat > /tmp/new-rule.json <<'EOF'\n# {\"Rules\":[{\"ID\":\"{rule_id}\",\"Prefix\":\"{prefix}\",\"Status\":\"Enabled\",\"Expiration\":{\"Days\":{days}}}]}\n# EOF\n\n# 3. IMPORTANT: obsutil PUT replaces the ENTIRE lifecycle configuration —\n# merge the new rule into the EXISTING rules first (the analyzer does this):\npython3 scripts/obs_lifecycle_analyzer.py create-rule \\\n --bucket {bucket} --rule-id {rule_id} --prefix {prefix} --action expire --days {days}\n\n# 4. Confirm with user, then apply (the script prints the final merged JSON and asks for confirmation)\n```\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `--bucket` | Yes | Bucket name |\n| `--rule-id` | Yes | Rule ID (unique within the bucket, 1-255 chars) |\n| `--prefix` | Yes | Object key prefix the rule applies to (`{prefix}` or empty for whole bucket) |\n| `--action` | Yes | `expire` (delete objects) or `transition` (change storage class) |\n| `--days` | Yes* | Expiration/transition days after last modified (required for `expire`; with `transition`, `--storage-class` required) |\n| `--storage-class` | No | Target class for transition: `WARM` (IA) / `COLD` (Archive) / `DEEP_ARCHIVE` |\n| `--apply` | No | Skip the preview+confirm gate (for scripted automation — only after user confirmation was given elsewhere) |\n\n### Update Lifecycle Rule (R2) — preview + confirm first\n\n```bash\n# Update = get current config → modify the target rule → put back.\n# --action selects which action to modify:\n# expire → touch Expiration only\n# transition → touch Transitions[].Days/StorageClass only\n# Omitted → updates the action the rule already has; REQUIRED when the rule\n# has BOTH Expiration and Transitions (never guess, never add an action type\n# silently — a transition update must not touch/add Expiration).\npython3 scripts/obs_lifecycle_analyzer.py update-rule \\\n --bucket {bucket} --rule-id {rule_id} --action transition --days {new_days}\n\n# change the transition storage class too\npython3 scripts/obs_lifecycle_analyzer.py update-rule \\\n --bucket {bucket} --rule-id {rule_id} --action transition --days {new_days} --storage-class WARM\n\n# verify the result\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=get\n```\n\n### Delete Lifecycle Rule (R1) — preview + double-confirm\n\n```bash\n# Delete ONE rule: remove it from the config and put back\npython3 scripts/obs_lifecycle_analyzer.py delete-rule --bucket {bucket} --rule-id {rule_id}\n\n# DESTRUCTIVE: delete the ENTIRE lifecycle configuration (use only after double-confirmation)\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs lifecycle obs://{bucket} -method=delete\n```\n\n> ⚠️ The single-rule delete flow (preferred) removes only `{rule_id}` and keeps all other rules intact. The `-method=delete` form wipes **all** rules of the bucket — irreversible.\n\n## KooCLI Command Format Standard\n\n> **obsutil passthrough mode** — `hcloud obs` is a dedicated OBS module that maps 1:1 to obsutil commands. It intentionally does **not** use the standard `hcloud <Service> <Operation>\n> --cli-region=<region>` syntax:\n\n| Feature | Description | Example |\n|---------|-------------|---------|\n| Service name | `obs` (lowercase, fixed) | `hcloud obs` |\n| Operation | obsutil verb, lowercase | `lifecycle`, `ls`, `stat`, `config`, `mb` |\n| Bucket URL | `obs://{bucket}` | `obs://my-bucket` |\n| obsutil options | `-key=value` / `-flag` | `-method=get`, `-limit=100`, `-s` |\n| Region / endpoint | Encoded in the endpoint `obs.{region}.myhuaweicloud.com` (configured once via `hcloud obs config`), **not** `--cli-region` | `-e=obs.cn-south-1.myhuaweicloud.com` |\n| Rule JSON | Lifecycle configuration in the obsutil JSON schema (see `references/lifecycle-rule-format.md`) | `{\"Rules\":[{\"ID\":\"r1\",\"Prefix\":\"logs/\",\"Status\":\"Enabled\",\"Expiration\":{\"Days\":30}}]}` |\n\n## Parameter Confirmation\n\nDetailed per-action parameter tables: `references/lifecycle-rule-format.md` (rule JSON schema) and `references/related-commands.md` (command quick reference).\n\n| Key Parameter | Required For | Description |\n|---------------|-------------|-------------|\n| `obs://{bucket}` | Every action | Target bucket |\n| `-method=get/put/delete` | huawei_list/get/create/update/delete_obs_lifecycle_rule | Lifecycle operation to perform |\n| `-localfile={rule_file}` | create/update/delete (put) | Rule JSON file to apply (PUT replaces the whole config) |\n| `{rule_id}` | get/update/delete/preview | Lifecycle rule ID |\n| `{prefix}` | all rule actions | Object key prefix filter (`{prefix}` = whole bucket) |\n| `{days}` | create/update/preview | Expiration or transition days after last modification |\n| `-limit` | list objects / analyze / preview | Max objects to scan (default 100, max 1000) |\n| `--action` | create/update/preview | `expire` or `transition` |\n\n> **Quality telemetry**: every run reports automatically through `skill-quality-cli`\n> (see the **Dependency** note in [Overview](#overview) and the `skill-quality-cli`\n> section of `references/cli-installation-guide.md`). Opt out with `SKILL_QUALITY_REPORT=0`.\n> The analyzer script itself contains no reporting code — telemetry is attached by the\n> `skill-quality-cli run` wrapper around every `hcloud` command.\n\n### Error Code Convention\n\n| Prefix | Category | Examples |\n|--------|----------|----------|\n| U | User input | U01 missing param, U03 no data found, U04 permission denied |\n| C | Config | C01 missing AK/SK / obsutil not configured |\n| N | Network | N01 timeout, N02 connection failed |\n| B | Code bug | B01 exception in analyzer |\n| P | Platform | P01 scheduler error |\n\n## Critical Warnings\n\n| Action | Warning |\n|--------|---------|\n| `huawei_create_obs_lifecycle_rule` | Replaces the **whole** lifecycle configuration — always merge with existing rules. Requires preview + confirmation. |\n| `huawei_update_obs_lifecycle_rule` | Modifies object housekeeping behavior; preview the new scope + confirm. |\n| `huawei_delete_obs_lifecycle_rule` | **Irreversible** — deleted rules are not recoverable. Preview + double-confirm. |\n| `hcloud obs lifecycle obs://{bucket} -method=delete` | Deletes the **entire** lifecycle configuration of the bucket. Use only after double-confirmation. |\n\n## Authentication\n\n### Mode 1: env-based (recommended for scripts)\n\n```bash\nexport HUAWEI_ACCESS_KEY={ak}\nexport HUAWEI_SECRET_KEY={sk}\n# obsutil picks these up from its own config; configure once interactively\n# (hcloud prompts for AK/SK/endpoint, keeps them out of shell history):\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs config\n```\n\n> **Security rule:** never type or paste AK/SK into the chat, and **never pass\n> AK/SK as plaintext CLI args** (`-i={ak} -k={sk}` leaks via shell history /\n> process list). Configure credentials out-of-band (interactive `hcloud obs\n> config` / env vars / shell profile), then re-run. This skill never hardcodes\n> credentials and its scripts read them only from the environment / obsutil config.\n\n### Mode 2: obsutil config file (interactive)\n\n```bash\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs config -e=obs.{region}.myhuaweicloud.com # prompts for AK/SK;\n# or\nobsutil config # prompts for AK/SK/endpoint\nskill-quality-cli run --skill-name huawei-cloud-obs-lifecycle-management -- hcloud obs ls -limit=1 # verify connectivity\n```\n\n## Reference Documents\n\n- `references/cli-installation-guide.md` — hcloud CLI + obsutil install & credential configuration\n- `references/iam-policies.md` — Least-privilege IAM policy JSON for lifecycle management\n- `references/lifecycle-rule-format.md` — Lifecycle rule JSON schema, examples, and best practices\n- `references/related-commands.md` — Command quick reference and official API mapping\n- `references/verification-method.md` — Verification steps and acceptance test cases\n- `references/dataflow-diagram.md` — Mermaid data flow diagram\n- `references/acceptance-criteria.md` — Acceptance criteria checklist",
"cost": {
"context_tokens": 4713
}
}
Fetch it by URL: GET /api/v1/registry/huaweicloud-huaweicloud-skills-huawei-cloud-obs-lifecycl-5dad37/manifest?version=1.0.0
Reviews
Star ratings from people who tried it. One review per account; edit yours any time.
No reviews yet. Install it, try it, and be the first to rate it.