Huawei Cloud VPCEP Name List Skill
Overview
This skill provides read-only name-query capabilities for Huawei Cloud VPCEP (VPC Endpoint
Service). It lists all VPC Endpoints in a region, supports fuzzy name matching via the
endpoint_service_name parameter, and paginated queries with limit/offset. It is
designed for quick name lookups, inventory reporting, and daily endpoint inspection.
Architecture
Agent → hcloud CLI (primary) → Huawei Cloud VPCEP API
↘ Python SDK (fallback) ↗
Applicable Scenarios
- List all VPCEP endpoint names in a region for inventory
- Find VPCEP endpoints by name keyword (fuzzy match via endpoint_service_name)
- Paginated browsing of VPCEP endpoint list
- Check endpoint status, VPC, IP and creation time
Prerequisites
- hcloud CLI installed and authenticated — See
references/cli-installation-guide.md - Python 3.8+ with
huaweicloudsdkvpceppackage (SDK fallback) - Huawei Cloud AK/SK configured via environment variables or
hcloud configure set - IAM permissions —
VPCEP ReadOnlyAccessor finer-grained policy — Seereferences/iam-policies.md
Workflow
- Identify query scope — Decide whether to list all VPCEP endpoints, filter by name keyword, or paginate
- Select execution mode — Use the hcloud CLI by default; fall back to the Python SDK if the CLI is unavailable
- Execute the query — Run the appropriate command and capture the response
- Present results — Summarize endpoint names, IDs, statuses, VPC, IP and creation time in a readable form
Note on fuzzy matching: The VPCEP
ListEndpointsAPI supports fuzzy name matching via theendpoint_service_nameparameter. This parameter matches endpoint names that contain the given keyword string, not an exact or prefix match.
Core Commands
Endpoint Name Queries
| Purpose | Command |
|---|---|
| List all VPCEP endpoints | hcloud VPCEP ListEndpoints --cli-region={region} --limit={limit} |
| List endpoints filtered by name (fuzzy) | hcloud VPCEP ListEndpoints --cli-region={region} --endpoint_service_name={name} [--limit={limit}] |
| List endpoints with pagination | hcloud VPCEP ListEndpoints --cli-region={region} --limit={limit} --offset={offset} |
| List endpoints filtered by name with pagination | hcloud VPCEP ListEndpoints --cli-region={region} --endpoint_service_name={name} --limit={limit} --offset={offset} |
Name-Only Lookup (jq)
To extract just the endpoint names:
hcloud VPCEP ListEndpoints --cli-region={region} --limit={limit} | jq -r '.endpoints[].endpoint_service_name'
To list endpoint names with status, VPC and IP:
hcloud VPCEP ListEndpoints --cli-region={region} --limit={limit} | jq -r '.endpoints[] | "\(.endpoint_service_name)\t\(.status)\t\(.vpc_id)\t\(.ip)"'
To show total count and paginated summary:
hcloud VPCEP ListEndpoints --cli-region={region} --limit={limit} | jq '{total_count, endpoints: [.endpoints[] | {name: .endpoint_service_name, id, status, vpc_id, ip, created_at}]}'
SDK Fallback Examples
When the CLI is unavailable, use the Python SDK:
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkvpcep.v1.region.vpcep_region import VpcepRegion
from huaweicloudsdkvpcep.v1 import vpcep_client
from huaweicloudsdkvpcep.v1.model import ListEndpointsRequest
credentials = BasicCredentials() \
.with_ak(os.getenv("HUAWEI_ACCESS_KEY") or os.getenv("HUAWEICLOUD_SDK_AK")) \
.with_sk(os.getenv("HUAWEI_SECRET_KEY") or os.getenv("HUAWEICLOUD_SDK_SK")) \
.with_project_id("{project_id}")
client = vpcep_client.VpcepClient.new_builder() \
.with_credentials(credentials) \
.with_region(VpcepRegion.value_of("{region}")) \
.build()
request = ListEndpointsRequest()
request.limit = 100
response = client.list_endpoints(request)
print(f"Total: {response.total_count}")
for ep in response.endpoints:
print(ep.endpoint_service_name, ep.status, ep.vpc_id, ep.ip, ep.created_at)
Parameter Confirmation
| Parameter | Required | Description | Example |
|---|---|---|---|
{region} |
Yes | Huawei Cloud region | cn-north-4 |
{name} |
No | Endpoint name keyword (fuzzy match via endpoint_service_name) | my-endpoint |
{limit} |
No | Maximum records to return (1-500, default 10) | 100 |
{offset} |
No | Offset for pagination (default 0) | 0 |
{project_id} |
Conditional | Project ID (required for SDK/API) | 0a1234b56c78d9ef |
Reference Documents
KooCLI Command Format Standard
hcloud VPCEP <Operation> --cli-region=<region> [--key=value ...]
| Feature | Description | Example |
|---|---|---|
| Service name | VPCEP |
hcloud VPCEP ListEndpoints |
| Operation name | PascalCase | ListEndpoints |
| Region parameter | --cli-region=<value> |
--cli-region=cn-north-4 |
| Simple parameter | --key=value |
--endpoint_service_name=my-endpoint |
