huaweicloud-devkit 1.0.2-dev.8 → 1.0.2-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.
Files changed (97) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +163 -138
  4. package/README.zh-CN.md +161 -138
  5. package/bin/setup.cjs +8 -8
  6. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  7. package/integrations/opencode/opencode.json +14 -14
  8. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
  9. package/package.json +46 -44
  10. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -44
  11. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -43
  12. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -44
  13. package/plugins/huaweicloud-core/.mcp.json +15 -15
  14. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +44 -44
  15. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  16. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
  17. package/plugins/huaweicloud-core/safety/policy.json +99 -100
  18. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +199 -199
  19. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
  20. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  21. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  22. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  23. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
  24. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -190
  25. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -124
  26. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  27. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  28. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -56
  29. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  30. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  31. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +185 -185
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +133 -133
  34. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  35. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +55 -55
  36. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +131 -131
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  39. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  40. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  41. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  42. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  44. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  45. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -122
  46. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
  47. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  48. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +133 -127
  49. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
  50. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  51. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -100
  52. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
  53. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  54. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +224 -224
  55. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +135 -131
  56. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  57. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
  58. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  59. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  60. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
  61. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  62. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
  63. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  64. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +51 -47
  65. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  66. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +128 -127
  67. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  68. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +110 -95
  69. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  70. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  71. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  72. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +60 -60
  73. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  74. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  75. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  76. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +105 -87
  77. package/plugins/huaweicloud-core/src/auth/credentials.mjs +95 -95
  78. package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
  79. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  80. package/plugins/huaweicloud-core/src/mcp-server.mjs +129 -129
  81. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +155 -0
  82. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +87 -0
  83. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +137 -137
  84. package/plugins/huaweicloud-core/src/safety-policy.mjs +302 -302
  85. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +91 -97
  86. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +162 -153
  87. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +112 -105
  88. package/plugins/huaweicloud-core/src/search-market.mjs +174 -169
  89. package/plugins/huaweicloud-core/src/setup-cli.mjs +2017 -1576
  90. package/plugins/huaweicloud-core/src/tools.mjs +1008 -1005
  91. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +427 -427
  92. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +132 -132
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +227 -227
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +202 -202
  95. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +158 -158
  96. package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
  97. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
@@ -1,76 +1,76 @@
1
- # VPC Network Management Reference
2
-
3
- ## DNS Addresses by Region
4
-
5
- Subnets without DNS configuration will fail cloud-init. Use these DNS addresses:
6
-
7
- | Region | Primary DNS | Secondary DNS |
8
- |--------|------------|---------------|
9
- | cn-north-1 | 100.125.1.250 | 100.125.129.250 |
10
- | cn-north-4 | 100.125.1.250 | 100.125.129.250 |
11
- | cn-east-3 | 100.125.1.250 | 100.125.129.250 |
12
- | cn-south-1 | 100.125.1.250 | 100.125.129.250 |
13
- | ap-southeast-3 | 100.125.1.250 | 100.125.129.250 |
14
-
15
- **Subnet create with DNS**:
16
- ```bash
17
- hcloud VPC CreateSubnet \
18
- --subnet.name=<name> \
19
- --subnet.vpc_id=<id> \
20
- --subnet.cidr=10.50.1.0/24 \
21
- --subnet.gateway_ip=10.50.1.1 \
22
- --subnet.availability_zone=<az> \
23
- --subnet.dnsList.1=100.125.1.250 \
24
- --subnet.dnsList.2=100.125.129.250
25
- ```
26
-
27
- ## Nested Prefix Summary
28
-
29
- KooCLI 7.x VPC API requires nested prefixes:
30
-
31
- | Resource | Create Param Prefix | Example |
32
- |----------|---------------------|---------|
33
- | VPC | `--vpc.` | `--vpc.name=my-vpc --vpc.cidr=192.168.0.0/16` |
34
- | Subnet | `--subnet.` | `--subnet.name=web --subnet.vpc_id=<id> --subnet.cidr=192.168.1.0/24` |
35
- | Security Group | `--security_group.` | `--security_group.name=sg-web` |
36
- | SG Rule | `--security_group_rule.` | `--security_group_rule.direction=ingress` |
37
-
38
- ## EIP Management
39
-
40
- ```bash
41
- # Create EIP (pay-per-use)
42
- hcloud EIP CreatePublicip --publicip.type=<type> \
43
- --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
44
-
45
- # Bind to ECS (PORT type, not ECS)
46
- hcloud EIP AssociatePublicips --publicip_id=<id> \
47
- --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
48
-
49
- # Unbind
50
- hcloud EIP DisassociatePublicip --publicip_id=<id>
51
-
52
- # List
53
- hcloud EIP ListPublicips
54
-
55
- # Delete (unbind first)
56
- hcloud EIP DeletePublicip --publicip_id=<id>
57
- ```
58
-
59
- > EIP bills even when not bound. Release unused EIPs.
60
-
61
- ## Security Group Quick Reference
62
-
63
- ```bash
64
- # Create SG (no vpc_id needed)
65
- hcloud VPC CreateSecurityGroup --security_group.name=<name>
66
-
67
- # Add SSH rule
68
- hcloud VPC CreateSecurityGroupRule \
69
- --security_group_rule.security_group_id=<sg-id> \
70
- --security_group_rule.direction=<direction> \
71
- --security_group_rule.protocol=<protocol> \
72
- --security_group_rule.multiport=<port> \
73
- --security_group_rule.remote_ip_prefix=<cidr>
74
- ```
75
-
76
- > SG is stateful — return traffic auto-allowed. Network ACL is stateless — need both directions.
1
+ # VPC Network Management Reference
2
+
3
+ ## DNS Addresses by Region
4
+
5
+ Subnets without DNS configuration will fail cloud-init. Use these DNS addresses:
6
+
7
+ | Region | Primary DNS | Secondary DNS |
8
+ |--------|------------|---------------|
9
+ | cn-north-1 | 100.125.1.250 | 100.125.129.250 |
10
+ | cn-north-4 | 100.125.1.250 | 100.125.129.250 |
11
+ | cn-east-3 | 100.125.1.250 | 100.125.129.250 |
12
+ | cn-south-1 | 100.125.1.250 | 100.125.129.250 |
13
+ | ap-southeast-3 | 100.125.1.250 | 100.125.129.250 |
14
+
15
+ **Subnet create with DNS**:
16
+ ```bash
17
+ hcloud VPC CreateSubnet \
18
+ --subnet.name=<name> \
19
+ --subnet.vpc_id=<id> \
20
+ --subnet.cidr=10.50.1.0/24 \
21
+ --subnet.gateway_ip=10.50.1.1 \
22
+ --subnet.availability_zone=<az> \
23
+ --subnet.dnsList.1=100.125.1.250 \
24
+ --subnet.dnsList.2=100.125.129.250
25
+ ```
26
+
27
+ ## Nested Prefix Summary
28
+
29
+ KooCLI 7.x VPC API requires nested prefixes:
30
+
31
+ | Resource | Create Param Prefix | Example |
32
+ |----------|---------------------|---------|
33
+ | VPC | `--vpc.` | `--vpc.name=my-vpc --vpc.cidr=192.168.0.0/16` |
34
+ | Subnet | `--subnet.` | `--subnet.name=web --subnet.vpc_id=<id> --subnet.cidr=192.168.1.0/24` |
35
+ | Security Group | `--security_group.` | `--security_group.name=sg-web` |
36
+ | SG Rule | `--security_group_rule.` | `--security_group_rule.direction=ingress` |
37
+
38
+ ## EIP Management
39
+
40
+ ```bash
41
+ # Create EIP (pay-per-use)
42
+ hcloud EIP CreatePublicip --publicip.type=<type> \
43
+ --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
44
+
45
+ # Bind to ECS (PORT type, not ECS)
46
+ hcloud EIP AssociatePublicips --publicip_id=<id> \
47
+ --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
48
+
49
+ # Unbind
50
+ hcloud EIP DisassociatePublicip --publicip_id=<id>
51
+
52
+ # List
53
+ hcloud EIP ListPublicips
54
+
55
+ # Delete (unbind first)
56
+ hcloud EIP DeletePublicip --publicip_id=<id>
57
+ ```
58
+
59
+ > EIP bills even when not bound. Release unused EIPs.
60
+
61
+ ## Security Group Quick Reference
62
+
63
+ ```bash
64
+ # Create SG (no vpc_id needed)
65
+ hcloud VPC CreateSecurityGroup --security_group.name=<name>
66
+
67
+ # Add SSH rule
68
+ hcloud VPC CreateSecurityGroupRule \
69
+ --security_group_rule.security_group_id=<sg-id> \
70
+ --security_group_rule.direction=<direction> \
71
+ --security_group_rule.protocol=<protocol> \
72
+ --security_group_rule.multiport=<port> \
73
+ --security_group_rule.remote_ip_prefix=<cidr>
74
+ ```
75
+
76
+ > SG is stateful — return traffic auto-allowed. Network ACL is stateless — need both directions.
@@ -1,59 +1,59 @@
1
- # Security Group Rules
2
-
3
- ## Security Group is NOT bound to VPC
4
-
5
- VPC v3 API `CreateSecurityGroup` does NOT accept a `vpc_id` parameter. Security groups are region-level resources, not VPC-bound. They work across any VPC in the same region.
6
-
7
- ```bash
8
- # CORRECT — no vpc_id needed
9
- hcloud VPC CreateSecurityGroup --security_group.name=<name>
10
-
11
- # WRONG
12
- hcloud VPC CreateSecurityGroup --security_group.vpc_id=<vpc-id>
13
- ```
14
-
15
- ## KooCLI 7.x Nested Parameter Format
16
-
17
- Security group params use `--security_group.` prefix. Rules use `--security_group_rule.` prefix.
18
-
19
- ## Create Security Group Rule
20
-
21
- Complete example with nested prefix:
22
- ```bash
23
- hcloud VPC CreateSecurityGroupRule \
24
- --security_group_rule.security_group_id=<sg-id> \
25
- --security_group_rule.direction=<direction> \
26
- --security_group_rule.protocol=<protocol> \
27
- --security_group_rule.multiport=<port> \
28
- --security_group_rule.remote_ip_prefix=<cidr>
29
- ```
30
-
31
- > Always run `hcloud VPC CreateSecurityGroupRule --help` to verify param names.
32
-
33
- ## Stateful vs Stateless
34
-
35
- | Feature | Security Group | Network ACL |
36
- |---------|---------------|-------------|
37
- | Stateful? | Yes — return traffic auto-allowed | No — must allow both directions |
38
- | Applied to | ECS instance NIC | Subnet |
39
- | Rules | Allow only | Allow and Deny |
40
- | Default | Deny all inbound, allow all outbound | Allow all |
41
-
42
- ## Common Rules Reference
43
-
44
- | Direction | Protocol | Port | Source | Purpose |
45
- |-----------|----------|------|--------|---------|
46
- | Ingress | TCP | 22 | <office-ip>/32 | SSH |
47
- | Ingress | TCP | 80 | 0.0.0.0/0 | HTTP |
48
- | Ingress | TCP | 443 | 0.0.0.0/0 | HTTPS |
49
- | Ingress | TCP | 3306 | <sg-app-id> | MySQL from app |
50
- | Ingress | TCP | 6379 | <sg-app-id> | Redis from app |
51
- | Egress | ALL | ALL | 0.0.0.0/0 | Outbound default |
52
-
53
- ## Common Errors
54
-
55
- | Error | Root Cause -> Fix |
56
- |-------|-------------------|
57
- | Cannot SSH | Default SG denies all inbound. Add port 22 rule |
58
- | Rule not effective | SG assigned to wrong instance. Verify NIC attachment |
59
- | `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it |
1
+ # Security Group Rules
2
+
3
+ ## Security Group is NOT bound to VPC
4
+
5
+ VPC v3 API `CreateSecurityGroup` does NOT accept a `vpc_id` parameter. Security groups are region-level resources, not VPC-bound. They work across any VPC in the same region.
6
+
7
+ ```bash
8
+ # CORRECT — no vpc_id needed
9
+ hcloud VPC CreateSecurityGroup --security_group.name=<name>
10
+
11
+ # WRONG
12
+ hcloud VPC CreateSecurityGroup --security_group.vpc_id=<vpc-id>
13
+ ```
14
+
15
+ ## KooCLI 7.x Nested Parameter Format
16
+
17
+ Security group params use `--security_group.` prefix. Rules use `--security_group_rule.` prefix.
18
+
19
+ ## Create Security Group Rule
20
+
21
+ Complete example with nested prefix:
22
+ ```bash
23
+ hcloud VPC CreateSecurityGroupRule \
24
+ --security_group_rule.security_group_id=<sg-id> \
25
+ --security_group_rule.direction=<direction> \
26
+ --security_group_rule.protocol=<protocol> \
27
+ --security_group_rule.multiport=<port> \
28
+ --security_group_rule.remote_ip_prefix=<cidr>
29
+ ```
30
+
31
+ > Always run `hcloud VPC CreateSecurityGroupRule --help` to verify param names.
32
+
33
+ ## Stateful vs Stateless
34
+
35
+ | Feature | Security Group | Network ACL |
36
+ |---------|---------------|-------------|
37
+ | Stateful? | Yes — return traffic auto-allowed | No — must allow both directions |
38
+ | Applied to | ECS instance NIC | Subnet |
39
+ | Rules | Allow only | Allow and Deny |
40
+ | Default | Deny all inbound, allow all outbound | Allow all |
41
+
42
+ ## Common Rules Reference
43
+
44
+ | Direction | Protocol | Port | Source | Purpose |
45
+ |-----------|----------|------|--------|---------|
46
+ | Ingress | TCP | 22 | <office-ip>/32 | SSH |
47
+ | Ingress | TCP | 80 | 0.0.0.0/0 | HTTP |
48
+ | Ingress | TCP | 443 | 0.0.0.0/0 | HTTPS |
49
+ | Ingress | TCP | 3306 | <sg-app-id> | MySQL from app |
50
+ | Ingress | TCP | 6379 | <sg-app-id> | Redis from app |
51
+ | Egress | ALL | ALL | 0.0.0.0/0 | Outbound default |
52
+
53
+ ## Common Errors
54
+
55
+ | Error | Root Cause -> Fix |
56
+ |-------|-------------------|
57
+ | Cannot SSH | Default SG denies all inbound. Add port 22 rule |
58
+ | Rule not effective | SG assigned to wrong instance. Verify NIC attachment |
59
+ | `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it |
@@ -1,50 +1,50 @@
1
- # VPC Subnet Guide
2
-
3
- ## Prerequisite: VPC CIDR is Immutable
4
-
5
- VPC CIDR block cannot be changed after creation. Plan carefully.
6
-
7
- ## KooCLI 7.x Nested Parameter Format
8
-
9
- VPC API uses nested prefix: `--vpc.name`, `--subnet.vpc_id`, `--subnet.name`. NOT `--name` or `--vpc_id`.
10
-
11
- ```bash
12
- # CORRECT
13
- hcloud VPC CreateVpc --vpc.name=<name> --vpc.cidr=192.168.0.0/16
14
-
15
- hcloud VPC CreateSubnet \
16
- --subnet.name=<name> \
17
- --subnet.vpc_id=<vpc-id> \
18
- --subnet.cidr=192.168.1.0/24 \
19
- --subnet.gateway_ip=192.168.1.1 \
20
- --subnet.availability_zone=<az>
21
-
22
- # WRONG — will fail with [USE_ERROR]
23
- hcloud VPC CreateVpc --name=xxx
24
- hcloud VPC CreateSubnet --vpc_id=xxx
25
- ```
26
-
27
- ## Key Constraints
28
-
29
- | Constraint | Detail |
30
- |-----------|--------|
31
- | Subnet bound to single AZ | Cross-AZ needs multiple subnets. AZ code format: `cn-south-1a` |
32
- | CIDR must not overlap | Cannot overlap with other subnets in same VPC |
33
- | Gateway IP auto-assigned | Default is first IP in CIDR range (e.g., 192.168.1.1 for /24) |
34
- | 5 IPs reserved per subnet | First 4 + broadcast reserved by platform |
35
-
36
- ## Common Errors
37
-
38
- | Error | Root Cause -> Fix |
39
- |-------|-------------------|
40
- | `[USE_ERROR]不正确的参数:name` | Missing nested prefix. Use `--vpc.name=` or `--subnet.name=` |
41
- | CIDR overlap | Subnet CIDR must be within VPC CIDR and not overlap others |
42
- | AZ not found | Use `hcloud ECS NovaListAvailabilityZones --cli-region=<r>` to list valid AZ codes |
43
-
44
- ## CIDR Planning Reference
45
-
46
- | Environment | VPC CIDR | Subnet CIDR |
47
- |------------|----------|-------------|
48
- | Dev | 192.168.0.0/16 | 192.168.1.0/24 |
49
- | Staging | 10.0.0.0/16 | 10.0.1.0/24 |
50
- | Production | 172.16.0.0/16 | 172.16.1.0/24 (public) + 172.16.2.0/24 (private) |
1
+ # VPC Subnet Guide
2
+
3
+ ## Prerequisite: VPC CIDR is Immutable
4
+
5
+ VPC CIDR block cannot be changed after creation. Plan carefully.
6
+
7
+ ## KooCLI 7.x Nested Parameter Format
8
+
9
+ VPC API uses nested prefix: `--vpc.name`, `--subnet.vpc_id`, `--subnet.name`. NOT `--name` or `--vpc_id`.
10
+
11
+ ```bash
12
+ # CORRECT
13
+ hcloud VPC CreateVpc --vpc.name=<name> --vpc.cidr=192.168.0.0/16
14
+
15
+ hcloud VPC CreateSubnet \
16
+ --subnet.name=<name> \
17
+ --subnet.vpc_id=<vpc-id> \
18
+ --subnet.cidr=192.168.1.0/24 \
19
+ --subnet.gateway_ip=192.168.1.1 \
20
+ --subnet.availability_zone=<az>
21
+
22
+ # WRONG — will fail with [USE_ERROR]
23
+ hcloud VPC CreateVpc --name=xxx
24
+ hcloud VPC CreateSubnet --vpc_id=xxx
25
+ ```
26
+
27
+ ## Key Constraints
28
+
29
+ | Constraint | Detail |
30
+ |-----------|--------|
31
+ | Subnet bound to single AZ | Cross-AZ needs multiple subnets. AZ code format: `cn-south-1a` |
32
+ | CIDR must not overlap | Cannot overlap with other subnets in same VPC |
33
+ | Gateway IP auto-assigned | Default is first IP in CIDR range (e.g., 192.168.1.1 for /24) |
34
+ | 5 IPs reserved per subnet | First 4 + broadcast reserved by platform |
35
+
36
+ ## Common Errors
37
+
38
+ | Error | Root Cause -> Fix |
39
+ |-------|-------------------|
40
+ | `[USE_ERROR]不正确的参数:name` | Missing nested prefix. Use `--vpc.name=` or `--subnet.name=` |
41
+ | CIDR overlap | Subnet CIDR must be within VPC CIDR and not overlap others |
42
+ | AZ not found | Use `hcloud ECS NovaListAvailabilityZones --cli-region=<r>` to list valid AZ codes |
43
+
44
+ ## CIDR Planning Reference
45
+
46
+ | Environment | VPC CIDR | Subnet CIDR |
47
+ |------------|----------|-------------|
48
+ | Dev | 192.168.0.0/16 | 192.168.1.0/24 |
49
+ | Staging | 10.0.0.0/16 | 10.0.1.0/24 |
50
+ | Production | 172.16.0.0/16 | 172.16.1.0/24 (public) + 172.16.2.0/24 (private) |
@@ -1,63 +1,63 @@
1
- ---
2
- name: huawei-waf-aad
3
- description: "Use when configuring Web Application Firewall (WAF) policies/rules, or Anti-DDoS (AAD) protection on Huawei Cloud. Triggers: WAF, AAD, firewall, DDoS, web protection, IP blacklist, rate limiting, CC attack. NOT for: security groups (use huawei-vpc), CTS audit (use huawei-cts)."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud WAF / AAD
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud WAF <Operation> --help` before constructing commands to discover exact parameter names and requirements. For AAD operations, use `hcloud AAD --help`.
12
-
13
- ## Overview
14
-
15
- Domain expertise for WAF and Anti-DDoS. Covers WAF policy/rules, AAD protection, IP whitelist/blacklist, and rate limiting.
16
-
17
- ## Critical Warnings
18
-
19
- | Trap | Why |
20
- |------|-----|
21
- | WAF needs CNAME redirect | DNS must point to WAF endpoint, not server IP |
22
- | Premium instance required | Cloud WAF needs a dedicated/premium WAF instance |
23
- | AAD Standard vs Enterprise | Standard protects single IP. Enterprise protects entire IP ranges |
24
- | Rule order matters | WAF rules evaluated top-to-bottom within a policy |
25
-
26
- ## Common Workflows
27
-
28
- ### WAF
29
-
30
- | Task | Operation |
31
- |------|-----------|
32
- | List WAF instances | `ListInstances --cli-region=<r> --project_id=<p>` |
33
- | List policies | `ListPolicies --cli-region=<r> --project_id=<p>` |
34
- | Create custom rule | `BatchCreateCustomRule --cli-region=<r> --project_id=<p>` |
35
- | Create IP blacklist | `BatchCreateWhiteblackipRule --cli-region=<r> --project_id=<p>` |
36
- | Create CC rule | `BatchCreateCcRule --cli-region=<r> --project_id=<p>` |
37
- | Create geo rule | `BatchCreateGeoIpRule --cli-region=<r> --project_id=<p>` |
38
-
39
- ### AAD
40
-
41
- ```bash
42
- hcloud AAD ListInstances --cli-region=<r> --project_id=<p>
43
- hcloud AAD CreateInstance --cli-region=<r> --project_id=<p>
44
- ```
45
-
46
- ## Troubleshooting
47
-
48
- | Error | Fix |
49
- |-------|-----|
50
- | Website unreachable after WAF | Check CNAME record points to WAF endpoint |
51
- | WAF blocking legitimate traffic | Check rules order, adjust false positive settings |
52
- | AAD not responding | Standard AAD only protects single EIP. Check EIP binding |
53
-
54
- ## Security
55
-
56
- - MUST use WAF for all public-facing web applications
57
- - SHOULD enable AAD for DDoS protection
58
- - MUST test WAF rules in report-only mode before blocking
59
-
60
- ## Cross-Skill References
61
-
62
- - **EIP**: See `huawei-vpc` for elastic IP binding
63
- - **DNS/CNAME**: Configure via your DNS provider
1
+ ---
2
+ name: huawei-waf-aad
3
+ description: "Use when configuring Web Application Firewall (WAF) policies/rules, or Anti-DDoS (AAD) protection on Huawei Cloud. Triggers: WAF, AAD, firewall, DDoS, web protection, IP blacklist, rate limiting, CC attack. NOT for: security groups (use huawei-vpc), CTS audit (use huawei-cts)."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud WAF / AAD
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud WAF <Operation> --help` before constructing commands to discover exact parameter names and requirements. For AAD operations, use `hcloud AAD --help`.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for WAF and Anti-DDoS. Covers WAF policy/rules, AAD protection, IP whitelist/blacklist, and rate limiting.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | WAF needs CNAME redirect | DNS must point to WAF endpoint, not server IP |
22
+ | Premium instance required | Cloud WAF needs a dedicated/premium WAF instance |
23
+ | AAD Standard vs Enterprise | Standard protects single IP. Enterprise protects entire IP ranges |
24
+ | Rule order matters | WAF rules evaluated top-to-bottom within a policy |
25
+
26
+ ## Common Workflows
27
+
28
+ ### WAF
29
+
30
+ | Task | Operation |
31
+ |------|-----------|
32
+ | List WAF instances | `ListInstances --cli-region=<r> --project_id=<p>` |
33
+ | List policies | `ListPolicies --cli-region=<r> --project_id=<p>` |
34
+ | Create custom rule | `BatchCreateCustomRule --cli-region=<r> --project_id=<p>` |
35
+ | Create IP blacklist | `BatchCreateWhiteblackipRule --cli-region=<r> --project_id=<p>` |
36
+ | Create CC rule | `BatchCreateCcRule --cli-region=<r> --project_id=<p>` |
37
+ | Create geo rule | `BatchCreateGeoIpRule --cli-region=<r> --project_id=<p>` |
38
+
39
+ ### AAD
40
+
41
+ ```bash
42
+ hcloud AAD ListInstances --cli-region=<r> --project_id=<p>
43
+ hcloud AAD CreateInstance --cli-region=<r> --project_id=<p>
44
+ ```
45
+
46
+ ## Troubleshooting
47
+
48
+ | Error | Fix |
49
+ |-------|-----|
50
+ | Website unreachable after WAF | Check CNAME record points to WAF endpoint |
51
+ | WAF blocking legitimate traffic | Check rules order, adjust false positive settings |
52
+ | AAD not responding | Standard AAD only protects single EIP. Check EIP binding |
53
+
54
+ ## Security
55
+
56
+ - MUST use WAF for all public-facing web applications
57
+ - SHOULD enable AAD for DDoS protection
58
+ - MUST test WAF rules in report-only mode before blocking
59
+
60
+ ## Cross-Skill References
61
+
62
+ - **EIP**: See `huawei-vpc` for elastic IP binding
63
+ - **DNS/CNAME**: Configure via your DNS provider
@@ -1,56 +1,56 @@
1
- ---
2
- name: huaweicloud-api-and-sdk
3
- description: Huawei Cloud API and SDK guidance for application development. Use when writing code that calls Huawei Cloud services, choosing SDKs, building API requests, handling project_id, endpoint, auth, pagination, retries, error codes, or request IDs.
4
- ---
5
-
6
- # Huawei Cloud API And SDK
7
-
8
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
9
-
10
- Use this skill when the deliverable is application code, API integration, or precise request construction.
11
-
12
- ## Critical Warnings
13
-
14
- | Trap | Why |
15
- |------|-----|
16
- | `project_id` in path for most services | Many Huawei Cloud APIs require `project_id` in the URL path. Get it from IAM or KooCLI profile |
17
- | Pagination is not automatic | APIs return paginated results. Always check for `next_marker` or `page_info` to avoid partial data |
18
- | AK/SK signing algorithm | Huawei Cloud uses HMAC-SHA256 signing with specific header ordering. Use SDK, don't implement manually |
19
- | Endpoint varies by service and region | Always verify at https://developer.huaweicloud.com/endpoint |
20
- | Error response in `body` not HTTP status | Many errors return HTTP 200 with error details in the JSON body. Check `error_code` or `error_msg` fields |
21
-
22
- ## API Workflow
23
-
24
- 1. Identify service, region, endpoint, API version, and whether `project_id` is required in the path.
25
- 2. Verify the exact request body and response schema from official API documentation.
26
- 3. Handle pagination explicitly. Do not assume a single page.
27
- 4. Preserve `request_id` from errors and responses for troubleshooting.
28
- 5. Classify operation risk before running a live call.
29
- 6. For write APIs, produce a dry plan and ask the user before execution.
30
-
31
- ## SDK Workflow
32
-
33
- 1. Pick the SDK that matches the user's application language and existing dependency style.
34
- 2. Use the official SDK client for the target service.
35
- 3. Keep credentials out of source code. Use environment, profile, workload identity, or runtime secret injection.
36
- 4. Add timeout, retry, and pagination handling.
37
- 5. Return typed or structured results instead of unbounded raw logs.
38
-
39
- ## Troubleshooting
40
-
41
- | Error | Root Cause -> Fix |
42
- |-------|-------------------|
43
- | Invalid project_id | Wrong or missing project_id in URL path. Use `hcloud IAM KeystoneListProjects` or KooCLI profile |
44
- | 401/AuthFailure | Expired AK/SK or wrong signing algorithm. Regenerate AK/SK or check SDK version |
45
- | 403/Forbidden | IAM permission missing. Check user/role has required action permissions |
46
- | Empty results | Pagination missing — add `limit` and check `marker` |
47
- | Endpoint not reachable | Wrong region/service endpoint. Verify at developer.huaweicloud.com/endpoint |
48
-
49
- ## Terraform Priority
50
-
51
- Terraform Provider is low priority in V1. Mention it when the user needs reviewed, repeatable infrastructure changes. Do not default to Terraform for quick discovery or app-level SDK integration.
52
-
53
- ## Cross-Skill References
54
-
55
- - **CLI setup**: See `huaweicloud-cli-and-auth` for KooCLI credential setup
56
- - **Safety**: See `huaweicloud-safety` for write operation approval flow
1
+ ---
2
+ name: huaweicloud-api-and-sdk
3
+ description: Huawei Cloud API and SDK guidance for application development. Use when writing code that calls Huawei Cloud services, choosing SDKs, building API requests, handling project_id, endpoint, auth, pagination, retries, error codes, or request IDs.
4
+ ---
5
+
6
+ # Huawei Cloud API And SDK
7
+
8
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
9
+
10
+ Use this skill when the deliverable is application code, API integration, or precise request construction.
11
+
12
+ ## Critical Warnings
13
+
14
+ | Trap | Why |
15
+ |------|-----|
16
+ | `project_id` in path for most services | Many Huawei Cloud APIs require `project_id` in the URL path. Get it from IAM or KooCLI profile |
17
+ | Pagination is not automatic | APIs return paginated results. Always check for `next_marker` or `page_info` to avoid partial data |
18
+ | AK/SK signing algorithm | Huawei Cloud uses HMAC-SHA256 signing with specific header ordering. Use SDK, don't implement manually |
19
+ | Endpoint varies by service and region | Always verify at https://developer.huaweicloud.com/endpoint |
20
+ | Error response in `body` not HTTP status | Many errors return HTTP 200 with error details in the JSON body. Check `error_code` or `error_msg` fields |
21
+
22
+ ## API Workflow
23
+
24
+ 1. Identify service, region, endpoint, API version, and whether `project_id` is required in the path.
25
+ 2. Verify the exact request body and response schema from official API documentation.
26
+ 3. Handle pagination explicitly. Do not assume a single page.
27
+ 4. Preserve `request_id` from errors and responses for troubleshooting.
28
+ 5. Classify operation risk before running a live call.
29
+ 6. For write APIs, produce a dry plan and ask the user before execution.
30
+
31
+ ## SDK Workflow
32
+
33
+ 1. Pick the SDK that matches the user's application language and existing dependency style.
34
+ 2. Use the official SDK client for the target service.
35
+ 3. Keep credentials out of source code. Use environment, profile, workload identity, or runtime secret injection.
36
+ 4. Add timeout, retry, and pagination handling.
37
+ 5. Return typed or structured results instead of unbounded raw logs.
38
+
39
+ ## Troubleshooting
40
+
41
+ | Error | Root Cause -> Fix |
42
+ |-------|-------------------|
43
+ | Invalid project_id | Wrong or missing project_id in URL path. Use `hcloud IAM KeystoneListProjects` or KooCLI profile |
44
+ | 401/AuthFailure | Expired AK/SK or wrong signing algorithm. Regenerate AK/SK or check SDK version |
45
+ | 403/Forbidden | IAM permission missing. Check user/role has required action permissions |
46
+ | Empty results | Pagination missing — add `limit` and check `marker` |
47
+ | Endpoint not reachable | Wrong region/service endpoint. Verify at developer.huaweicloud.com/endpoint |
48
+
49
+ ## Terraform Priority
50
+
51
+ Terraform Provider is low priority in V1. Mention it when the user needs reviewed, repeatable infrastructure changes. Do not default to Terraform for quick discovery or app-level SDK integration.
52
+
53
+ ## Cross-Skill References
54
+
55
+ - **CLI setup**: See `huaweicloud-cli-and-auth` for KooCLI credential setup
56
+ - **Safety**: See `huaweicloud-safety` for write operation approval flow
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Huawei Cloud API And SDK"
3
- short_description: "Build correct Huawei Cloud API requests and SDK integrations."
4
- default_prompt: "Use $huaweicloud-api-and-sdk to plan this Huawei Cloud API or SDK integration."
1
+ interface:
2
+ display_name: "Huawei Cloud API And SDK"
3
+ short_description: "Build correct Huawei Cloud API requests and SDK integrations."
4
+ default_prompt: "Use $huaweicloud-api-and-sdk to plan this Huawei Cloud API or SDK integration."