Install
openclaw skills install @sdk-team/alibabacloud-cloud-native-internet-diagnosticsRead-only diagnostics for the public internet egress capability of Alibaba Cloud cloud-native products: cloud-native gateway (MSE), cloud-native API gateway, AI gateway, Serverless App Engine (SAE), and Function Compute (FC). Use when the user asks whether such an instance can access the public internet, reports outbound connectivity failure, or wants to check a fixed public egress IP. Resolves the VPC/vSwitch bound to the instance, then verifies NAT gateway SNAT egress for that vSwitch; produces a diagnosis report. Read-only: never creates, modifies, or deletes any resource. Triggers: "cloud-native gateway public internet", "MSE gateway outbound", "APIG outbound connectivity", "AI gateway public network", "SAE public internet", "SAE outbound connectivity", "FC fixed public IP", "FC function outbound", "cloud-native internet diagnostics", "vSwitch NAT SNAT egress".
openclaw skills install @sdk-team/alibabacloud-cloud-native-internet-diagnosticsDiagnose whether an Alibaba Cloud cloud-native product instance (MSE gateway, cloud-native API gateway, AI gateway, SAE application, FC function) can reach the public internet. The flow queries the instance to obtain its bound VPC and vSwitch, then checks whether that vSwitch has a NAT gateway SNAT public egress.
MANDATORY:
scripts/cloud_native_internet_diag.py. Do not hand-assemble CLI command chains or inline Python.| Requirement | Value | Why |
|---|---|---|
| Python | 3.8 or newer | runs the two scripts; standard library only, no third-party packages |
| aliyun CLI | version 3.3.3 or newer, on PATH | all cloud queries go through the CLI in lowercase-hyphenated plugin mode (e.g. aliyun vpc describe-nat-gateways); older builds lack the plugin-mode metadata and the --user-agent flag this skill relies on |
Check the installed version first:
aliyun version
If the reported version is older than 3.3.3, upgrade the CLI before running any diagnosis (any one of these routes):
# macOS / Linux with Homebrew
brew upgrade aliyun-cli
# any platform: replace the binary with the latest release from
# https://github.com/aliyun/aliyun-cli/releases
# verify the upgrade took effect
aliyun version
A CLI older than 3.3.3 is a hard blocker: report the version gap and the upgrade command to the user instead of falling back to hand-assembled HTTP calls.
--access-key-id / --access-key-secret / --sts-token parameters. Never export or echo plaintext credentials on the command line.scripts/sts_token.py only performs identity verification and UID derivation (via aliyun sts get-caller-identity); it never carries credentials.gw- prefixed instance id without naming the product, you MUST ask whether it is a cloud-native gateway (MSE) or a cloud-native API gateway / AI gateway — both families share the gw- prefix but use completely different APIs. Never guess.Keyword triggers:
Intent triggers:
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| product | string | Yes | Product type: mse_gateway / apig_gateway / ai_gateway / sae / fc | mse_gateway |
| region | string | Yes | Region id where the instance lives | cn-hangzhou |
| instance-id | string | Yes | Instance id (gateway/SAE) or function name (FC) | gw-cuqp1e6m1hkgu37dj3ag |
| uid | string | No | Customer account UID; auto-derived via aliyun sts get-caller-identity when omitted | 1534830445234223 |
Required inputs: product, region, instance-id (three items). If the user omits any of them, ask before proceeding; do not run with guessed values.
Auto-fill first, ask second: never ask the user for the UID when it can be derived via sts_token.py. Whenever any parameter is auto-filled (e.g. UID), the Agent MUST explicitly declare it in the response, e.g. "UID auto-derived via sts:GetCallerIdentity: 1772241626973633". This declaration is mandatory and must appear in the final output.
| # | Product | Key | Instance id shape | Query API |
|---|---|---|---|---|
| 1 | Cloud-native Gateway (MSE) | mse_gateway | starts with gw- | mse:GetGateway |
| 2 | Cloud-native API Gateway | apig_gateway | starts with gw- | apig:GetGateway |
| 3 | AI Gateway | ai_gateway | starts with gw- | apig:GetGateway |
| 4 | Serverless App Engine | sae | UUID, e.g. xxxx-xxx-xxxx | sae:DescribeApplicationConfig |
| 5 | Function Compute | fc | function name (string) | fc:GetFunction |
Critical distinction: MSE gateways and API/AI gateways both use
gw-prefixed ids but different APIs. Confirm the exact product first. See references/module1_instance_lookup.md.
| Module | Purpose | File |
|---|---|---|
| Instance Lookup | Five-product API details and response field parsing | references/module1_instance_lookup.md |
| vSwitch Egress | NAT/SNAT egress determination and FC four-quadrant table | references/module2_vswitch_egress.md |
| Report Template | Diagnosis report structure (with Information Sources) | references/report-template.md |
| RAM Policies | Minimum read-only RAM policy, action by action | references/ram-policies.md |
Load references on demand. Do not read all reference files unless the task requires them.
User request
|
v
Step 1: confirm product / region / instance-id (gw- prefix => must clarify)
|
v
Step 2: identity verification + UID derivation (sts_token.py)
|
v
Step 3: run cloud_native_internet_diag.py
| (instance lookup -> FC four-quadrant -> vSwitch NAT/SNAT check)
|
v
Step 4: render the diagnosis report (dual-layer: machine JSON + human report)
mse_gatewayapig_gatewayai_gatewaysaefcgw- prefixed id without a named product → MUST ask: MSE gateway or API/AI gateway?If the user refuses or cannot provide these, stop and explain that they are mandatory for diagnosis.
SKILL_DIR=~/.qoderwork/skills/alibabacloud-cloud-native-internet-diagnostics
cd $SKILL_DIR && python3 scripts/sts_token.py --json
Prints the caller identity (AccountId / Arn / IdentityType) and derives the UID. On failure, guide the user to configure the aliyun CLI default credential chain or authorize the RAM role (see references/ram-policies.md).
cd $SKILL_DIR && python3 scripts/cloud_native_internet_diag.py \
--product <product> --region <region> --instance-id <instance_id>
The script emits a dual-layer output:
summary (plain-English verdict for non-technical users), plain_language_conclusion (one-sentence conclusion), and recommended_actions (array of next steps, empty when no action is needed). This JSON is the input for downstream processing.[INFO] / [WARN] / [ERROR] progress traces, followed by a formatted human-readable report block (Product / Instance / Region / Conclusion / Details / How it works / Next steps) that can be shown to the user directly.Degraded paths (authorization errors, instance not found, invalid parameters) produce the same dual-layer output with an actionable summary instead of a raw error code.
Build the final report per references/report-template.md, including the Information Sources section and any auto-fill declarations. Prefer the script's own summary / plain_language_conclusion / recommended_actions for the user-facing conclusion; the stderr report block can be quoted for non-technical users.
Every OpenAPI call MUST carry the skill User-Agent built from this template:
--user-agent AlibabaCloud-Agent-Skills/{SKILL_NAME}/{session-id}
Template fields:
alibabacloud-cloud-native-internet-diagnostics (fixed, equals the frontmatter name)uuid.uuid4().hex)session-id rules (MANDATORY):
Code-layer implementation: scripts/cloud_native_internet_diag.py and scripts/sts_token.py each build _USER_AGENT from this template with uuid.uuid4().hex and pass --user-agent on every aliyun CLI invocation.
gw- but use different APIs. Always confirm the product; never guess.internetAccess=false + vSwitchIds configured) needs the NAT/SNAT check, which runs against every bound vSwitch; quadrants A/B/C conclude directly from GetFunction. See references/module2_vswitch_egress.md.[WARN] on stderr and surfaced in the report warnings.aliyun CLI version 3.3.3 or newer on PATH — see the Prerequisites section above for the version check and the upgrade routes. No third-party Python packages are required.Example 1: User: "Does cloud-native gateway gw-685f661467b54f in Hangzhou have public internet access?"
The user said "cloud-native gateway" but also used a gw- id; confirm whether it is MSE or API/AI gateway first. Assuming MSE:
cd $SKILL_DIR && python3 scripts/sts_token.py --json
cd $SKILL_DIR && python3 scripts/cloud_native_internet_diag.py \
--product mse_gateway --region cn-hangzhou --instance-id gw-685f661467b54f
Example 2: User: "Does FC function my-function have a fixed public IP?" (region cn-hangzhou)
cd $SKILL_DIR && python3 scripts/cloud_native_internet_diag.py \
--product fc --region cn-hangzhou --instance-id my-function
If the JSON shows fc_quadrant: "D", the script automatically verifies NAT SNAT egress of the bound vSwitch; quadrants A/B/C conclude directly.
Example 3: User: "SAE application 7171a6ca-d1cd-4928-8642-7d5cfe69abcd cannot reach the public internet in Beijing."
cd $SKILL_DIR && python3 scripts/cloud_native_internet_diag.py \
--product sae --region cn-beijing --instance-id 7171a6ca-d1cd-4928-8642-7d5cfe69abcd
Example 4: User: "Does APIG gateway gw-xxx in Shanghai have public egress?"
cd $SKILL_DIR && python3 scripts/cloud_native_internet_diag.py \
--product apig_gateway --region cn-shanghai --instance-id gw-xxx
Note: a gw- prefixed id of the APIG / AI gateway family is resolved via apig:GetGateway, not mse:GetGateway — confirm the product family before running.