Command Palette

Search for a command to run...

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

huawei-cloud-nat-list

БесплатноЗапускает вложенные скриптыНе проверен

1. List Huawei Cloud public NAT gateways in a tenant region through KooCLI (hcloud NAT ListNatGateways — read-only GET /v2/{project_id}/nat_gateways), with an…

wlc-devот wlc-dev192 установки в других каталогах

Об этом скилле

Huawei Cloud Public NAT Gateway List

Overview

Query the public NAT gateway list of a tenant through KooCLI hcloud NAT ListNatGateways (official read-only GET /v2/{project_id}/nat_gateways, verified in the huaweicloudsdknat v2 client _list_nat_gateways_http_info metadata and the KooCLI CLI 命令参考). The skill is aimed at NAT gateway inventory inspection, daily operations patrol, and as a pre-query step for other skills that need a NAT gateway id or its associated VPC router_id.

Architecture:

agent → python3 scripts/list_nat_gateways.py → hcloud NAT ListNatGateways --cli-region=<region>
      → Huawei Cloud NAT OpenAPI (nat.<region>.myhuaweicloud.com) → parsed JSON → table / --json / --names-only

(hcloud binary missing) → fallback: huaweicloudsdknat v2 NatClient.list_nat_gateways

Key properties:

  • Read-only by design — the only API ever invoked is ListNatGateways (GET). A write-intent guard scans user arguments and validates the operation name; mutating intents (create / delete / update / SNAT / DNAT rule changes / tag changes) 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 huaweicloudsdknat v2 SDK (list_nat_gateways). 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 ListNatGateways (spec 取值:1 小型 / 2 中型 / 3 大型 / 4 超大型 / 5 企业型).
  • Offline-testable — every code path (marker paging, filters, error classification, guard, SDK fallback) is covered by unit tests that mock the hcloud subprocess.

Out of scope: private NAT gateways, every SNAT / DNAT rule action (list / create / update / delete), and every mutating NAT gateway action (create / update / delete a gateway, EIP binding, tag changes, prepaid conversion). Those require a dedicated write-capable skill and explicit user confirmation.

Prerequisites

  1. KooCLI (hcloud) installed — see references/cli-installation-guide.md. Alternative: pip install huaweicloudsdkcore huaweicloudsdknat 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 NAT REST path is /v2/{project_id}/nat_gateways; 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 nat:natGateways:list; least-privilege policy in references/iam-policies.md.
  5. Python 3.8+ (standard library only — argparse / json / subprocess).
  6. Outbound HTTPS access to nat.cn-north-4.myhuaweicloud.com.

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

# Full-field table (default)
python3 scripts/list_nat_gateways.py --region cn-north-4

# Raw JSON of every returned field
python3 scripts/list_nat_gateways.py --json

# Compact NAT gateway name list only
python3 scripts/list_nat_gateways.py --names-only

# Filter by gateway status (server-side query parameter)
python3 scripts/list_nat_gateways.py --status ACTIVE

# Filter by spec: 1 small / 2 medium / 3 large / 4 extra-large
python3 scripts/list_nat_gateways.py --spec 1

# Filter by exact name / associated VPC router_id
python3 scripts/list_nat_gateways.py --name my-nat
python3 scripts/list_nat_gateways.py --vpc d0a1b2c3-4d5e-6f70-8192-a3b4c5d6e7f8

# Combine filters
python3 scripts/list_nat_gateways.py --region cn-north-4 --status ACTIVE --spec 2

Equivalent direct KooCLI command (the script wraps exactly this call, with marker paging):

hcloud NAT ListNatGateways --cli-region=cn-north-4 --limit=2000

Parameter Confirmation

Parameter Required Description Example
--region / -r No Huawei Cloud region (defa
Полный SKILL.md на ClawHub

Установить huawei-cloud-nat-list в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл huawei-cloud-nat-list?

1. List Huawei Cloud public NAT gateways in a tenant region through KooCLI (hcloud NAT ListNatGateways — read-only GET /v2/{project_id}/nat_gateways), with an automatic fallback to the official huaweicloudsdknat v2 SDK when hcloud is not installed. 2. Three output modes: full-field table (default, every returned field including ID/名称/规格/状态/关联VPC/状态/创建时间), --json (raw response array), and --names-only (compact NAT gateway name list). 3. Supports --name / --spec / --status / --vpc (router_id) filtering (all real server-side ListNatGateways query parameters), region override, and automatic marker paging. 4. Explicit error hints for empty NAT gateway lists (「当前区域无公网NAT网关」), 403 / insufficient IAM permission (「无权限访问公网NAT网关」), 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 / SNAT / DNAT rule changes / tag changes) or any operation other than ListNatGateways is rejected before execution — this skill is strictly read-only. 6. Triggers include: "list NAT gateways", "nat gateway list", "NAT网关列表", "查询NAT网关", "查询公网NAT网关", "公网NAT网关列表", "NAT 实例列表", "华为云 NAT", "nat gateway inventory". 7. Offline unit tests (mocked hcloud subprocess) cover output modes, filters, marker paging, error scenarios, SDK fallback, and the write-intent guard.

Как установить скилл huawei-cloud-nat-list?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл huawei-cloud-nat-list запускает скрипты?

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

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

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