Lists Huawei Cloud EIP (Elastic IP, 弹性公网IP) resources — enumerates all EIPs in a region with public IP address, EIP ID, status, bandwidth, associated instance and creation time, using the KooCLI `hcloud EIP ListPublicips` command (primary) or the huaweicloudsdkeip Python SDK (fallback). Provides read-only EIP inventory for network resource auditing, cost review and resource discovery. Use this skill whenever the user mentions EIP list query. Triggers include: list EIPs, EIP list, query EIP, enumerate EIPs, show EIPs, elastic IP list, public IP inventory, 查询弹性公网IP, EIP列表, 弹性公网IP列表, 查看EIP, 列出EIP, 获取EIP列表, 查询EIP, 查询公网IP.
编程
huawei-cloud-ecs-eip-query
试用Queries the EIP (Elastic IP, 弹性公网IP) bound to a single Huawei Cloud ECS instance — given an ECS ID or ECS name, returns the associated public IP address, EIP ID, status, bandwidth and binding details, using the KooCLI `hcloud EIP ListPublicips` command (primary, filtered by `vnic.device_id`) or the huaweicloudsdkeip Python SDK (fallback). Provides a read-only per-instance EIP lookup for network troubleshooting, cost review and resource discovery. Use this skill whenever the user wants the EIP of a specific ECS. Triggers include: ECS EIP query, EIP of ECS, find ECS public IP, ECS 的EIP, 查询ECS的弹性公网IP, ECS公网IP, ECS绑定的EIP, 单个ECS的eip, 查询ECS的eip, 查看ECS的弹性IP, ECS外网IP, 获取ECS公网地址.
它能做什么
Queries the EIP (Elastic IP, 弹性公网IP) bound to a single Huawei Cloud ECS instance — given an ECS ID or ECS name, returns the associated public IP address, EIP ID, status, bandwidth and binding details, using the KooCLI `hcloud EIP ListPublicips` command (primary, filtered by `vnic.device_id`) or the huaweicloudsdkeip Python SDK (fallback). Provides a read-only per-instance EIP lookup for network troubleshooting, cost review and resource discovery. Use this skill whenever the user wants the EIP of a specific ECS. Triggers include: ECS EIP query, EIP of ECS, find ECS public IP, ECS 的EIP, 查询ECS的弹性公网IP, ECS公网IP, ECS绑定的EIP, 单个ECS的eip, 查询ECS的eip, 查看ECS的弹性IP, ECS外网IP, 获取ECS公网地址.
技能文档
Huawei Cloud ECS EIP Query Skill
Overview
This skill queries the EIP (Elastic IP, 弹性公网IP) bound to a single Huawei Cloud ECS instance. Given an ECS ID or ECS name (and an optional region), it returns the associated public IP address, EIP ID, status, bandwidth, and binding metadata. It is a read-only lookup skill: it never creates, modifies or deletes EIPs or ECS instances.
Architecture:
Agent → hcloud CLI (EIP, primary) → Huawei Cloud EIP API
↘ huaweicloudsdkeip Python SDK (fallback) ↗
Applicable Scenarios:
- Check which public IP a specific ECS is using (troubleshooting connectivity)
- Per-instance network cost review (EIP bandwidth and billing mode)
- Resource discovery and inventory (mapping ECS → EIP bindings)
- Compliance reporting (per-instance public exposure)
Prerequisites
- hcloud CLI (KooCLI) installed and authenticated — See
references/cli-installation-guide.md - IAM permissions —
vpc:publicIps:list(list) andvpc:publicIps:get(show detail), plusecs:servers:list/ecs:servers:getwhen resolving an ECS by name — Seereferences/eip-policies.md - Python 3.6+ with
huaweicloudsdkeippackage (SDK fallback) —pip install huaweicloudsdkeip
Credentials. KooCLI reads credentials from
hcloud configure(AK/SK) or environment variables. The EIP API is region-scoped: the same account credentials used for other Huawei Cloud services work here, and--cli-regionselects the region whose EIPs are queried. Never ask the user to paste AK/SK into the conversation.
Workflow
- Determine the ECS — accept the ECS ID directly, or resolve an ECS name to its ID first:
hcloud ECS ListServersDetails --cli-region= --name= - Run the query —
hcloud EIP ListPublicips/v3 --cli-region= --vnic.device_id.1=(CLI primary) - Handle results — Parse the EIP public IP, EIP ID, status, bandwidth and binding details; report whether the ECS has a bound EIP
- Fallback — If the CLI is unavailable, use the Python SDK example below
Core Commands
Query EIP by ECS ID (primary)
hcloud EIP ListPublicips/v3 --cli-region=cn-north-4 --vnic.device_id.1=
vnic.device_id is the bound ECS instance ID — this returns only the EIPs bound to that ECS.
Query EIP by ECS ID (JSON Output)
hcloud EIP ListPublicips/v3 --cli-region=cn-north-4 --vnic.device_id.1= --cli-output=json
Note:
ListPublicipsis a multi-version API — the version hint line (ListPublicips is a multi-version API, where the version (v3) is default...) is printed to stdout only when the/v3version suffix is omitted. All commands in this skill use the explicit/v3suffix, so their output is pure JSON — parse it directly withjq/python3 -c json.load(do not usetail -n +2, which would cut off the first{and break JSON parsing). If you ever run a command without the version suffix and see the hint line, drop it withtail -n +2before parsing, or prefer the SDK fallback path below.
Resolve ECS Name to ID
hcloud ECS ListServersDetails --cli-region=cn-north-4 --name= --cli-output=json
The ECS ID is in the servers[].id field. ECS names are fuzzy matched; pass the exact name for a precise lookup.
Show ECS Detail (addresses include the public IP)
hcloud ECS ShowServer --cli-region=cn-north-4 --server_id=
The addresses field lists both fixed (private) and floating (public/EIP) addresses with OS-EXT-IPS:type of fixed or floating.
Show EIP Detail
hcloud EIP ShowPublicip/v3 --cli-region=cn-north-4 --publicip_id=
SDK Fallback Example
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkeip.v3 import EipClient
from huaweicloudsdkeip.v3.model import ListPublicipsRequest
from huaweicloudsdkeip.v3.region.eip_region import EipRegion
credentials = BasicCredentials(
os.environ["HUAWEI_CLOUD_ACCESS_KEY"],
os.environ["HUAWEI_CLOUD_SECRET_KEY"],
)
client = EipClient.new_builder() \
.with_credentials(credentials) \
.with_region(EipRegion.value_of("cn-north-4")) \
.build()
request = ListPublicipsRequest()
request.vnic_device_id = [""]
response = client.list_publicips(request)
eips = response.publicips or []
for eip in eips:
print(eip.id, eip.public_ip_address, eip.status, eip.associate_instance_type)
print("EIP number:", len(eips))
Parameter Confirmation
| Parameter | Required | Description | Example |
|---|---|---|---|
--cli-region | Yes | Huawei Cloud region for the CLI endpoint | cn-north-4 |
--vnic.device_id.[N] | Yes (or ECS name + ListServersDetails) | Filter by bound ECS instance ID | --vnic.device_id.1=xxx |
--project_id | No | Project ID (defaults to the region's parent project) | --project_id=xxx |
--name | No* | ECS name to resolve to an ECS ID first | --name=my-ecs |
--server_id | No* | ECS ID for ECS ShowServer detail lookup | --server_id=xxx |
--publicip_id | No* | EIP ID for EIP ShowPublicip/v3 detail lookup | --publicip_id=xxx |
--cli-output | No | Output format (json/table) | --cli-output=json |
* Used by the corresponding sub-command; the primary EIP query only needs the ECS ID and region.
Reference Documents
- CLI Installation Guide
- EIP and ECS Policies
- Verification Method
- Data Flow Diagram
- Acceptance Criteria
KooCLI Command Format Standard
The hcloud EIP and hcloud ECS modules map directly to the Huawei Cloud EIP/ECS API operations.
| Feature | Description | Example |
|---|---|---|
| Service name | EIP / ECS | hcloud EIP ListPublicips |
| Operation name | EIP/ECS API operation name | ListPublicips / ShowServer |
| Simple parameter | --key=value | hcloud EIP ListPublicips --cli-output=json |
| Array parameter | --key.[N]=value | --vnic.device_id.1= |
| Output format | --cli-output=json/table | --cli-output=json |
| Credentials | KooCLI configured account (AK/SK or env vars) | hcloud configure |
相关技能
Queries Huawei Cloud ECS (Elastic Cloud Server) resources in read-only mode. Covers ECS instances, flavors, keypairs, quotas, server groups, block devices, NICs, VNC console, launch templates, recycle bin, scheduled events, and tags. No write operations. Use this skill when the user needs to query ECS instance details, list flavors, check server status, view block devices, or inspect ECS resource attributes. Triggers include: 查询ECS, ECS实例查询, 云服务器查询, 弹性云服务器, ECS规格, ECS配额, 云服务器列表, ECS详情, query ECS, list ECS servers, show server details, ECS flavors, ECS quotas, ECS keypairs, server groups, block devices, ECS inventory, cloud server list, ecs list, ecs query, ecs show.
Huawei Cloud EIP (Elastic IP) cost optimization skill using hcloud CLI (KooCLI). 1. List and query EIPs across regions with detailed status 2. Identify idle/unbound EIPs and generate cost optimization reports 3. Set up idle EIP monitoring with webhook/email alerts 4. Generate HTML/JSON cost analysis reports 5. Maintain operation audit logs for compliance **Read-only analysis only - NO bandwidth adjustment, tag management, or EIP release/deletion**. Triggers include: "EIP cost optimization", "idle EIP analysis", "EIP audit", "cost report", "EIP status query", "EIP list", "EIP monitoring", "EIP alert", "cost analysis", "idle monitoring", "operation audit", "EIP 成本优化", "闲置 EIP 分析", "EIP 审计", "成本报告", "EIP 状态查询", "EIP 查询", "EIP 列表", "EIP 监控", "EIP 告警", "成本分析", "闲置监控", "操作审计"
通过华为云命令行工具 hcloud 调用云监控服务 CES,查询 ECS 实例的 CPU、内存、磁盘与网络指标。
面向华为云资源的只读查询能力,用于资源清点、核对与参数发现。
通过本地 Python 脚本只读查询华为云 ECS、BMS、IMS、AS 资源。