huaweicloud-devkit 1.0.3-dev.0 → 1.0.3-next.0
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/.agents/plugins/marketplace.json +18 -18
- package/README.md +99 -41
- package/README.zh-CN.md +99 -41
- package/bin/setup.cjs +5 -3
- package/integrations/opencode/opencode.json +1 -4
- package/package.json +61 -42
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +51 -44
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +128 -42
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +25 -2
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +65 -47
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +123 -2
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
- package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
- package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +73 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +14 -10
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +34 -27
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +521 -8
- package/plugins/huaweicloud-core/src/search-market.mjs +53 -14
- package/plugins/huaweicloud-core/src/setup-cli.mjs +1741 -215
- package/plugins/huaweicloud-core/src/tools.mjs +667 -123
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +12 -15
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +267 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-functiongraph
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating, deploying, or managing serverless functions on FunctionGraph. Covers triggers (APIG/OBS/timer/SMN), cold start, reserved concurrency. Triggers: FunctionGraph, serverless, function, Lambda, trigger. NOT for: CCE containers (use huawei-cce).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -20,16 +20,16 @@ Domain expertise for Huawei Cloud FunctionGraph. Covers function lifecycle, code
|
|
|
20
20
|
|
|
21
21
|
## Critical Warnings
|
|
22
22
|
|
|
23
|
-
| Trap
|
|
24
|
-
|
|
25
|
-
| Service name is `FunctionGraph`
|
|
26
|
-
| CLI requires `project_id`
|
|
27
|
-
| Cold start 100ms-2s
|
|
28
|
-
| Max execution 900s
|
|
29
|
-
| Env vars plaintext
|
|
30
|
-
| **ZIP upload is unreliable**
|
|
31
|
-
| **DeleteFunction strip `:latest`**
|
|
32
|
-
| **DeleteFunctionTrigger does NOT cascade** | Deleting a DEDICATEDGATEWAY trigger leaves the API in APIG. Manually clean up: `hcloud APIG DeleteApiV2 --instance_id=<id> --api_id=<api-id>`.
|
|
23
|
+
| Trap | Why |
|
|
24
|
+
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| Service name is `FunctionGraph` | NOT `FGS`. KooCLI 7.x uses the full service name |
|
|
26
|
+
| CLI requires `project_id` | Get it: `hcloud IAM KeystoneListProjects` or extract from URN `urn:fss:<region>:<project_id>:...` |
|
|
27
|
+
| Cold start 100ms-2s | Reserve concurrency for latency-sensitive workloads |
|
|
28
|
+
| Max execution 900s | Use ECS/CCE for long-running tasks |
|
|
29
|
+
| Env vars plaintext | Use DEW for secrets |
|
|
30
|
+
| **ZIP upload is unreliable** | `CreateFunction --code_type=zip --code_filename=xxx.zip` succeeds even with a nonexistent file — the function is created with empty code. Prefer `code_type=inline` for simple functions. If using zip, verify `code_size` > placeholder after creation and run `InvokeFunction` to confirm output. |
|
|
31
|
+
| **DeleteFunction strip `:latest`** | Passing `urn:fss:...:function:xxx:latest` causes FSS.0400. Strip `:latest` suffix (DeleteFunction only — UpdateApiV2 needs the full URN). |
|
|
32
|
+
| **DeleteFunctionTrigger does NOT cascade** | Deleting a DEDICATEDGATEWAY trigger leaves the API in APIG. Manually clean up: `hcloud APIG DeleteApiV2 --instance_id=<id> --api_id=<api-id>`. |
|
|
33
33
|
|
|
34
34
|
## Prerequisites
|
|
35
35
|
|
|
@@ -42,13 +42,13 @@ hcloud FunctionGraph --help # confirm service is available
|
|
|
42
42
|
|
|
43
43
|
If you see `FSS.0403 Forbidden`, the user needs these permissions:
|
|
44
44
|
|
|
45
|
-
| Operation
|
|
46
|
-
|
|
45
|
+
| Operation | Required Permission |
|
|
46
|
+
| --------------- | --------------------------------------- |
|
|
47
47
|
| Create function | `functiongraph:function:createFunction` |
|
|
48
|
-
| List functions
|
|
48
|
+
| List functions | `functiongraph:function:list` |
|
|
49
49
|
| Delete function | `functiongraph:function:deleteFunction` |
|
|
50
|
-
| Invoke function | `functiongraph:function:invoke`
|
|
51
|
-
| Create trigger
|
|
50
|
+
| Invoke function | `functiongraph:function:invoke` |
|
|
51
|
+
| Create trigger | `functiongraph:trigger:*` |
|
|
52
52
|
|
|
53
53
|
Grant via IAM console (`FunctionGraph FullAccess` role) or ask project admin.
|
|
54
54
|
|
|
@@ -56,18 +56,19 @@ Grant via IAM console (`FunctionGraph FullAccess` role) or ask project admin.
|
|
|
56
56
|
|
|
57
57
|
Always discover parameters with `--help` before executing. These are the correct operation names:
|
|
58
58
|
|
|
59
|
-
| Task
|
|
60
|
-
|
|
61
|
-
| List functions
|
|
62
|
-
| Show function
|
|
63
|
-
| Create function | `CreateFunction`
|
|
64
|
-
| Delete function | `DeleteFunction`
|
|
65
|
-
| Invoke function | `InvokeFunction`
|
|
66
|
-
| Create trigger
|
|
67
|
-
| List triggers
|
|
68
|
-
| Delete trigger
|
|
59
|
+
| Task | Operation | Gotchas |
|
|
60
|
+
| --------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
61
|
+
| List functions | `ListFunctions` | |
|
|
62
|
+
| Show function | `ShowFunctionConfig` | |
|
|
63
|
+
| Create function | `CreateFunction` | references/create-function.md |
|
|
64
|
+
| Delete function | `DeleteFunction` | Strip `:latest` from URN |
|
|
65
|
+
| Invoke function | `InvokeFunction` | Requires body param (`--name=<value>` becomes event body). Use `--x_cff_request_version=v0` for raw output, `v1` for APIG-wrapped. |
|
|
66
|
+
| Create trigger | `CreateFunctionTrigger` | references/triggers.md |
|
|
67
|
+
| List triggers | `ListFunctionTriggers` | |
|
|
68
|
+
| Delete trigger | `DeleteFunctionTrigger` | |
|
|
69
69
|
|
|
70
70
|
Discover exact parameters:
|
|
71
|
+
|
|
71
72
|
```bash
|
|
72
73
|
hcloud FunctionGraph CreateFunction --help
|
|
73
74
|
hcloud FunctionGraph CreateFunctionTrigger --help
|
|
@@ -83,19 +84,19 @@ See `references/deploy-workflow.md` for a step-by-step example with code templat
|
|
|
83
84
|
|
|
84
85
|
## Troubleshooting
|
|
85
86
|
|
|
86
|
-
| Error
|
|
87
|
-
|
|
88
|
-
| `不支持的服务名称:FGS`
|
|
89
|
-
| `不支持的operation:CreateTrigger` | Use `CreateFunctionTrigger`
|
|
90
|
-
| `FSS.0403` / Forbidden
|
|
91
|
-
| `缺少必填参数:{*}` on Invoke
|
|
92
|
-
| APIG/EOM trigger error
|
|
93
|
-
| `event_data` parse error
|
|
94
|
-
| FSS.1078 / code upload fails
|
|
95
|
-
| DeleteFunction with `:latest`
|
|
96
|
-
| Code too large
|
|
97
|
-
| Cold start slow
|
|
98
|
-
| Auth failure
|
|
87
|
+
| Error | Root Cause -> Fix |
|
|
88
|
+
| --------------------------------- | ------------------------------------------------------------------------ |
|
|
89
|
+
| `不支持的服务名称:FGS` | Use `FunctionGraph`, not `FGS` |
|
|
90
|
+
| `不支持的operation:CreateTrigger` | Use `CreateFunctionTrigger` |
|
|
91
|
+
| `FSS.0403` / Forbidden | Missing IAM permissions — see IAM Permissions above |
|
|
92
|
+
| `缺少必填参数:{*}` on Invoke | Add body param: `--name=<value>` |
|
|
93
|
+
| APIG/EOM trigger error | `trigger_type_code=APIG` deprecated — use `DEDICATEDGATEWAY` |
|
|
94
|
+
| `event_data` parse error | Use dotted format: `--event_data.key=value`, NOT JSON string |
|
|
95
|
+
| FSS.1078 / code upload fails | `--code_filename` is filename-only, no path. `cd` to zip directory first |
|
|
96
|
+
| DeleteFunction with `:latest` | Strip `:latest` version suffix from URN |
|
|
97
|
+
| Code too large | Inline limit 10KB — use `zip`/`obs` code type |
|
|
98
|
+
| Cold start slow | Set reserved instances for critical functions |
|
|
99
|
+
| Auth failure | Run `npx huaweicloud-devkit auth init` |
|
|
99
100
|
|
|
100
101
|
## Security Considerations
|
|
101
102
|
|
package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md
CHANGED
|
@@ -22,6 +22,7 @@ When APIG calls FunctionGraph via DEDICATEDGATEWAY trigger, the event structure
|
|
|
22
22
|
`event["body"]` is Base64 encoded. You MUST decode it:
|
|
23
23
|
|
|
24
24
|
**Python handler template:**
|
|
25
|
+
|
|
25
26
|
```python
|
|
26
27
|
import json, base64
|
|
27
28
|
|
|
@@ -38,18 +39,19 @@ def handler(event, context):
|
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
**Node.js handler template:**
|
|
42
|
+
|
|
41
43
|
```js
|
|
42
44
|
exports.handler = async (event, context) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
let body = event.body || '';
|
|
46
|
+
if (event.isBase64Encoded) {
|
|
47
|
+
body = Buffer.from(body, 'base64').toString('utf8');
|
|
48
|
+
}
|
|
49
|
+
const data = body ? JSON.parse(body) : {};
|
|
50
|
+
return {
|
|
51
|
+
statusCode: 200,
|
|
52
|
+
body: JSON.stringify({ message: 'ok', received: data }),
|
|
53
|
+
headers: { 'Content-Type': 'application/json' },
|
|
54
|
+
};
|
|
53
55
|
};
|
|
54
56
|
```
|
|
55
57
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Runtime Options
|
|
4
4
|
|
|
5
|
-
| Runtime
|
|
6
|
-
|
|
7
|
-
| Python3.9
|
|
8
|
-
| Python3.10
|
|
9
|
-
| Node.js 18
|
|
10
|
-
| Java 8/11/17
|
|
11
|
-
| Go 1.x
|
|
12
|
-
| C# (.NET Core) | `CsharpDemo::CsharpDemo.Function::Handler` | Namespace.Class::Method
|
|
5
|
+
| Runtime | Handler Format | Example |
|
|
6
|
+
| -------------- | ------------------------------------------ | ----------------------------------------------------------------- |
|
|
7
|
+
| Python3.9 | `index.handler` | `def handler(event, context): return {"statusCode": 200}` |
|
|
8
|
+
| Python3.10 | `index.handler` | Same as 3.9 |
|
|
9
|
+
| Node.js 18 | `index.handler` | `exports.handler = async (event, context) => ({statusCode: 200})` |
|
|
10
|
+
| Java 8/11/17 | `com.example.Handler::handleRequest` | Java class method |
|
|
11
|
+
| Go 1.x | `handler` | Go function name |
|
|
12
|
+
| C# (.NET Core) | `CsharpDemo::CsharpDemo.Function::Handler` | Namespace.Class::Method |
|
|
13
13
|
|
|
14
14
|
## Create Function (inline)
|
|
15
15
|
|
|
@@ -26,13 +26,13 @@ hcloud FunctionGraph CreateFunction \
|
|
|
26
26
|
--cli-region=<region>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
| Param
|
|
30
|
-
|
|
31
|
-
| `--func_name`
|
|
32
|
-
| `--runtime`
|
|
33
|
-
| `--handler`
|
|
34
|
-
| `--memory_size` | No
|
|
35
|
-
| `--timeout`
|
|
29
|
+
| Param | Required | Range/Default |
|
|
30
|
+
| --------------- | -------- | ------------------------- |
|
|
31
|
+
| `--func_name` | Yes | 1-60 chars |
|
|
32
|
+
| `--runtime` | Yes | See runtime options above |
|
|
33
|
+
| `--handler` | Yes | Per runtime |
|
|
34
|
+
| `--memory_size` | No | 128-4096 MB, default 128 |
|
|
35
|
+
| `--timeout` | No | 1-900s, default 3 |
|
|
36
36
|
|
|
37
37
|
## ZIP Upload Warning
|
|
38
38
|
|
|
@@ -49,11 +49,11 @@ Grant `FunctionGraph FullAccess` role or custom policy.
|
|
|
49
49
|
|
|
50
50
|
## Error Codes
|
|
51
51
|
|
|
52
|
-
| Error
|
|
53
|
-
|
|
54
|
-
| FSS.0400 | `:latest` suffix on URN. Strip it
|
|
55
|
-
| FSS.1417 | Missing DEDICATEDGATEWAY params
|
|
56
|
-
| FSS.0403 | Insufficient IAM permission
|
|
52
|
+
| Error | Root Cause -> Fix |
|
|
53
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| FSS.0400 | `:latest` suffix on URN. Strip it |
|
|
55
|
+
| FSS.1417 | Missing DEDICATEDGATEWAY params |
|
|
56
|
+
| FSS.0403 | Insufficient IAM permission |
|
|
57
57
|
| FSS.1020 | Missing `--app_xrole` when binding VPC. Create IAM agency with `trust_domain_name=functiongraph`. See `huawei-iam` skill → Agencies section |
|
|
58
58
|
|
|
59
59
|
## VPC + Agency Configuration
|
|
@@ -68,4 +68,5 @@ hcloud IAM GrantRoleToAgency --agency_name=<name> --role_id=<role-id>
|
|
|
68
68
|
# 3. Use in CreateFunction
|
|
69
69
|
hcloud FunctionGraph CreateFunction --func_vpc.vpc_id=<vpc> --func_vpc.subnet_id=<subnet> --app_xrole=<name> ...
|
|
70
70
|
```
|
|
71
|
+
|
|
71
72
|
| QuotaExceeded | Max 10 functions per project per region |
|
|
@@ -16,12 +16,12 @@ KooCLI uses **dotted key-value format**, NOT JSON strings:
|
|
|
16
16
|
|
|
17
17
|
## Trigger Types
|
|
18
18
|
|
|
19
|
-
| Type
|
|
20
|
-
|
|
21
|
-
| APIG Dedicated | `DEDICATEDGATEWAY`
|
|
22
|
-
| Timer / Cron
|
|
23
|
-
| OBS
|
|
24
|
-
| SMN
|
|
19
|
+
| Type | `--trigger_type_code` | Notes |
|
|
20
|
+
| -------------- | --------------------- | ---------------------------------------------------------- |
|
|
21
|
+
| APIG Dedicated | `DEDICATEDGATEWAY` | Use this, not `APIG` (deprecated). Requires APIG instance. |
|
|
22
|
+
| Timer / Cron | `TIMER` | Simplest trigger for testing. No APIG dependency. |
|
|
23
|
+
| OBS | `OBS` | Event when objects created/deleted in bucket |
|
|
24
|
+
| SMN | `SMN` | Message notification trigger |
|
|
25
25
|
|
|
26
26
|
## TIMER Trigger (Simple Testing)
|
|
27
27
|
|
|
@@ -46,22 +46,22 @@ hcloud FunctionGraph CreateFunctionTrigger \
|
|
|
46
46
|
|
|
47
47
|
These are labeled optional by `--help` but are **required** for DEDICATEDGATEWAY:
|
|
48
48
|
|
|
49
|
-
| Param
|
|
50
|
-
|
|
51
|
-
| `--event_data.protocol`
|
|
52
|
-
| `--event_data.sl_domain`
|
|
53
|
-
| `--event_data.env_name`
|
|
54
|
-
| `--event_data.env_id`
|
|
55
|
-
| `--event_data.instance_id` | APIG dedicated instance ID
|
|
56
|
-
| `--event_data.group_id`
|
|
57
|
-
| `--event_data.name`
|
|
49
|
+
| Param | Note |
|
|
50
|
+
| -------------------------- | ---------------------------------------------------------------------------- |
|
|
51
|
+
| `--event_data.protocol` | `HTTPS` or `HTTP` or `BOTH` |
|
|
52
|
+
| `--event_data.sl_domain` | Subdomain from APIG instance (e.g. `xxxx.apic.<region>.huaweicloudapis.com`) |
|
|
53
|
+
| `--event_data.env_name` | API environment name (`RELEASE`) |
|
|
54
|
+
| `--event_data.env_id` | API environment ID |
|
|
55
|
+
| `--event_data.instance_id` | APIG dedicated instance ID |
|
|
56
|
+
| `--event_data.group_id` | API group ID |
|
|
57
|
+
| `--event_data.name` | API name — **hyphens (`-`) are DISALLOWED**. Use underscores (`_`) instead. |
|
|
58
58
|
|
|
59
59
|
### Error Mapping
|
|
60
60
|
|
|
61
|
-
| Error
|
|
62
|
-
|
|
63
|
-
| FSS.1417
|
|
64
|
-
| API name regex fail | Rename API — remove hyphens (`-`), use `[a-zA-Z0-9_]+` only.
|
|
61
|
+
| Error | Root Cause → Fix |
|
|
62
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| FSS.1417 | Missing `instance_id`, `group_id`, `protocol`, `env_name`, or `env_id`. These are labeled optional but REQUIRED. |
|
|
64
|
+
| API name regex fail | Rename API — remove hyphens (`-`), use `[a-zA-Z0-9_]+` only. |
|
|
65
65
|
|
|
66
66
|
### Example
|
|
67
67
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-gaussdb
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating or managing GaussDB distributed database on Huawei Cloud. Covers GaussDB(for MySQL), GaussDB(for openGauss), sharding, HTAP. Triggers: GaussDB, distributed database, sharding, openGauss, HTAP. NOT for: single RDS (use huawei-rds).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,34 +16,34 @@ Domain expertise for GaussDB. Covers instance lifecycle, databases, backups, con
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| Shard key permanent
|
|
22
|
-
| Minimum nodes
|
|
23
|
-
| Engine version pinned | MySQL-compatible vs openGauss are separate products
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| --------------------- | ------------------------------------------------------------ |
|
|
21
|
+
| Shard key permanent | Once set, shard key cannot be changed |
|
|
22
|
+
| Minimum nodes | Distributed GaussDB requires at least 3 nodes for production |
|
|
23
|
+
| Engine version pinned | MySQL-compatible vs openGauss are separate products |
|
|
24
24
|
|
|
25
25
|
## Common Workflows
|
|
26
26
|
|
|
27
|
-
| Task
|
|
28
|
-
|
|
29
|
-
| List instances
|
|
30
|
-
| Show instance
|
|
31
|
-
| List flavors
|
|
32
|
-
| Create instance
|
|
33
|
-
| Delete instance
|
|
34
|
-
| Create backup
|
|
35
|
-
| Add readonly node | `AddReadonlyNode --cli-region=<r> --project_id=<p>`
|
|
36
|
-
| Add shard
|
|
37
|
-
| Manage database
|
|
27
|
+
| Task | Operation |
|
|
28
|
+
| ----------------- | ---------------------------------------------------------- |
|
|
29
|
+
| List instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
30
|
+
| Show instance | `ShowInstance --cli-region=<r> --project_id=<p>` |
|
|
31
|
+
| List flavors | `ListFlavors --cli-region=<r> --project_id=<p>` |
|
|
32
|
+
| Create instance | `CreateInstance --cli-region=<r> --project_id=<p>` |
|
|
33
|
+
| Delete instance | `DeleteInstance --cli-region=<r> --project_id=<p>` |
|
|
34
|
+
| Create backup | `CreateGaussMySqlBackup --cli-region=<r> --project_id=<p>` |
|
|
35
|
+
| Add readonly node | `AddReadonlyNode --cli-region=<r> --project_id=<p>` |
|
|
36
|
+
| Add shard | `AddShardingNode --cli-region=<r> --project_id=<p>` |
|
|
37
|
+
| Manage database | `AddDatabasePermission --cli-region=<r> --project_id=<p>` |
|
|
38
38
|
|
|
39
39
|
Discover exact parameters with `--help` before executing any command.
|
|
40
40
|
|
|
41
41
|
## Troubleshooting
|
|
42
42
|
|
|
43
|
-
| Error
|
|
44
|
-
|
|
43
|
+
| Error | Fix |
|
|
44
|
+
| ----------------------- | ------------------------------------------------- |
|
|
45
45
|
| Instance creation fails | Check VPC/subnet availability and flavor capacity |
|
|
46
|
-
| Connection refused
|
|
46
|
+
| Connection refused | SG missing database port |
|
|
47
47
|
|
|
48
48
|
## Security
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-getting-started
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when starting fresh with Huawei Cloud or KooCLI, installing prerequisites, setting up authentication, or exploring what is possible. Triggers: getting started, first time, setup, install, explore, quickstart, beginner, tutorial. NOT for: specific service operations (use huawei-ecs, huawei-obs, etc.).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,13 +10,14 @@ version: 1
|
|
|
10
10
|
|
|
11
11
|
## KooCLI Installation
|
|
12
12
|
|
|
13
|
-
| OS
|
|
14
|
-
|
|
15
|
-
| Windows (PowerShell) | See https://support.huaweicloud.com/qs-hcli/hcli_02_003.html for MSI download
|
|
16
|
-
| Linux
|
|
17
|
-
| macOS
|
|
13
|
+
| OS | Command |
|
|
14
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| Windows (PowerShell) | See https://support.huaweicloud.com/qs-hcli/hcli_02_003.html for MSI download |
|
|
16
|
+
| Linux | curl -LO "https://hwcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh" && bash hcloud_install.sh |
|
|
17
|
+
| macOS | curl -LO "https://hwcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh" && bash hcloud_install.sh |
|
|
18
18
|
|
|
19
19
|
## First-Time Setup
|
|
20
|
+
|
|
20
21
|
1. **Install KooCLI** using command above
|
|
21
22
|
2. **Accept privacy policy** (first run only): KooCLI requires one-time privacy agreement. Run `hcloud version` to read the agreement, then respond `y` to accept. Do not pipe `echo "y" |` — you must review the terms first.
|
|
22
23
|
3. **Configure credentials (unified)**: `npx huaweicloud-devkit auth init` — prefer this over `hcloud configure init`, which only covers KooCLI.
|
|
@@ -38,28 +39,31 @@ hcloud configure list
|
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
## Critical Warnings
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
42
|
+
|
|
43
|
+
| Trap | Why |
|
|
44
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
45
|
+
| AK/SK must be kept secret | Never commit to git or share |
|
|
46
|
+
| Default region applies to all commands | Override with --cli-region= per command |
|
|
47
|
+
| Some services region-specific | Not all services available in all regions |
|
|
48
|
+
| Privacy policy blocks first run | Run `hcloud version` to read and accept the agreement. Review the terms before responding `y` |
|
|
47
49
|
|
|
48
50
|
## What Can I Do? (Quick Index)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
|
52
|
-
|
|
|
51
|
+
|
|
52
|
+
| Goal | Skill |
|
|
53
|
+
| ----------------- | --------------------------- |
|
|
54
|
+
| Create a VM | huawei-ecs |
|
|
55
|
+
| Store files | huawei-obs |
|
|
53
56
|
| Set up a database | huawei-rds / huawei-gaussdb |
|
|
54
|
-
| Create a network
|
|
55
|
-
| Manage access
|
|
56
|
-
| Deploy an app
|
|
57
|
-
| Run containers
|
|
58
|
-
| Build an API
|
|
59
|
-
| Run serverless
|
|
60
|
-
| Monitor resources | huawei-cloud-eye
|
|
57
|
+
| Create a network | huawei-vpc |
|
|
58
|
+
| Manage access | huawei-iam |
|
|
59
|
+
| Deploy an app | huawei-deployment |
|
|
60
|
+
| Run containers | huawei-cce |
|
|
61
|
+
| Build an API | huawei-apig |
|
|
62
|
+
| Run serverless | huawei-functiongraph |
|
|
63
|
+
| Monitor resources | huawei-cloud-eye |
|
|
61
64
|
|
|
62
65
|
## Pro Tips
|
|
66
|
+
|
|
63
67
|
- Use `hcloud <Service> --help` to discover operations (see huaweicloud-capability-discovery)
|
|
64
68
|
- Prepend `hcloud configure set --cli-region=<r>` to avoid per-command region flags
|
|
65
69
|
- Pipe sensitive output through IAM with `--cli-output-format=json`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-iam
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when managing IAM users, groups, roles, policies, agencies, projects, or access keys on Huawei Cloud. Covers IAM policy structure, least-privilege design, temporary credentials (STS), OneAccess integration, and security best practices. Triggers on: IAM, permission, policy, role, user, group, AK/SK, access key, agency, project, authorization. NOT for: DEW secret management (use huawei-dew).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,13 +16,13 @@ Domain expertise for Huawei Cloud Identity and Access Management (IAM). Covers u
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| NEVER create IAM users for humans | Use OneAccess (IAM Identity Center) or federated SSO
|
|
22
|
-
| NEVER create long-term AK/SK
|
|
23
|
-
| Wildcard policies dangerous
|
|
24
|
-
| Agency trust is powerful
|
|
25
|
-
| Root account must have MFA
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| --------------------------------- | --------------------------------------------------------------- |
|
|
21
|
+
| NEVER create IAM users for humans | Use OneAccess (IAM Identity Center) or federated SSO |
|
|
22
|
+
| NEVER create long-term AK/SK | Use temporary STS tokens via agencies |
|
|
23
|
+
| Wildcard policies dangerous | Effect:Allow + Resource:* = full access. Always scope resources |
|
|
24
|
+
| Agency trust is powerful | Agencies let services assume roles. Always add conditions |
|
|
25
|
+
| Root account must have MFA | Root AK/SK is all-powerful. Enable MFA immediately |
|
|
26
26
|
|
|
27
27
|
## Policy Structure
|
|
28
28
|
|
|
@@ -42,33 +42,33 @@ Domain expertise for Huawei Cloud Identity and Access Management (IAM). Covers u
|
|
|
42
42
|
|
|
43
43
|
## Common Workflows
|
|
44
44
|
|
|
45
|
-
| Task
|
|
46
|
-
|
|
47
|
-
| List users
|
|
48
|
-
| Create group
|
|
49
|
-
| Create custom policy
|
|
50
|
-
| Create agency
|
|
51
|
-
| Get temporary credential | hcloud STS GetTemporaryCredential --agency_name=<n> --domain_id=<id> --duration_seconds=3600
|
|
52
|
-
| Attach policy
|
|
45
|
+
| Task | Command | Steps |
|
|
46
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
47
|
+
| List users | hcloud IAM ListUsers | references/iam-ops.md |
|
|
48
|
+
| Create group | hcloud IAM CreateGroup --group.name=<name> | references/iam-ops.md |
|
|
49
|
+
| Create custom policy | hcloud IAM CreateCustomPolicy --policy.name=<n> --policy.document=<json> | references/policy-examples.md |
|
|
50
|
+
| Create agency | hcloud IAM CreateAgency --agency.name=<n> --agency.domain_id=<id> --agency.trust_policy=<json> | references/agency.md |
|
|
51
|
+
| Get temporary credential | hcloud STS GetTemporaryCredential --agency_name=<n> --domain_id=<id> --duration_seconds=3600 | references/sts.md |
|
|
52
|
+
| Attach policy | hcloud IAM AttachGroupPolicy --group_id=<id> --policy_id=<id> | references/iam-ops.md |
|
|
53
53
|
|
|
54
54
|
## Policy Examples (Least Privilege)
|
|
55
55
|
|
|
56
|
-
| Role
|
|
57
|
-
|
|
58
|
-
| ECS Reader
|
|
59
|
-
| OBS Bucket Operator | obs:Get*, obs:Put*, obs:Delete*, obs:List*
|
|
60
|
-
| RDS Backup Operator | rds:CreateBackup, rds:RestoreFromBackup, rds:ListBackup | rds:*
|
|
56
|
+
| Role | Actions | Resource |
|
|
57
|
+
| ------------------- | ------------------------------------------------------- | ------------------------ |
|
|
58
|
+
| ECS Reader | ecs:List*, ecs:Get*, ecs:Describe* | * |
|
|
59
|
+
| OBS Bucket Operator | obs:Get*, obs:Put*, obs:Delete*, obs:List* | obs:_:_:bucket:my-bucket |
|
|
60
|
+
| RDS Backup Operator | rds:CreateBackup, rds:RestoreFromBackup, rds:ListBackup | rds:* |
|
|
61
61
|
|
|
62
62
|
> See `references/policy-examples.md` for complete policy JSON templates with conditions.
|
|
63
63
|
|
|
64
64
|
## Troubleshooting
|
|
65
65
|
|
|
66
|
-
| Error
|
|
67
|
-
|
|
68
|
-
| AccessDenied
|
|
69
|
-
| AuthFailure
|
|
70
|
-
| Agency trust failed | Missing trust policy condition -> Add g:SourceAccount condition
|
|
71
|
-
| Quota exceeded
|
|
66
|
+
| Error | Root Cause -> Fix |
|
|
67
|
+
| ------------------- | ---------------------------------------------------------------------- |
|
|
68
|
+
| AccessDenied | Missing IAM permission -> Check policy action and resource scope |
|
|
69
|
+
| AuthFailure | Expired AK/SK or wrong project -> Renew credentials / Check project ID |
|
|
70
|
+
| Agency trust failed | Missing trust policy condition -> Add g:SourceAccount condition |
|
|
71
|
+
| Quota exceeded | IAM user/group/policy limit -> Request quota increase |
|
|
72
72
|
|
|
73
73
|
## Security Considerations
|
|
74
74
|
|