huawei-cloud-vpc-subnet-list
БесплатноЗапускает вложенные скриптыНе проверен1. List Huawei Cloud VPC subnets (Subnet) in a tenant region through KooCLI (hcloud VPC ListSubnets — read-only GET /v1/{project_id}/subnets), with an…
от wlc-dev208 установок в других каталогахОб этом скилле
Huawei Cloud VPC Subnet (Subnet) List
Overview
Query the VPC subnet (Subnet) list of a tenant through the KooCLI VPC
ListSubnets operation (hcloud VPC ListSubnets, official read-only
GET /v1/{project_id}/subnets, verified in the huaweicloudsdkvpc v2 client
_list_subnets_http_info metadata). The skill is aimed at subnet inventory
inspection, daily network operations patrol, and as a pre-query step for other
skills that need a subnet id, its CIDR or gateway.
Architecture:
agent → python3 scripts/list_subnet.py → hcloud VPC ListSubnets --cli-region=<region>
→ Huawei Cloud VPC OpenAPI (vpc.<region>.myhuaweicloud.com) → parsed JSON → table / --json / --names-only
(hcloud binary missing) → fallback: huaweicloudsdkvpc v2 VpcClient.list_subnets
Key properties:
- Read-only by design — the only API ever invoked is
ListSubnets(GET). A write-intent guard scans user arguments and validates the operation name; mutating intents (create / delete / update / associate / disassociate / attach / detach / release / change) are rejected with an explicit message before any command runs. - CLI first, SDK fallback — KooCLI is the primary execution path; when the
KooCLI binary is absent, the script falls back to the official
huaweicloudsdkvpcv2 SDK (list_subnets). Credentials are always read by the CLI profile / SDK environment — never handled by the script. - Full-field table output — the default table renders the union of all
fields returned by ListSubnets, with the nested
extra_dhcp_opts/dns_listcells compacted into single JSON columns. - Offline-testable — every code path (marker paging, vpc_id filter, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.
Out of scope: every mutating VPC/subnet action (create / update / delete a VPC or subnet, security group, route table, port or flow log; associate / disassociate a resource; VPC peering accept/reject). Those require a dedicated write-capable skill and explicit user confirmation.
Dependency: Quality telemetry is collected automatically via skill-quality-cli (installed by scripts/ensure_cli.sh if absent).
Prerequisites
- KooCLI (
hcloud) installed — see references/cli-installation-guide.md. Alternative:pip install huaweicloudsdkvpcto enable the SDK fallback path. - Active credential profile — configure credentials out-of-band (run the KooCLI configure command in your terminal, or set credential environment variables). Never paste AK/SK into chat; the script never reads, echoes, or stores secrets itself — authentication is delegated entirely to the hcloud profile / SDK environment.
- project_id (SDK fallback only) — the subnet REST path is
/v1/{project_id}/subnets; when falling back to the SDK, supply the project id via--project-idor theHUAWEICLOUD_SDK_PROJECT_ID/HUAWEI_PROJECT_IDenvironment variables. The KooCLI path resolves it from the profile automatically. - IAM permission — read-only
vpc:subnets:list; least-privilege policy in references/iam-policies.md. - Python 3.8+ (standard library only — argparse / json / subprocess).
- Outbound HTTPS access to
vpc.cn-north-4.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
- Confirm the target region (default
cn-north-4). - Confirm KooCLI readiness (optional, read-only) by listing the active credential profile.
- Run the list script with the desired output mode and filters.
- Read the result — table for humans,
--jsonfor downstream tooling,--names-onlyfor a compact inventory. - Handle the empty / error cases per the Edge Cases table below (the script prints an explicit hint for empty region, 403, and missing AK/SK).
Core Commands
⚠️ Mandatory: every hcloud command in this skill MUST be wrapped with skill-quality-cli run --skill-name huawei-cloud-vpc-subnet-list -- ** — bare hcloud calls are strictly forbidden.
# Full-field table (default)
python3 scripts/list_subnet.py --region cn-north-4
# Raw JSON of every returned field
python3 scripts/list_subnet.py --json
# Compact subnet name list only
python3 scripts/list_subnet.py --names-only
# Filter by the owning VPC id (server-side query parameter)
python3 scripts/list_subnet.py --vpc-id vpc-0001
# Combine filters / region
python3 scripts/list_subnet.py --region cn-north-4 --vpc-id vpc-0001 --names-only
Equivalent direct KooCLI command (the script wraps exactly this call, with marker paging):
skill-quality-cli run --skill-name huawei-cloud-vpc-subnet-list -- hcloud VPC ListSubnets --cli-region=cn-north-4 --
Установить huawei-cloud-vpc-subnet-list в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл huawei-cloud-vpc-subnet-list?
1. List Huawei Cloud VPC subnets (Subnet) in a tenant region through KooCLI (hcloud VPC ListSubnets — read-only GET /v1/{project_id}/subnets), with an automatic fallback to the official huaweicloudsdkvpc v2 SDK when hcloud is not installed. 2. Three output modes: full-field table (default, every returned field including id/name/vpc_id/cidr/gateway_ip/status and the remaining subnet attributes), --json (raw response array), and --names-only (compact subnet name list). 3. Supports --vpc-id filtering (a real server-side ListSubnets query parameter), region override, and automatic marker paging. 4. Explicit error hints for empty subnet lists (「当前区域无 VPC 子网(Subnet)」), 403 / insufficient IAM permission (「无权限访问 VPC 子网(Subnet)」), missing or invalid AK/SK credentials, missing project_id on the SDK fallback, and hcloud not installed. 5. Built-in write-intent guard: any mutating intent (create / delete / update / associate / disassociate / attach / detach / release / change) or any operation other than ListSubnets is rejected before execution — this skill is strictly read-only. 6. Triggers include: "list subnets", "subnet list", "VPC 子网列表", "查询子网", "子网名称列表", "子网清单", "vpc subnet", "华为云子网", "子网盘点", "子网列表查询", "虚拟私有云子网列表", "subnet inventory". Every trigger is subnet-scoped (子网/subnet) and none contains a bare VPC phrase, so no trigger is a substring of a sibling VPC skill's trigger (routing stays unambiguous). 7. Offline unit tests (mocked hcloud subprocess) cover output modes, filters, marker paging, error scenarios, SDK fallback, and the write-intent guard.
Как установить скилл huawei-cloud-vpc-subnet-list?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл huawei-cloud-vpc-subnet-list запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic