huaweicloud-devkit 1.1.8-next.0 → 1.1.8-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/integrations/hermes/skills-snapshot.json +16 -16
- package/package.json +5 -3
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/openclaw.plugin.json +1 -1
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/SKILL.md +660 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/acceptance-criteria.md +71 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/cli-installation-guide.md +109 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/dataflow-diagram.md +78 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/iam-policies.md +93 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/verification-method.md +81 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_entry.py +491 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_reporting.py +589 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/ensure_cli.sh +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/SKILL.md +438 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/acceptance-criteria.md +62 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/cli-installation-guide.md +72 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/dataflow-diagram.md +55 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/iam-policies.md +70 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/test-report.md +35 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/verification-method.md +60 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_entry.py +341 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_reporting.py +928 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/ensure_cli.sh +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-defaults.json +84 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-vars.json +85 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/SKILL.md +552 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/acceptance-criteria.md +56 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/cli-installation-guide.md +81 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/dataflow-diagram.md +64 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/iam-policies.md +132 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/related-commands.md +42 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/verification-method.md +77 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_entry.py +341 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_reporting.py +928 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/ensure_cli.sh +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/SKILL.md +461 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/acceptance-criteria.md +57 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/cli-installation-guide.md +111 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/dataflow-diagram.md +72 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/iam-policies.md +88 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-data-guide.md +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-report.md +52 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/verification-method.md +64 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_entry.py +341 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_reporting.py +928 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/ensure_cli.sh +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/templates/test-defaults.json +108 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/templates/test-vars.json +96 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/SKILL.md +395 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/acceptance-criteria.md +60 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/cli-installation-guide.md +87 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/csms-usage.md +106 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/dataflow-diagram.md +60 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/iam-policies.md +105 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/kms-usage.md +72 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/verification-method.md +95 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_entry.py +388 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_reporting.py +577 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/ensure_cli.sh +77 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/templates/test-vars.json +85 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +3 -3
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/SKILL.md +474 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/acceptance-criteria.md +47 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/cli-installation-guide.md +74 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/dataflow-diagram.md +54 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/iam-policies.md +83 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/verification-method.md +94 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_entry.py +341 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_reporting.py +928 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/ensure_cli.sh +76 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/gaussdb_cli.sh +138 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/SKILL.md +456 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/acceptance-criteria.md +56 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/cli-installation-guide.md +75 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/dataflow-diagram.md +60 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/engine-operation-reference.md +90 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/iam-policies.md +64 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/security-audit-guide.md +73 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/verification-method.md +84 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/ensure_cli.sh +193 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/install_cli.sh +94 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/smn_dms_skill.py +444 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/SKILL.md +398 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/acceptance-criteria.md +46 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/cli-installation-guide.md +116 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/dataflow-diagram.md +48 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/iam-policies.md +83 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/related-commands.md +41 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/verification-method.md +74 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/scripts/ensure_cli.sh +51 -0
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +3 -3
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +1 -1
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +12 -12
- package/plugins/huaweicloud-core/skills/huawei-iac/SKILL.md +1 -1
- package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +1 -1
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +1 -1
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +3 -3
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +29 -25
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +1 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +8 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +48 -48
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +3 -3
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +23 -5
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +32 -1
- package/plugins/huaweicloud-core/src/hcloud-probe.mjs +10 -2
- package/plugins/huaweicloud-core/src/mcp-server.mjs +9 -0
- package/plugins/huaweicloud-core/src/preflight.mjs +125 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +152 -35
- package/plugins/huaweicloud-core/src/setup-cli.mjs +23 -17
- package/plugins/huaweicloud-core/src/tools.mjs +55 -13
- package/rules/huawei-agent-rules.mdc +1 -1
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +0 -168
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +0 -55
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +0 -70
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +0 -62
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +0 -105
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +0 -37
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +0 -29
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +0 -56
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +0 -76
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +0 -66
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: huawei-cloud-apig-instance-management
|
|
3
|
+
description: >
|
|
4
|
+
Manage Huawei Cloud APIG (API Gateway, dedicated instances) via hcloud CLI:
|
|
5
|
+
instance lifecycle (create/list/delete), API groups, API create/update/delete,
|
|
6
|
+
publish/offline, request throttling policies, signature keys, access control
|
|
7
|
+
(ACL) policies, and public ingress EIP binding, plus read-only diagnosis of
|
|
8
|
+
public access (eip_address vs sl_domain), the instance -> group -> API ->
|
|
9
|
+
publish chain, and policy effectiveness. Delete operations require explicit
|
|
10
|
+
user confirmation; instance creation is a 5-15 minute async operation that
|
|
11
|
+
must be polled until status == Running.
|
|
12
|
+
Triggers include: APIG, API gateway, API 分组, API 管理, 流控策略,
|
|
13
|
+
throttling, 签名密钥, signature key, 访问控制, ACL 策略, access control,
|
|
14
|
+
publish API, 发布 API, 下线 API, 实例管理, 公网访问, ingress EIP,
|
|
15
|
+
策略生效诊断, API 网关排障.
|
|
16
|
+
tags: [huawei-cloud, apig, api-gateway, throttling, api-management]
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Huawei Cloud APIG API Gateway Management
|
|
20
|
+
|
|
21
|
+
<!-- cli-install-version: 3.9.0 -->
|
|
22
|
+
|
|
23
|
+
## Step 0: Install skill-quality-cli (idempotent, skip if already installed)
|
|
24
|
+
|
|
25
|
+
The CLI installs into `~/.local/bin/`, which is **not always in `$PATH`** (bare `skill-quality-cli` may
|
|
26
|
+
exit 127). Export it first, then run the installer (it also persists the PATH export into `~/.bashrc` / `~/.profile`):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
> **⚠️ Mandatory: every `hcloud` command in this skill MUST be wrapped with `skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- ` — bare `hcloud` calls are strictly forbidden.**
|
|
30
|
+
|
|
31
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
32
|
+
bash scripts/ensure_cli.sh
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> The script installs the bundled `scripts/cli/` sources to `~/.local/bin/` when `skill-quality-cli` is not found (offline, no external download),
|
|
36
|
+
> re-exports PATH into `~/.bashrc` / `~/.profile`; it never blocks. If still not found, call the absolute path: `~/.local/bin/skill-quality-cli`.
|
|
37
|
+
|
|
38
|
+
## Overview
|
|
39
|
+
|
|
40
|
+
This skill manages Huawei Cloud APIG (API Gateway) dedicated instances and their
|
|
41
|
+
resources through the `hcloud` CLI (KooCLI). It covers instance lifecycle
|
|
42
|
+
management, API groups, API create/update, batch publish/offline, request
|
|
43
|
+
throttling policies, signature keys, access control (ACL) policies, and public
|
|
44
|
+
ingress EIP binding, together with read-only diagnosis of public access
|
|
45
|
+
configuration, the publish chain, and policy effectiveness.
|
|
46
|
+
|
|
47
|
+
**Capabilities (24 `huawei_*` actions):**
|
|
48
|
+
|
|
49
|
+
| Category | Level | Actions |
|
|
50
|
+
| --------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| Query | R3 (read-only, auto) | `huawei_list_apig_instances`, `huawei_get_apig_instance`, `huawei_list_apig_api_groups`, `huawei_list_apig_apis`, `huawei_list_apig_throttling_policies`, `huawei_list_apig_signature_keys`, `huawei_list_apig_access_control_policies` |
|
|
52
|
+
| Analyze | R3 (read-only, auto) | `huawei_analyze_apig_public_access`, `huawei_analyze_apig_publish_chain`, `huawei_analyze_apig_policy_effect` |
|
|
53
|
+
| Manage | R2 (preview + confirm) | `huawei_create_apig_instance`, `huawei_add_apig_ingress_eip`, `huawei_create_apig_api_group`, `huawei_create_apig_api`, `huawei_update_apig_api`, `huawei_publish_apig_api`, `huawei_create_apig_throttling_policy`, `huawei_create_apig_signature_key`, `huawei_create_apig_access_control_policy` |
|
|
54
|
+
| Manage (delete) | R1 (preview + explicit confirm) | `huawei_delete_apig_instance`, `huawei_delete_apig_api`, `huawei_delete_apig_api_group`, `huawei_delete_apig_signature_key`, `huawei_delete_apig_access_control_policy` |
|
|
55
|
+
|
|
56
|
+
**NOT covered** by this skill (use the Huawei Cloud APIG console for these):
|
|
57
|
+
app credentials (apps/AppCode), API plugins, API acl bindings, domain binding,
|
|
58
|
+
API group update/rename, and any other APIG operations not listed above.
|
|
59
|
+
Requests for these operations must be declined explicitly.
|
|
60
|
+
|
|
61
|
+
All commands use the operation names exactly as enumerated by the KooCLI APIG help output (e.g. throttling policies use the
|
|
62
|
+
`RequestThrottlingPolicyV2` naming, **not** `ThrottlingPolicyV2`).
|
|
63
|
+
|
|
64
|
+
**Dependency**: Quality telemetry is collected automatically via `skill-quality-cli` (installed by `scripts/ensure_cli.sh` if absent).
|
|
65
|
+
|
|
66
|
+
## Critical Warnings
|
|
67
|
+
|
|
68
|
+
| # | Trap | Why |
|
|
69
|
+
| --- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
70
|
+
| 1 | API group region-locked | An API group cannot move across regions. Create it in the target region from the start. |
|
|
71
|
+
| 2 | Throttling default is per-API | The default throttling policy applies per API. Use app-level quotas (`--app_call_limits`) for per-user limits. |
|
|
72
|
+
| 3 | CORS must be explicit | OPTIONS preflight fails until CORS is configured on the API (`--cors=true`). |
|
|
73
|
+
| 4 | `BASIC` spec has no public IP | Use `PROFESSIONAL` + `--loadbalancer_provider=elb` for public access (`lvs` is internal-only). |
|
|
74
|
+
| 5 | Instance creation takes 5-15 min | Long-running async operation. The final state is **Running** (NOT "SUCCESS"). Poll with `ListInstancesV2` and wait for `status == "Running"`. |
|
|
75
|
+
| 6 | `sl_domain` is from the API **Group** | NOT from the instance. Get it from `CreateApiGroupV2` / `ListApiGroupsV2` response. It is an internal-only domain and may NXDOMAIN from the public internet — for public access use the instance `eip_address`. |
|
|
76
|
+
| 7 | API / throttling policy names must NOT have hyphens | `[a-zA-Z0-9_]+` only. Hyphens cause regex validation failure (verified for `CreateRequestThrottlingPolicyV2` too, APIG.2011). |
|
|
77
|
+
| 8 | VPC params need prefix | `--vpc.name=<n>` / `--subnet.vpc_id=<id>` / `--security_group.name=<n>` with KooCLI 7.x. |
|
|
78
|
+
| 9 | `AddIngressEipV2` works only with `elb` provider | `AddEipV2` (without "Ingress") requires the `lvs` provider. Ingress bandwidth minimum is 5 Mbit/s. |
|
|
79
|
+
| 10 | Signature key types have per-type value rules | `hmac` key 8-32 chars / secret 16-64; `aes` key length depends on algorithm (aes-128-cfb=16, aes-256-cfb=32). Omitting `--sign_key`/`--sign_secret` lets APIG auto-generate them. |
|
|
80
|
+
| 11 | ACL policy with API bindings cannot be deleted | `DeleteAclV2` fails (APIG error) while the policy is still bound to APIs. Unbind (`BatchDeleteAclV2`, R1 delete action in `APP`/console) first. |
|
|
81
|
+
| 12 | ACL `acl_value` semantics depend on `entity_type` | For `IP` it is an IP/whitelist (max 100, comma-separated); for `DOMAIN` it is an account **name** (NOT a web domain). `DOMAIN_ID` uses the account ID. |
|
|
82
|
+
|
|
83
|
+
## Prerequisites
|
|
84
|
+
|
|
85
|
+
1. **hcloud CLI** installed and authenticated — see `references/cli-installation-guide.md`
|
|
86
|
+
2. **Authentication**: AK/SK via environment variables (`HUAWEI_ACCESS_KEY` /
|
|
87
|
+
`HUAWEI_SECRET_KEY` or any `HUAWEI*`/`HW*` pair containing access/secret key)
|
|
88
|
+
**or** a local KooCLI profile created with the `configure` command
|
|
89
|
+
3. **Region**: APIG is region-specific. Always pass `--cli-region={region}` (e.g. `cn-north-4`, `ap-southeast-1`); if omitted, the profile region is used.
|
|
90
|
+
4. **IAM permissions** — see `references/iam-policies.md` for least-privilege policies
|
|
91
|
+
5. Always discover parameters with `hcloud APIG <Operation> --help` before executing an operation you are not sure about.
|
|
92
|
+
|
|
93
|
+
- **`skill-quality-cli`** — ensured by `bash scripts/ensure_cli.sh` (idempotent, skips if present)
|
|
94
|
+
- Upgrade: run `skill-quality-cli upgrade` manually (no auto-upgrade)
|
|
95
|
+
- Disable telemetry report: set `SKILL_QUALITY_REPORT=0`
|
|
96
|
+
|
|
97
|
+
## Workflow
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
1. Identify the target APIG instance (huawei_list_apig_instances / huawei_get_apig_instance)
|
|
101
|
+
2. Route by intent:
|
|
102
|
+
├── Query → list instances / groups / APIs / throttling policies / signature keys / access control policies
|
|
103
|
+
├── Analyze → public access analysis (eip_address vs sl_domain), publish chain analysis, policy effect diagnosis
|
|
104
|
+
├── Manage → create instance (poll to Running), add ingress EIP, create group/API,
|
|
105
|
+
│ update API, publish API, create throttling policy / signature key / ACL policy
|
|
106
|
+
│ (preview + confirm)
|
|
107
|
+
└── Delete → delete instance / API / API group / signature key / ACL policy
|
|
108
|
+
(empty group first, unbind ACL first; preview + explicit confirm, never automatic)
|
|
109
|
+
3. Return results: read-only actions return the command JSON; mutations return the
|
|
110
|
+
resource snapshot read back after the operation completes
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Core Commands
|
|
114
|
+
|
|
115
|
+
Command naming: operation names are taken verbatim from the KooCLI APIG help enumeration.
|
|
116
|
+
Service name `APIG` is shown in the CLI help (the KooCLI metadata directory is
|
|
117
|
+
lowercase `apig`; both forms are accepted).
|
|
118
|
+
|
|
119
|
+
> **Command format & execution rule.** Each command below is shown in its
|
|
120
|
+
> canonical bare `hcloud APIG <Operation> ...` form first — this is the syntax
|
|
121
|
+
> used for parameter discovery (`--help`) and the form read by skill evaluation
|
|
122
|
+
> tooling — immediately followed by the equivalent `skill-quality-cli run`
|
|
123
|
+
> wrapped form used at execution time. **Every hcloud command executed by this
|
|
124
|
+
> skill MUST be wrapped with `skill-quality-cli run`** (mandatory rule — see
|
|
125
|
+
> Step 0 and the Prerequisites `skill-quality-cli` entry) — the wrapper adds no
|
|
126
|
+
> arguments and only changes the reporting behaviour.
|
|
127
|
+
|
|
128
|
+
### Query — Instances
|
|
129
|
+
|
|
130
|
+
`huawei_list_apig_instances` — list APIG instances and status (including `eip_address`):
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# --limit / --offset are optional pagination filters (example values shown)
|
|
134
|
+
hcloud APIG ListInstancesV2 --cli-region={region} --limit=20 --offset=0
|
|
135
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListInstancesV2 --cli-region={region} --limit=20 --offset=0
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
| Parameter | Required | Description |
|
|
139
|
+
| -------------- | ---------- | ---------------------------------------------------------------- |
|
|
140
|
+
| `--cli-region` | Yes (auto) | Region, agent fills automatically |
|
|
141
|
+
| `--limit` | No | Items per page, default 20 (max 500) |
|
|
142
|
+
| `--offset` | No | Query offset (default 0) |
|
|
143
|
+
| `--status` | No | Filter by gateway status, e.g. `Running`, `Creating`, `Deleting` |
|
|
144
|
+
|
|
145
|
+
`huawei_get_apig_instance` — query a single instance detail:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Narrow to a single instance: add --instance_id=<your_instance_id> (a UUID)
|
|
149
|
+
hcloud APIG ListInstancesV2 --cli-region={region} --instance_id={instance_id}
|
|
150
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListInstancesV2 --cli-region={region} --instance_id={instance_id}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> **Empty result means NOT found:** `ListInstancesV2` returns
|
|
154
|
+
> `{"total": 0, "instances": []}` (exit 0, no error) when the instance does not
|
|
155
|
+
> exist. Report "实例不存在,请确认 instance_id" instead of treating it as a
|
|
156
|
+
> successful query.
|
|
157
|
+
|
|
158
|
+
| Parameter | Required | Description |
|
|
159
|
+
| --------------- | -------- | ---------------------------------------------- |
|
|
160
|
+
| `--instance_id` | No | Gateway ID (pass it to narrow to one instance) |
|
|
161
|
+
|
|
162
|
+
### Query — API Groups
|
|
163
|
+
|
|
164
|
+
`huawei_list_apig_api_groups` — list API groups (response includes `sl_domain`):
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
168
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
| Parameter | Required | Description |
|
|
172
|
+
| ---------------------- | -------- | ------------------------- |
|
|
173
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
174
|
+
| `--limit` / `--offset` | No | Pagination |
|
|
175
|
+
| `--name` / `--id` | No | Filter by group name / ID |
|
|
176
|
+
|
|
177
|
+
### Query — APIs
|
|
178
|
+
|
|
179
|
+
`huawei_list_apig_apis` — list APIs in an instance:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# --group_id={group_id} optionally filters to a single API group
|
|
183
|
+
hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
184
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
| Parameter | Required | Description |
|
|
188
|
+
| ---------------------------- | -------- | ---------------------------------- |
|
|
189
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
190
|
+
| `--group_id` | No | Filter by API group ID |
|
|
191
|
+
| `--name` / `--id` | No | Filter by API name / ID |
|
|
192
|
+
| `--req_method` / `--req_uri` | No | Filter by method / URI |
|
|
193
|
+
| `--auth_type` | No | Filter by auth type (IAM/APP/NONE) |
|
|
194
|
+
|
|
195
|
+
### Query — Throttling Policies
|
|
196
|
+
|
|
197
|
+
`huawei_list_apig_throttling_policies` — list request throttling policies
|
|
198
|
+
(operation name per the KooCLI APIG help enumeration):
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
hcloud APIG ListRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
202
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
| Parameter | Required | Description |
|
|
206
|
+
| ---------------------- | -------- | -------------------------- |
|
|
207
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
208
|
+
| `--name` / `--id` | No | Filter by policy name / ID |
|
|
209
|
+
| `--limit` / `--offset` | No | Pagination |
|
|
210
|
+
|
|
211
|
+
### Query — Signature Keys
|
|
212
|
+
|
|
213
|
+
`huawei_list_apig_signature_keys` — list signature keys
|
|
214
|
+
(operation name per the KooCLI APIG help enumeration):
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
hcloud APIG ListSignatureKeysV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
218
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListSignatureKeysV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
| Parameter | Required | Description |
|
|
222
|
+
| ---------------------- | -------- | ----------------------- |
|
|
223
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
224
|
+
| `--name` / `--id` | No | Filter by key name / ID |
|
|
225
|
+
| `--limit` / `--offset` | No | Pagination |
|
|
226
|
+
|
|
227
|
+
### Query — Access Control Policies
|
|
228
|
+
|
|
229
|
+
`huawei_list_apig_access_control_policies` — list ACL (access control) policies:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# --acl_type: PERMIT (whitelist) | DENY (blacklist); --entity_type: IP | DOMAIN
|
|
233
|
+
hcloud APIG ListAclStrategiesV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
234
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListAclStrategiesV2 --cli-region={region} --instance_id={instance_id} --limit=20
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
| Parameter | Required | Description |
|
|
238
|
+
| ---------------------- | -------- | ----------------------------------------- |
|
|
239
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
240
|
+
| `--acl_type` | No | `PERMIT` (whitelist) / `DENY` (blacklist) |
|
|
241
|
+
| `--entity_type` | No | `IP` / `DOMAIN` (account name) |
|
|
242
|
+
| `--name` / `--id` | No | Filter by policy name / ID |
|
|
243
|
+
| `--limit` / `--offset` | No | Pagination |
|
|
244
|
+
|
|
245
|
+
### Analyze — Public Access
|
|
246
|
+
|
|
247
|
+
`huawei_analyze_apig_public_access` — analyze whether an instance is publicly
|
|
248
|
+
reachable and what address to use:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
hcloud APIG ListInstancesV2 --cli-region={region} --instance_id={instance_id} --cli-output=json
|
|
252
|
+
hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id} --cli-output=json
|
|
253
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListInstancesV2 --cli-region={region} --instance_id={instance_id} --cli-output=json
|
|
254
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id} --cli-output=json
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
| Parameter | Required | Description |
|
|
258
|
+
| --------------- | -------- | ----------- |
|
|
259
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
260
|
+
|
|
261
|
+
Analysis rules: if `instances[].eip_address` is a valid IP the instance has a
|
|
262
|
+
public inbound entry — use it for public access. If it is null, the instance is
|
|
263
|
+
internal-only (`BASIC` spec or `lvs` provider). `sl_domain` from the API group
|
|
264
|
+
is internal-only (e.g. `*.apic.cn-north-4.huaweicloudapis.com`) and must NOT be
|
|
265
|
+
advertised as a public endpoint.
|
|
266
|
+
|
|
267
|
+
### Analyze — Publish Chain
|
|
268
|
+
|
|
269
|
+
`huawei_analyze_apig_publish_chain` — walk the instance -> group -> API ->
|
|
270
|
+
publish-state chain to locate where a published endpoint is broken:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
hcloud APIG ListInstancesV2 --cli-region={region}
|
|
274
|
+
hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id}
|
|
275
|
+
hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id}
|
|
276
|
+
# Optional: add --group_id={group_id} to restrict the walk to a single API group
|
|
277
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListInstancesV2 --cli-region={region}
|
|
278
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApiGroupsV2 --cli-region={region} --instance_id={instance_id}
|
|
279
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
| Parameter | Required | Description |
|
|
283
|
+
| --------------- | -------- | ------------------------- |
|
|
284
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
285
|
+
| `--group_id` | No | Restrict to one API group |
|
|
286
|
+
|
|
287
|
+
Report which hop is missing (no instance / no group / no API / no `publish_id`),
|
|
288
|
+
and warn when `sl_domain` is used for public access instead of `eip_address`.
|
|
289
|
+
|
|
290
|
+
### Analyze — Policy Effect
|
|
291
|
+
|
|
292
|
+
`huawei_analyze_apig_policy_effect` — diagnose whether a signature key / ACL
|
|
293
|
+
/ throttling policy is actually in effect (bound to a published API):
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# Signature key: list APIs bound to a given signature key
|
|
297
|
+
hcloud APIG ListApisBindedToSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --sign_id={sign_id}
|
|
298
|
+
# ACL policy: list APIs bound to a given ACL policy
|
|
299
|
+
hcloud APIG ListApisBindedToAclPolicyV2 --cli-region={region} --instance_id={instance_id} --acl_id={acl_id}
|
|
300
|
+
# Throttling policy: list APIs bound to a given throttling policy
|
|
301
|
+
hcloud APIG ListApisBindedToRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --throttle_id={throttle_id}
|
|
302
|
+
# Then confirm each bound API is actually published (non-empty publish_id):
|
|
303
|
+
hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id} --id={api_id}
|
|
304
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisBindedToSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --sign_id={sign_id}
|
|
305
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisBindedToAclPolicyV2 --cli-region={region} --instance_id={instance_id} --acl_id={acl_id}
|
|
306
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisBindedToRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --throttle_id={throttle_id}
|
|
307
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListApisV2 --cli-region={region} --instance_id={instance_id} --id={api_id}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
| Parameter | Required | Description |
|
|
311
|
+
| --------------- | ---------------------- | ------------------------------------------------------------------------------------- |
|
|
312
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
313
|
+
| `--sign_id` | Yes (signature effect) | Signature key ID from `ListSignatureKeysV2` |
|
|
314
|
+
| `--acl_id` | Yes (ACL effect) | ACL policy ID from `ListAclStrategiesV2` |
|
|
315
|
+
| `--throttle_id` | No (throttling effect) | Throttling policy ID from `ListRequestThrottlingPolicyV2` |
|
|
316
|
+
| policy type | No | `signature` (default) / `acl` / `throttling` — agent picks the matching binding query |
|
|
317
|
+
|
|
318
|
+
Policy-effectiveness rules: a policy is **effective** only when at least one
|
|
319
|
+
bound API is **published** (has a non-empty `publish_id`). Diagnose the failure
|
|
320
|
+
path: policy exists but no bound API → bind it to an API; bound but API
|
|
321
|
+
unpublished → publish the API; bound and published → policy is in effect.
|
|
322
|
+
Report the precise gap instead of a generic answer.
|
|
323
|
+
|
|
324
|
+
### Manage — Create Instance (async, poll to Running)
|
|
325
|
+
|
|
326
|
+
`huawei_create_apig_instance` — create a pay-per-use dedicated gateway.
|
|
327
|
+
The API is asynchronous: creation takes 5-15 minutes. Poll `ListInstancesV2`
|
|
328
|
+
until `status == "Running"`:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Run as a single line (no line continuations); always check CreateInstanceV2 --help first
|
|
332
|
+
hcloud APIG CreateInstanceV2 --cli-region={region} --instance_name={instance_name} --spec_id={spec_id} --vpc_id={vpc_id} --subnet_id={subnet_id} --security_group_id={security_group_id} --loadbalancer_provider={loadbalancer_provider} --available_zone_ids.1={available_zone_id}
|
|
333
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateInstanceV2 --cli-region={region} --instance_name={instance_name} --spec_id={spec_id} --vpc_id={vpc_id} --subnet_id={subnet_id} --security_group_id={security_group_id} --loadbalancer_provider={loadbalancer_provider} --available_zone_ids.1={available_zone_id}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
| Parameter | Required | Description |
|
|
337
|
+
| -------------------------- | -------- | ---------------------------------------------------------------------- |
|
|
338
|
+
| `--instance_name` | No* | Gateway name (needed to identify the instance) |
|
|
339
|
+
| `--spec_id` | No* | `BASIC` (no public access) / `PROFESSIONAL` (public access with `elb`) |
|
|
340
|
+
| `--vpc_id` / `--subnet_id` | No* | VPC / subnet in the target region |
|
|
341
|
+
| `--security_group_id` | No* | Security group (create one first via the VPC service) |
|
|
342
|
+
| `--loadbalancer_provider` | No* | `elb` for public access, `lvs` for internal only |
|
|
343
|
+
| `--available_zone_ids.1` | No* | AZ code like `ap-southeast-3a` (NOT a UUID) |
|
|
344
|
+
| `--enterprise_project_id` | No | Required for enterprise accounts; use `"0"` for the default project |
|
|
345
|
+
|
|
346
|
+
*The current KooCLI metadata marks CreateInstanceV2 parameters optional, but the
|
|
347
|
+
APIG API rejects the request without `spec_id`, `vpc_id`, `subnet_id`,
|
|
348
|
+
`security_group_id`, `loadbalancer_provider` and `available_zone_ids` — always
|
|
349
|
+
pass them. **Always** check `CreateInstanceV2 --help` first to confirm
|
|
350
|
+
parameter names before building the command.
|
|
351
|
+
|
|
352
|
+
Polling loop after creation:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
while true; do
|
|
356
|
+
status=$(skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListInstancesV2 --cli-region={region} --instance_id={instance_id} --cli-output=json | jq -r '.instances[0].status')
|
|
357
|
+
[ "$status" = "Running" ] && break
|
|
358
|
+
echo "instance status: $status, waiting 60s..."; sleep 60
|
|
359
|
+
done
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Terminal state is `Running` (NOT "SUCCESS"). States such as `CreateSuccess` are
|
|
363
|
+
intermediate and still mean the instance is being provisioned.
|
|
364
|
+
|
|
365
|
+
### Manage — Add Ingress EIP
|
|
366
|
+
|
|
367
|
+
`huawei_add_apig_ingress_eip` — enable public inbound access on an `elb`-provider
|
|
368
|
+
gateway (bandwidth minimum 5 Mbit/s):
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
# --bandwidth_charging_mode: bandwidth|traffic; --bandwidth_size: Mbit/s (min 5)
|
|
372
|
+
hcloud APIG AddIngressEipV2 --cli-region={region} --instance_id={instance_id} --bandwidth_charging_mode=bandwidth --bandwidth_size=5
|
|
373
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG AddIngressEipV2 --cli-region={region} --instance_id={instance_id} --bandwidth_charging_mode=bandwidth --bandwidth_size=5
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
| Parameter | Required | Description |
|
|
377
|
+
| --------------------------- | -------- | ----------------------------------- |
|
|
378
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
379
|
+
| `--bandwidth_charging_mode` | No | `bandwidth` or `traffic` |
|
|
380
|
+
| `--bandwidth_size` | No | Ingress bandwidth in Mbit/s (min 5) |
|
|
381
|
+
|
|
382
|
+
Verification after binding: `ListInstancesV2` `eip_address` may **not** appear
|
|
383
|
+
promptly (verified: still `null` 8 minutes after success) — do NOT rely on it as
|
|
384
|
+
the sole evidence. Confirm success via the `AddIngressEipV2` response/task
|
|
385
|
+
acceptance, a retry returning `APIC.7711` ("Public inbound access is enabled"),
|
|
386
|
+
or the EIP list in the APIG console. Works only with `elb`-provider instances.
|
|
387
|
+
|
|
388
|
+
### Manage — Create API Group
|
|
389
|
+
|
|
390
|
+
`huawei_create_apig_api_group` — create an API group:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
# --remark={remark} is optional
|
|
394
|
+
hcloud APIG CreateApiGroupV2 --cli-region={region} --instance_id={instance_id} --name={name}
|
|
395
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateApiGroupV2 --cli-region={region} --instance_id={instance_id} --name={name}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
| Parameter | Required | Description |
|
|
399
|
+
| --------------- | -------- | -------------------------------------------------- |
|
|
400
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
401
|
+
| `--name` | Yes | Group name (3-255 chars, starts with letter/digit) |
|
|
402
|
+
| `--remark` | No | Description |
|
|
403
|
+
|
|
404
|
+
### Manage — Create API
|
|
405
|
+
|
|
406
|
+
`huawei_create_apig_api` — create an API in a group:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
hcloud APIG CreateApiV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id} --type={type} --name={name} --req_protocol={req_protocol} --req_method={req_method} --req_uri={req_uri} --auth_type={auth_type} --backend_type={backend_type}
|
|
410
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateApiV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id} --type={type} --name={name} --req_protocol={req_protocol} --req_method={req_method} --req_uri={req_uri} --auth_type={auth_type} --backend_type={backend_type}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
| Parameter | Required | Description |
|
|
414
|
+
| --------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
415
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
416
|
+
| `--group_id` | Yes | API group ID |
|
|
417
|
+
| `--type` | Yes | API type, e.g. `1` (public) |
|
|
418
|
+
| `--name` | Yes | API name — `[a-zA-Z0-9_]+` only, NO hyphens |
|
|
419
|
+
| `--req_protocol` | Yes | `HTTPS` / `HTTP` / `BOTH` |
|
|
420
|
+
| `--req_method` | Yes | `GET` / `POST` / `PUT` / `DELETE` / `PATCH` / `HEAD` / `OPTIONS` / `ANY` |
|
|
421
|
+
| `--req_uri` | Yes | Request URI, e.g. `/demo` |
|
|
422
|
+
| `--auth_type` | Yes | `IAM` / `APP` / `NONE` |
|
|
423
|
+
| `--backend_type` | Yes | `HTTP` / `MOCK` / `FUNCTION` / `VPC_CHANNEL`. **Known limitation (KooCLI 7.2.12, verified):** creating an HTTP-backend API via `CreateApiV2` fails with `APIG.2011 invalid req_protocol` for every reasonable parameter combination, while `MOCK`/`FUNCTION` backends succeed. If an HTTP backend is required, use the APIG console, or create the API with a `MOCK`/`FUNCTION` backend and switch it in the console. |
|
|
424
|
+
| `--backend_api.req_uri` / `--backend_api.req_method` / `--backend_api.url_domain` | No | Backend routing when `backend_type=HTTP` |
|
|
425
|
+
| `--cors` | No | Set `true` when CORS preflight is required |
|
|
426
|
+
|
|
427
|
+
### Manage — Update API
|
|
428
|
+
|
|
429
|
+
`huawei_update_apig_api` — modify an existing API (auth mode, path, backend, etc.):
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
hcloud APIG UpdateApiV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id} --api_id={api_id} --type={type} --name={name} --req_protocol={req_protocol} --req_method={req_method} --req_uri={req_uri} --auth_type={auth_type} --backend_type={backend_type}
|
|
433
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG UpdateApiV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id} --api_id={api_id} --type={type} --name={name} --req_protocol={req_protocol} --req_method={req_method} --req_uri={req_uri} --auth_type={auth_type} --backend_type={backend_type}
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
| Parameter | Required | Description |
|
|
437
|
+
| ------------------------------ | -------- | ------------------------------------- |
|
|
438
|
+
| `--api_id` | Yes | API ID (from `ListApisV2`) |
|
|
439
|
+
| `--instance_id` / `--group_id` | Yes | Locate the API inside the gateway |
|
|
440
|
+
| remaining | Yes | Same required fields as `CreateApiV2` |
|
|
441
|
+
|
|
442
|
+
### Manage — Publish / Offline API
|
|
443
|
+
|
|
444
|
+
`huawei_publish_apig_api` — batch publish or take offline APIs
|
|
445
|
+
(operation is `BatchPublishOrOfflineApiV2`; `apis` is a 1-based array):
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
# 1) Get the real env ID first (RELEASE is only the environment NAME, NOT accepted); fill {env_id} / {api_id} from the query results:
|
|
449
|
+
hcloud APIG ListEnvironmentsV2 --cli-region={region} --instance_id={instance_id}
|
|
450
|
+
hcloud APIG BatchPublishOrOfflineApiV2 --cli-region={region} --instance_id={instance_id} --action=online --env_id={env_id} --apis.1={api_id}
|
|
451
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG ListEnvironmentsV2 --cli-region={region} --instance_id={instance_id}
|
|
452
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG BatchPublishOrOfflineApiV2 --cli-region={region} --instance_id={instance_id} --action=online --env_id={env_id} --apis.1={api_id}
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
| Parameter | Required | Description |
|
|
456
|
+
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
457
|
+
| `--action` | Yes | `online` (publish) / `offline` (take offline) |
|
|
458
|
+
| `--env_id` | Yes | Environment **ID** (NOT the name). Query it first with `hcloud APIG ListEnvironmentsV2 --cli-region={region} --instance_id={instance_id}` and use the returned `env_id` — the name `RELEASE` is rejected with APIG.3003. |
|
|
459
|
+
| `--apis.1` | Yes* | 1-based array of API IDs (max 1000). Or use `--group_id` instead. |
|
|
460
|
+
| `--group_id` | No | Publish/offline all APIs of a group (alternative to `apis`) |
|
|
461
|
+
| `--remark` | No | Description |
|
|
462
|
+
|
|
463
|
+
### Manage — Create Throttling Policy
|
|
464
|
+
|
|
465
|
+
`huawei_create_apig_throttling_policy` — create a request throttling policy
|
|
466
|
+
(operation name per the KooCLI APIG help enumeration):
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
hcloud APIG CreateRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --name={name} --time_unit={time_unit} --time_interval={time_interval} --api_call_limits={api_call_limits}
|
|
470
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateRequestThrottlingPolicyV2 --cli-region={region} --instance_id={instance_id} --name={name} --time_unit={time_unit} --time_interval={time_interval} --api_call_limits={api_call_limits}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
| Parameter | Required | Description |
|
|
474
|
+
| ----------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------- |
|
|
475
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
476
|
+
| `--name` | Yes | Policy name — `[a-zA-Z0-9_]+` only, NO hyphens (same constraint as API names, see Critical Warning 7) |
|
|
477
|
+
| `--time_unit` | Yes | `SECOND` / `MINUTE` / `HOUR` / `DAY` |
|
|
478
|
+
| `--time_interval` | Yes | Time interval in the unit |
|
|
479
|
+
| `--api_call_limits` | Yes | Max API calls within the interval |
|
|
480
|
+
| `--app_call_limits` | No | Per-app quota (use for per-user limits) |
|
|
481
|
+
| `--user_call_limits` / `--ip_call_limits` | No | Per-user / per-IP limits |
|
|
482
|
+
| `--enable_adaptive_control` | No | Adaptive throttling (default false) |
|
|
483
|
+
|
|
484
|
+
### Manage — Create Signature Key
|
|
485
|
+
|
|
486
|
+
`huawei_create_apig_signature_key` — create a signature key used to
|
|
487
|
+
authenticate requests to bound APIs (**R2: preview + confirm**):
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
# [W] 写操作 (WRITE): creates a signature key — R2: preview + explicit confirmation required
|
|
491
|
+
# --sign_type: hmac (default) | basic | public_key | aes; --sign_key/--sign_secret auto-generated when omitted
|
|
492
|
+
hcloud APIG CreateSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --name={name}
|
|
493
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --name={name}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
| Parameter | Required | Description |
|
|
497
|
+
| ------------------------------ | -------- | ------------------------------------------------------------------------------- |
|
|
498
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
499
|
+
| `--name` | Yes | Key name — letters/digits/underscore, must start with a letter (or Chinese) |
|
|
500
|
+
| `--sign_type` | No | `hmac` (default) / `basic` / `public_key` / `aes` |
|
|
501
|
+
| `--sign_key` / `--sign_secret` | No | Auto-generated when omitted; value rules vary by type (see Critical Warning 10) |
|
|
502
|
+
| `--sign_algorithm` | No | `aes-128-cfb` / `aes-256-cfb` (aes type only) |
|
|
503
|
+
|
|
504
|
+
### Manage — Create Access Control Policy
|
|
505
|
+
|
|
506
|
+
`huawei_create_apig_access_control_policy` — create an ACL policy (whitelist /
|
|
507
|
+
blacklist by IP or account name) (**R2: preview + confirm**):
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# [W] 写操作 (WRITE): creates an ACL policy — R2: preview + explicit confirmation required
|
|
511
|
+
# --acl_type: PERMIT (whitelist) | DENY (blacklist); --entity_type: IP | DOMAIN | DOMAIN_ID
|
|
512
|
+
hcloud APIG CreateAclStrategyV2 --cli-region={region} --instance_id={instance_id} --acl_name={name} --acl_type=PERMIT --entity_type=IP --acl_value={ip_addresses}
|
|
513
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG CreateAclStrategyV2 --cli-region={region} --instance_id={instance_id} --acl_name={name} --acl_type=PERMIT --entity_type=IP --acl_value={ip_addresses}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
| Parameter | Required | Description |
|
|
517
|
+
| --------------- | -------- | --------------------------------------------------------------------------- |
|
|
518
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
519
|
+
| `--acl_name` | Yes | Policy name — 3-64 chars, starts with letter/digit (Chinese allowed) |
|
|
520
|
+
| `--acl_type` | Yes | `PERMIT` (whitelist) / `DENY` (blacklist) |
|
|
521
|
+
| `--entity_type` | Yes | `IP` / `DOMAIN` (account name) / `DOMAIN_ID` (account ID) |
|
|
522
|
+
| `--acl_value` | Yes | Comma-separated; IP (max 100) or account name(s) depending on `entity_type` |
|
|
523
|
+
|
|
524
|
+
### Delete — Instance
|
|
525
|
+
|
|
526
|
+
`huawei_delete_apig_instance` — delete a dedicated gateway (**R1: explicit user
|
|
527
|
+
confirmation required before running**):
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
# [W] 写操作 (WRITE) — IRREVERSIBLE: deletes a dedicated gateway — R1: explicit confirmation required
|
|
531
|
+
hcloud APIG DeleteInstancesV2 --cli-region={region} --instance_id={instance_id}
|
|
532
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG DeleteInstancesV2 --cli-region={region} --instance_id={instance_id}
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
| Parameter | Required | Description |
|
|
536
|
+
| --------------- | -------- | -------------------- |
|
|
537
|
+
| `--instance_id` | Yes | Gateway ID to delete |
|
|
538
|
+
|
|
539
|
+
### Delete — API
|
|
540
|
+
|
|
541
|
+
`huawei_delete_apig_api` — delete an API from a group (**R1: explicit user
|
|
542
|
+
confirmation required before running**):
|
|
543
|
+
|
|
544
|
+
```bash
|
|
545
|
+
# [W] 写操作 (WRITE) — IRREVERSIBLE: deletes an API — R1: explicit confirmation required
|
|
546
|
+
# Note: DeleteApiV2 takes --api_id + --instance_id only (--group_id is NOT a
|
|
547
|
+
# parameter of this operation; verified against `hcloud APIG DeleteApiV2 --help`)
|
|
548
|
+
hcloud APIG DeleteApiV2 --cli-region={region} --instance_id={instance_id} --api_id={api_id}
|
|
549
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG DeleteApiV2 --cli-region={region} --instance_id={instance_id} --api_id={api_id}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
| Parameter | Required | Description |
|
|
553
|
+
| --------------- | -------- | ------------------------------------ |
|
|
554
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
555
|
+
| `--api_id` | Yes | API ID to delete (from `ListApisV2`) |
|
|
556
|
+
|
|
557
|
+
> An API group cannot be deleted while it still contains APIs (APIG.3415). Use
|
|
558
|
+
> this action to delete each API in the group first, then delete the group.
|
|
559
|
+
|
|
560
|
+
### Delete — API Group
|
|
561
|
+
|
|
562
|
+
`huawei_delete_apig_api_group` — delete an API group (**R1: explicit user
|
|
563
|
+
confirmation required before running**):
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
# [W] 写操作 (WRITE) — IRREVERSIBLE: deletes an API group — R1: explicit confirmation required
|
|
567
|
+
hcloud APIG DeleteApiGroupV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id}
|
|
568
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG DeleteApiGroupV2 --cli-region={region} --instance_id={instance_id} --group_id={group_id}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
| Parameter | Required | Description |
|
|
572
|
+
| --------------- | -------- | ---------------------- |
|
|
573
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
574
|
+
| `--group_id` | Yes | API group ID to delete |
|
|
575
|
+
|
|
576
|
+
> **The group must be empty first:** APIG rejects deleting a group that still
|
|
577
|
+
> contains APIs (`APIG.3415 The API group cannot be deleted because it contains
|
|
578
|
+
APIs`). Delete all APIs in the group with `huawei_delete_apig_api`
|
|
579
|
+
> (`DeleteApiV2`) before deleting the group. Only after every API is gone does
|
|
580
|
+
> `DeleteApiGroupV2` succeed.
|
|
581
|
+
|
|
582
|
+
### Delete — Signature Key
|
|
583
|
+
|
|
584
|
+
`huawei_delete_apig_signature_key` — delete a signature key (**R1: explicit
|
|
585
|
+
user confirmation required before running**). Deleting a key removes its binding
|
|
586
|
+
relations too — every API bound with it loses signature validation:
|
|
587
|
+
|
|
588
|
+
```bash
|
|
589
|
+
# [W] 写操作 (WRITE) — IRREVERSIBLE: deletes a signature key — R1: explicit confirmation required
|
|
590
|
+
hcloud APIG DeleteSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --sign_id={sign_id}
|
|
591
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG DeleteSignatureKeyV2 --cli-region={region} --instance_id={instance_id} --sign_id={sign_id}
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
| Parameter | Required | Description |
|
|
595
|
+
| --------------- | -------- | ------------------------------------------------------- |
|
|
596
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
597
|
+
| `--sign_id` | Yes | Signature key ID to delete (from `ListSignatureKeysV2`) |
|
|
598
|
+
|
|
599
|
+
### Delete — Access Control Policy
|
|
600
|
+
|
|
601
|
+
`huawei_delete_apig_access_control_policy` — delete an ACL policy (**R1:
|
|
602
|
+
explicit user confirmation required before running**). **The policy must have no
|
|
603
|
+
API bindings** (`DeleteAclV2` fails otherwise):
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
# [W] 写操作 (WRITE) — IRREVERSIBLE: deletes an ACL policy — R1: explicit confirmation required
|
|
607
|
+
hcloud APIG DeleteAclV2 --cli-region={region} --instance_id={instance_id} --acl_id={acl_id}
|
|
608
|
+
skill-quality-cli run --skill-name huawei-cloud-apig-instance-management -- hcloud APIG DeleteAclV2 --cli-region={region} --instance_id={instance_id} --acl_id={acl_id}
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
| Parameter | Required | Description |
|
|
612
|
+
| --------------- | -------- | ---------------------------------------------------- |
|
|
613
|
+
| `--instance_id` | Yes | Gateway ID |
|
|
614
|
+
| `--acl_id` | Yes | ACL policy ID to delete (from `ListAclStrategiesV2`) |
|
|
615
|
+
|
|
616
|
+
> If the ACL policy still has bound APIs, `DeleteAclV2` returns an error. Unbind
|
|
617
|
+
> the APIs first (the APIG console/`BatchDeleteAclV2`), then retry the delete.
|
|
618
|
+
|
|
619
|
+
## Parameter Confirmation
|
|
620
|
+
|
|
621
|
+
- Every `huawei_*` command must be checked against `hcloud APIG <Operation> --help`
|
|
622
|
+
before execution; parameter names in this skill were verified against KooCLI 7.2.12 output.
|
|
623
|
+
- Required vs optional: `--cli-region` is always passed (agent fills it). Project ID (`--project_id`) is resolved automatically from the profile or region parent project.
|
|
624
|
+
- Mutating actions (Manage R2 / Delete R1) require previewing the full command and
|
|
625
|
+
obtaining user confirmation before execution; Delete R1 additionally requires an
|
|
626
|
+
explicit confirmation that the resource will be permanently removed.
|
|
627
|
+
|
|
628
|
+
## KooCLI Command Format Standard
|
|
629
|
+
|
|
630
|
+
The generic invocation shape is `hcloud APIG <Operation> --cli-region=<region> [--key=value ...]`
|
|
631
|
+
— this is a **format description only**: `<...>` and `[...]` are placeholders, never executed verbatim.
|
|
632
|
+
|
|
633
|
+
| Feature | Description | Example |
|
|
634
|
+
| ------------------- | -------------------------------------------------------- | --------------------------------------------------- |
|
|
635
|
+
| Service name | `APIG` (CLI help display; metadata dir `apig`) | `hcloud APIG ListInstancesV2 --cli-region={region}` |
|
|
636
|
+
| Operation name | PascalCase, verified against the KooCLI APIG help output | `ListInstancesV2` |
|
|
637
|
+
| Region | `--cli-region=<value>` | `--cli-region=cn-north-4` |
|
|
638
|
+
| Simple param | `--key=value` | `--instance_id=xxx` |
|
|
639
|
+
| Indexed array param | `--key.N=value` (1-based) | `--apis.1=xxx` |
|
|
640
|
+
| Nested object param | `--key.sub=value` | `--backend_api.req_uri=/demo` |
|
|
641
|
+
|
|
642
|
+
## Tool Parameter Validation (Mandatory)
|
|
643
|
+
|
|
644
|
+
Validate every parameter before execution; illegal input is rejected directly (never passed to `hcloud`):
|
|
645
|
+
|
|
646
|
+
| Validation | Rule |
|
|
647
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
648
|
+
| Whitelist enum | Documented value sets (`--cli-region`, `--status`, `--spec`, `--loadbalancer_provider`, `--protocol`, ...) must match exactly; anything else → refuse, listing allowed values |
|
|
649
|
+
| Type check | Numeric params (`--limit`, `--offset`, `--bandwidth`, `--port`) must parse as integers; name/ID params must be strings matching `[a-zA-Z0-9_-]+` (no hyphens, see Critical Warnings #7) |
|
|
650
|
+
| Reject unknown | Params absent from `hcloud APIG <Operation> --help` are rejected before running the command |
|
|
651
|
+
|
|
652
|
+
## Reference Documents
|
|
653
|
+
|
|
654
|
+
- `references/cli-installation-guide.md` — KooCLI install & authentication
|
|
655
|
+
- `references/iam-policies.md` — least-privilege IAM policies for APIG
|
|
656
|
+
- `references/verification-method.md` — how to verify each action
|
|
657
|
+
- `references/dataflow-diagram.md` — Mermaid data flow diagrams
|
|
658
|
+
- `references/acceptance-criteria.md` — acceptance criteria for the skill
|
|
659
|
+
|
|
660
|
+
APIG documentation: https://support.huaweicloud.com/apig/
|