Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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-devот 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 huaweicloudsdkvpc v2 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_list cells 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

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkvpc to enable the SDK fallback path.
  2. 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.
  3. 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-id or the HUAWEICLOUD_SDK_PROJECT_ID / HUAWEI_PROJECT_ID environment variables. The KooCLI path resolves it from the profile automatically.
  4. IAM permission — read-only vpc:subnets:list; least-privilege policy in references/iam-policies.md.
  5. Python 3.8+ (standard library only — argparse / json / subprocess).
  6. 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

  1. Confirm the target region (default cn-north-4).
  2. Confirm KooCLI readiness (optional, read-only) by listing the active credential profile.
  3. Run the list script with the desired output mode and filters.
  4. Read the result — table for humans, --json for downstream tooling, --names-only for a compact inventory.
  5. 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 --
Полный SKILL.md на ClawHub

Установить 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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить huawei-cloud-vpc-subnet-list с