Install
openclaw skills install @wlc-dev/huawei-cloud-rms-list
Query the Huawei Cloud RMS unified resource inventory of a tenant through KooCLI (hcloud RMS ListAllResources --cli-region=<region>; official read-only GET /v1/resource-manager/domains/{domain_id}/all-resources), with an automatic fallback to the huaweicloudsdkrms v1 SDK when KooCLI is absent. 2. Four read-only views: account-wide resource list (default, ListAllResources), provider+type-scoped resource list (ListResources), the RMS provider / resource-type catalog (ListProviders) and the RMS region catalog (ListRegions). 3. Four output modes: aligned full-field table (default), --json, --markdown (GitHub-flavored table) and --csv; --output writes a file via a temp file + atomic rename. 4. Filters: --provider / --type / --region-id / --ep-id / --id / --name / --tags / --domain-id (all real RMS query parameters) plus automatic marker paging (and offset paging for ListProviders). 5. Explicit error hints for empty inventories, 403 / missing rms:resources:list permission (RMS.00010006), missing AK/SK credentials, a missing KooCLI backend, and bad export paths. 6. Built-in write-intent guard: any mutating intent (create / delete / update / enable / disable / run-query ...) or any operation outside the four read-only ones is rejected before execution — this skill is strictly read-only. 7. Triggers include: "RMS 资源清单", "查询资源管理服务资源", "统一资源视图", "rms list resources", "list all resources", "资源清单导出", "资源盘点", "RMS resources list", "华为云资源清单".
openclaw skills install @wlc-dev/huawei-cloud-rms-listQuery the Huawei Cloud RMS (Resource Management Service) unified resource view of
a tenant through KooCLI hcloud RMS ListAllResources --cli-region=<region>
(official read-only GET /v1/resource-manager/domains/{domain_id}/all-resources,
verified in the huaweicloudsdkrms v1 client _list_all_resources_http_info
metadata). The skill is aimed at account-wide resource inventory / 资源盘点, asset
archival, compliance pre-checks, and as a pre-query step for other skills that
need a resource_id.
Architecture:
agent → python3 scripts/list_rms_resources.py → skill-quality-cli ─▶ hcloud RMS <Operation> --cli-region=<region> [filters] [--marker]
→ Huawei Cloud RMS OpenAPI (resource-manager) → parsed JSON → table / json / markdown / csv
(hcloud binary missing) → fallback: huaweicloudsdkrms v1 RmsClient (ListAllResources / ListResources / ListProviders / ListRegions)
(missing SDK) → run scripts/ensure_env.py (auto pip install)
Key properties:
ListAllResources, ListResources, ListProviders and ListRegions (all
GET). A write-intent guard scans the user arguments and validates the
operation name; mutating intents (create / delete / update / enable / disable /
run-query ...) are rejected with an explicit message before any command runs.skill-quality-cli for telemetry); when the hcloud binary is absent, the
script falls back to the official huaweicloudsdkrms v1 SDK. Credentials are
always read by the CLI profile / SDK environment — never handled by the
script.page_info.next_marker until the
last page; ListProviders advances offset until total_count is reached.RMS.00010006 permission envelope returned on
stdout with rc=0), SDK fallback, renderers and atomic export are covered by
offline unit tests that mock the hcloud subprocess.Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).
Capability boundary: this skill lists/queries the RMS resource inventory and the provider/region catalogs only. It does not create, delete or modify resources, does not manage RMS config aggregators / trackers / policy assignments, and never writes anything back to the cloud. Those require a separate skill and explicit user confirmation (确认).
hcloud) installed — the primary execution path; see
references/cli-installation-guide.md.
When absent, the SDK fallback is used.python3 scripts/ensure_env.py to install huaweicloudsdkcore and
huaweicloudsdkrms automatically. Rendering itself needs only the standard
library.HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK, HUAWEI_ACCESS_KEY /
HUAWEI_SECRET_KEY, HW_*, ...). Never paste AK/SK into chat; the script
never reads, echoes or stores secrets itself.rms:resources:list (plus rms::listTags /
rms::listResourcesByTag when listing tag-based views); least-privilege policy
in references/iam-policies.md.cn-north-4 by default (the RMS SDK catalog advertises the
global endpoint https://rms.myhuaweicloud.com).python3 scripts/ensure_env.py
installs any missing SDK dependency.--list-providers / --list-regions for the catalogs; --provider P --type T
for a provider+type-scoped list (ListResources).--region-id, --ep-id, --id, --name, --tags,
--domain-id (real server-side RMS query parameters).--format and --output.⚠️ Mandatory quality wrapping:
scripts/list_rms_resources.pybuilds everyhcloudCLI call asskill-quality-cli run --skill-name huawei-cloud-rms-list -- hcloud ...(enforced in code, not left to the agent). Ifskill-quality-cliis unavailable (runbash scripts/ensure_cli.sh) orSKILL_QUALITY_REPORT=0, the CLI path degrades to barehcloud(no telemetry) — the read-only semantics and the CLI→SDK fallback are unchanged. When thehcloudbinary itself is not resolvable, the wrapping is skipped and the bare command runs, so the missing binary surfaces asFileNotFoundError→ConfigErrorand the SDK fallback still triggers.
# Default: account-wide RMS resource inventory (ListAllResources) as a table
python3 scripts/list_rms_resources.py --region cn-north-4
# Export the inventory to a JSON / Markdown / CSV file
python3 scripts/list_rms_resources.py --format json --output /tmp/rms_resources.json
python3 scripts/list_rms_resources.py --format markdown --summary --output /tmp/rms_resources.md
python3 scripts/list_rms_resources.py --format csv --output /tmp/rms_resources.csv
# Filter by region, resource type, enterprise project, name or tags
python3 scripts/list_rms_resources.py --region-id cn-north-4 --type ecs.cloudservers
python3 scripts/list_rms_resources.py --ep-id 0 --name web-01
python3 scripts/list_rms_resources.py --tags env=prod --tags owner=ops
# Provider+type-scoped resource list (ListResources)
python3 scripts/list_rms_resources.py --provider ecs --type cloudservers
# RMS provider / resource-type catalog and region catalog
python3 scripts/list_rms_resources.py --list-providers --format table
python3 scripts/list_rms_resources.py --list-regions --format json
# Read-only credential readiness check (also wrapped)
skill-quality-cli run --skill-name huawei-cloud-rms-list -- hcloud configure list
Equivalent direct KooCLI commands (the script wraps exactly these calls, with automatic paging):
hcloud RMS ListAllResources --cli-region=cn-north-4 --limit=100
hcloud RMS ListResources --cli-region=cn-north-4 --provider=ecs --type=cloudservers --limit=100
hcloud RMS ListProviders --cli-region=cn-north-4 --limit=100 --offset=1
hcloud RMS ListRegions --cli-region=cn-north-4
| Parameter | Required | Description | Example |
|---|---|---|---|
--region / -r | No | Huawei Cloud region (default cn-north-4) | cn-south-1 |
--format / -f | No | Output mode: table (default) / json / markdown(md) / csv | --format json |
--output / -o | No | Export file path (json/markdown/csv; default rms_<view>_<region>_<timestamp>.<ext>) | /tmp/rms.json |
--summary | No | Append a summary line to the Markdown report | --summary |
--domain-id | No | Account domain id (RMS required path parameter; resolved by KooCLI/SDK when omitted) | 01a0...996d6 |
--list-providers | No | List the RMS provider / resource-type catalog (ListProviders) | — |
--list-regions | No | List the RMS region catalog (ListRegions) | — |
--provider | No | Cloud service name; with --type selects ListResources | ecs |
--type | No | Resource type; in full mode it is provider.type | ecs.cloudservers |
--region-id | No | Filter by region ID — real server-side query parameter | cn-north-4 |
--ep-id | No | Filter by enterprise project ID — real server-side query parameter | 0 |
--id | No | Filter by resource ID — real ListAllResources query parameter | r-0001 |
--name | No | Filter by resource name — real ListAllResources query parameter | web-01 |
--tags | No | Filter by tag(s), repeatable — real ListAllResources query parameter | env=prod |
--limit | No | Page size (default 100; pages are fetched automatically) | 200 |
--offset | No | Paging offset (ListProviders; default 1, min 1) | 1 |
--track | No | Whether resources are collected by default (ListProviders) | Tracked |
--max-pages | No | Maximum auto-pages (default 100, prevents infinite loops) | 50 |
Output-mode precedence: --format selects the mode; --output only matters for
the file formats (json / markdown / csv); table writes to stdout. The
local --output path value (e.g. a file literally named
rms-delete-report.json) and the filter values are excluded from the
write-intent guard because they are not RMS operations.
create, delete, update, modify, enable,
disable, run-query, and RMS operation names such as
CreateConfigurationAggregator, DeletePolicyAssignment,
UpdateTrackerConfig).GuardError, prints
[错误] 检测到写操作意图 ... 已被守卫拦截, and exits with code 1 before a
single hcloud command is executed.ListAllResources / ListResources / ListProviders / ListRegions
(all GET) are ever constructed by build_command(); there is no code path
that can issue a mutating RMS API call.hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]
RMS.ListAllResources,
ListResources, ListProviders, ListRegions.--cli-region=<region>, e.g.
--cli-region=cn-north-4.--key=value, e.g. --limit=100, --marker=<token>,
--region_id=cn-north-4, --type=ecs.cloudservers, --provider=ecs.
All filters are real server-side parameters (verified against the
huaweicloudsdkrms v1 request models and hcloud RMS <Operation> --help).--tags.N=value, e.g. --tags.1=env=prod.--limit + --marker (page_info.next_marker);
ListProviders uses --limit + --offset (total_count)._http_info) —
GET /v1/resource-manager/domains/{domain_id}/all-resources (ListAllResources),
GET /v1/resource-manager/domains/{domain_id}/provider/{provider}/type/{type}/resources (ListResources),
GET /v1/resource-manager/domains/{domain_id}/providers (ListProviders),
GET /v1/resource-manager/domains/{domain_id}/regions (ListRegions).| Scenario | Behavior |
|---|---|
| Empty inventory | Exit 0, prints 当前区域(<x>)无 <operation> 结果 (+ active filters); a header-only export file is still written |
403 / missing rms:resources:list (RMS.00010006) | Exit 1, 无权限访问资源管理服务(RMS),请检查 IAM 权限 hint; the envelope is detected even on stdout with rc=0 |
| Missing / invalid AK-SK | Exit 1, explicit hint to configure hcloud credentials out-of-band (never in chat) |
| hcloud not installed | Falls back to the SDK; if the SDK is unavailable too, exit 1 with a clear hint |
Bad --output path (permission / bad dir) | Exit 1, 导出文件写出失败 hint; no partial file is left |
--provider without --type | Exit 1, explicit hint that ListResources needs both |
KooCLI usage error ([USE_ERROR] ..., even with rc=0) | Exit 1, explicit hcloud 参数错误 hint pointing to hcloud RMS <Operation> --help |
| Network / API failure | Exit 1 with the hcloud stderr excerpt |
| Write intent detected | Exit 1, GuardError message, no command executed |
Exit codes: 0 success / empty region; 1 config, auth, guard, export, or API
error.
| Scenario | Handling |
|---|---|
| Region has no resources | Friendly message + a header-only export file, exit 0 |
--provider / --type / --region-id / --tags filters | Forwarded as real server-side query parameters |
| Large resource count | Automatic marker paging (page_info.next_marker aware, max 100 pages) |
| Extra response fields | Table/CSV columns are built from the union of returned fields |
| Field missing on a record | Rendered as - |
Nested tags / resource_types | Flattened into k=v,... / name,... strings |
| hcloud absent, SDK installed | Transparent fallback to huaweicloudsdkrms, same output modes |
--output points to a non-existing directory | Directory is created automatically |
--output path contains a guard keyword | Path value is excluded from the guard (local path ≠ RMS operation) |
| Provider/region catalog returned | Rendered with provider / region_id columns and display_name |
| User asks to create/delete an RMS resource or aggregator | Out of scope — blocked by the write-intent guard; a write-capable skill with explicit user confirmation (确认) is required |
Offline unit tests with a mocked hcloud subprocess (no credentials, no network), run from the skill directory:
python3 -m unittest discover -s tests -v
Coverage: write-intent guard (read passes / create / delete / update / enable /
normalized variants / operation whitelist / value-flag exclusion / following-flag
still scanned), operation resolution, command construction (filters, domain id,
language, provider scope), JSON extraction and error-envelope classification
(including the RMS.00010006 permission envelope on stdout with rc=0), marker
paging, provider offset paging, SDK fallback (missing hcloud / missing env
credentials), rendering (table / Markdown / CSV / JSON) and atomic export.
| Document | Content |
|---|---|
| references/iam-policies.md | Least-privilege read-only IAM policy |
| references/cli-installation-guide.md | KooCLI + SDK installation, credential configuration and skill-quality-cli |
| references/verification-method.md | How the skill and its tests were verified |
| references/dataflow-diagram.md | Mermaid data flow diagram |
| references/acceptance-criteria.md | Acceptance criteria checklist |