huaweicloud-devkit 0.1.17

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 (76) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/LICENSE +201 -0
  3. package/README.md +148 -0
  4. package/bin/setup.cjs +8 -0
  5. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -0
  6. package/integrations/opencode/opencode.json +14 -0
  7. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -0
  8. package/package.json +43 -0
  9. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -0
  10. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -0
  11. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -0
  12. package/plugins/huaweicloud-core/.mcp.json +13 -0
  13. package/plugins/huaweicloud-core/hooks/hooks.json +26 -0
  14. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -0
  15. package/plugins/huaweicloud-core/safety/policy.json +86 -0
  16. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -0
  17. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -0
  18. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -0
  19. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -0
  20. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -0
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -0
  22. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -0
  23. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -0
  24. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -0
  25. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -0
  26. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -0
  27. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -0
  28. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -0
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -0
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +92 -0
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -0
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -0
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -0
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -0
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -0
  36. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -0
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -0
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -0
  39. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -0
  40. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -0
  41. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -0
  42. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -0
  43. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -0
  44. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -0
  45. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -0
  46. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -0
  47. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -0
  48. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -0
  49. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -0
  50. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -0
  51. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -0
  52. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +77 -0
  53. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +52 -0
  54. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -0
  55. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -0
  56. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -0
  57. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -0
  58. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -0
  59. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -0
  60. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -0
  61. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +125 -0
  62. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -0
  63. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +94 -0
  64. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -0
  65. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +20 -0
  66. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +28 -0
  67. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -0
  68. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -0
  69. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -0
  70. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -0
  71. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -0
  72. package/plugins/huaweicloud-core/src/mcp-server.mjs +93 -0
  73. package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -0
  74. package/plugins/huaweicloud-core/src/search-market.mjs +169 -0
  75. package/plugins/huaweicloud-core/src/setup-cli.mjs +628 -0
  76. package/plugins/huaweicloud-core/src/tools.mjs +672 -0
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env python3
2
+ """PreToolUse hook for Huawei Cloud agent safety.
3
+
4
+ Blocks the highest-risk leakage paths before an agent tool runs:
5
+ - reading local Huawei Cloud credential files
6
+ - dumping cloud credential environment variables
7
+ - directly retrieving cloud secret values
8
+ - running unapproved write operations through hcloud
9
+
10
+ The MCP server carries the same policy in Node for platforms that do not support
11
+ plugin hooks.
12
+ """
13
+
14
+ import json
15
+ import re
16
+ import sys
17
+
18
+ DENY_PREFIX = "Huawei Cloud safety hook blocked this action: "
19
+
20
+ CONFIG_FILE_RE = re.compile(r"(\.hcloud|\.huaweicloud|hcloud[/\\](config|credentials)|huaweicloud[/\\](config|credentials))", re.I)
21
+ ENV_DUMP_RE = re.compile(r"(env|printenv|Get-ChildItem\s+Env:|gci\s+Env:|dir\s+Env:).*(HUAWEICLOUD|HWC_|HCLOUD|OS_)", re.I)
22
+ SECRET_READ_RE = re.compile(r"(ShowSecretVersion|GetSecretValue|secret_string|secret_binary)", re.I)
23
+ HCLOUD_RE = re.compile(r"(^|\s)hcloud(\.exe)?\s+", re.I)
24
+ WRITE_OPERATION_RE = re.compile(
25
+ r"\b(BatchCreate|BatchDelete|Create|Delete|Update|Modify|Resize|Reboot|Stop|Start|Restart|Authorize|Revoke|Add|Remove|Associate|Disassociate|Attach|Detach|Enable|Disable)\w*",
26
+ re.I,
27
+ )
28
+ READ_OPERATION_RE = re.compile(r"\b(List|Show|Get|Describe|NovaList|NovaShow)\w*", re.I)
29
+
30
+
31
+ def deny(reason):
32
+ json.dump(
33
+ {
34
+ "hookSpecificOutput": {
35
+ "hookEventName": "PreToolUse",
36
+ "permissionDecision": "deny",
37
+ "permissionDecisionReason": DENY_PREFIX + reason,
38
+ }
39
+ },
40
+ sys.stdout,
41
+ )
42
+ sys.exit(0)
43
+
44
+
45
+ def allow():
46
+ sys.exit(0)
47
+
48
+
49
+ def command_text(tool_input):
50
+ if isinstance(tool_input, str):
51
+ return tool_input
52
+ if isinstance(tool_input, dict):
53
+ values = []
54
+ for key in ("command", "cmd", "script", "args", "arguments"):
55
+ value = tool_input.get(key)
56
+ if isinstance(value, list):
57
+ values.append(" ".join(str(item) for item in value))
58
+ elif value is not None:
59
+ values.append(str(value))
60
+ if values:
61
+ return "\n".join(values)
62
+ return json.dumps(tool_input)
63
+ return json.dumps(tool_input)
64
+
65
+
66
+ def main():
67
+ try:
68
+ data = json.load(sys.stdin)
69
+ except Exception:
70
+ allow()
71
+
72
+ tool_name = data.get("tool_name", "")
73
+ text = command_text(data.get("tool_input", {}))
74
+
75
+ if CONFIG_FILE_RE.search(text):
76
+ deny("reading Huawei Cloud credential/profile files can expose AK/SK or tokens. Use redacted toolkit tools.")
77
+ if ENV_DUMP_RE.search(text):
78
+ deny("dumping cloud credential environment variables is not allowed.")
79
+ if SECRET_READ_RE.search(text):
80
+ deny("direct secret value retrieval would put plaintext secrets into the agent context.")
81
+ if tool_name == "Bash" and HCLOUD_RE.search(text) and WRITE_OPERATION_RE.search(text) and not READ_OPERATION_RE.search(text):
82
+ deny("unapproved Huawei Cloud write operations must be planned first and explicitly approved by the user.")
83
+
84
+ allow()
85
+
86
+
87
+ if __name__ == "__main__":
88
+ main()
@@ -0,0 +1,86 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "secretKeyNamePatterns": [
4
+ "access[_-]?key",
5
+ "secret[_-]?key",
6
+ "security[_-]?token",
7
+ "x[_-]?auth[_-]?token",
8
+ "authorization",
9
+ "password",
10
+ "passwd",
11
+ "token",
12
+ "credential",
13
+ "private[_-]?key",
14
+ "ak",
15
+ "sk"
16
+ ],
17
+ "credentialFilePatterns": [
18
+ "\\.hcloud",
19
+ "\\.huaweicloud",
20
+ "hcloud[/\\\\](config|credentials)",
21
+ "huaweicloud[/\\\\](config|credentials)"
22
+ ],
23
+ "blockedConfigureSubcommands": [
24
+ "show",
25
+ "get",
26
+ "list",
27
+ "export",
28
+ "init"
29
+ ],
30
+ "blockedSecretOperations": [
31
+ "ShowSecretVersion",
32
+ "DownloadSecret",
33
+ "GetSecretValue"
34
+ ],
35
+ "writeOperationPrefixes": [
36
+ "Create",
37
+ "BatchCreate",
38
+ "Delete",
39
+ "BatchDelete",
40
+ "Update",
41
+ "Modify",
42
+ "Resize",
43
+ "Reboot",
44
+ "Stop",
45
+ "Start",
46
+ "Restart",
47
+ "Authorize",
48
+ "Revoke",
49
+ "Add",
50
+ "Remove",
51
+ "Associate",
52
+ "Disassociate",
53
+ "Attach",
54
+ "Detach",
55
+ "Enable",
56
+ "Disable",
57
+ "Set",
58
+ "Put",
59
+ "Upload",
60
+ "Install",
61
+ "Publish",
62
+ "Bind",
63
+ "Unbind",
64
+ "Invoke",
65
+ "Execute",
66
+ "Trigger",
67
+ "Deploy"
68
+ ],
69
+ "readOperationPrefixes": [
70
+ "List",
71
+ "Show",
72
+ "Get",
73
+ "Describe",
74
+ "NovaList",
75
+ "NovaShow"
76
+ ],
77
+ "safeTextReadCommands": [
78
+ "rg",
79
+ "grep",
80
+ "findstr",
81
+ "git",
82
+ "ls",
83
+ "dir",
84
+ "Get-ChildItem"
85
+ ]
86
+ }
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: huawei-apig
3
+ description: "Use when creating or managing API Gateway (APIG). Covers API creation, throttling, auth (IAM/APP/basic), CORS, publishing, instance management. Triggers: APIG, API gateway, throttling, publish API. NOT for: FunctionGraph triggers (use huawei-functiongraph)."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud APIG
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ ## Overview
12
+
13
+ Domain expertise for Huawei Cloud API Gateway (APIG). Covers instance lifecycle, API group/API creation, publishing, and FunctionGraph trigger integration.
14
+
15
+ Always discover parameters with `hcloud APIG <Operation> --help` before executing.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | API group region-locked | Cannot move across regions |
22
+ | Throttling per-API default | Use app-level quotas for per-user limits |
23
+ | CORS must be explicit | OPTIONS preflight fails until configured |
24
+ | `BASIC` spec has no public IP | Use `PROFESSIONAL` + `elb` provider for public access |
25
+ | Instance creation takes 5-15min | Long-running async operation. State is **Running** (NOT "SUCCESS"). Poll with `ListInstancesV2`, wait for `status == "Running"` |
26
+ | `sl_domain` is from API **Group** | NOT from Instance. Get it from `CreateApiGroupV2` or `ListApiGroupsV2` response |
27
+ | API name must NOT have hyphens | `[a-zA-Z0-9_]+` only. Hyphens cause regex validation failure |
28
+ | VPC params need prefix | `--vpc.name=<n>` / `--subnet.vpc_id=<id>` / `--security_group.name=<n>` with KooCLI 7.x |
29
+
30
+ ## Instance Management
31
+
32
+ ### Check Existing Instances
33
+
34
+ ```bash
35
+ hcloud APIG ListInstancesV2 --cli-region=<r>
36
+ ```
37
+
38
+ ### Create Instance
39
+
40
+ ```bash
41
+ hcloud APIG CreateInstanceV2 --help
42
+ ```
43
+
44
+ Key gotchas when creating:
45
+
46
+ | Param | Note |
47
+ |-------|------|
48
+ | `--spec_id` | `BASIC` (no public access), `PROFESSIONAL` (requires `--loadbalancer_provider`) |
49
+ | `--loadbalancer_provider` | `elb` for public access (supports `AddIngressEipV2`), `lvs` for internal only (supports `AddEipV2`) |
50
+ | `--enterprise_project_id` | **Required** for enterprise accounts. Use `"0"` for default project |
51
+ | `--available_zone_ids` | Use AZ code like `ap-southeast-3a`, NOT UUID from `ListAvailableZonesV2` |
52
+ | `--vpc_id`, `--subnet_id` | Must exist in the target region |
53
+ | `--security_group_id` | **Required**. Create a security group first via `VPC CreateSecurityGroup` (VPC v3 API — no `vpc_id` param needed) |
54
+
55
+ ### Add Public Access (ELB Provider Only)
56
+
57
+ ```bash
58
+ hcloud APIG AddIngressEipV2 \
59
+ --instance_id=<id> \
60
+ --bandwidth_charging_mode=bandwidth \
61
+ --bandwidth_size=5
62
+ ```
63
+
64
+ > `AddIngressEipV2` only works with `elb` provider. `AddEipV2` requires `lvs` provider. Bandwidth minimum is 5 Mbps.
65
+
66
+ ## API Group
67
+
68
+ ```bash
69
+ hcloud APIG CreateApiGroupV2 --instance_id=<id> --name=<n>
70
+ ```
71
+
72
+ | Param | Note |
73
+ |-------|------|
74
+ | `--name` | Group name (required) |
75
+ | `--remark` | Description (optional) |
76
+
77
+ ## API Management
78
+
79
+ ```bash
80
+ hcloud APIG CreateApiV2 --help
81
+ ```
82
+
83
+ ## Publishing
84
+
85
+ ```bash
86
+ hcloud APIG BatchPublishOrOfflineApiV2 \
87
+ --instance_id=<id> \
88
+ --action=online \
89
+ --env_id=<env-id> \
90
+ --apis.1=<api-id>
91
+ ```
92
+
93
+ > The operation is `BatchPublishOrOfflineApiV2`, NOT `PublishApiV2`. The parameter is `apis.1` (1-based array), NOT `api_ids`. For multiple APIs, use `--apis.1`, `--apis.2`, etc.
94
+
95
+ ## Throttling
96
+
97
+ ```bash
98
+ hcloud APIG CreateThrottlingPolicyV2 --name=<n> --api_call_limits=1000
99
+ ```
100
+
101
+ ## Common Workflows
102
+
103
+ | Task | Operation |
104
+ |------|-----------|
105
+ | List instances | `ListInstancesV2` |
106
+ | Create instance | `CreateInstanceV2` |
107
+ | Delete instance | `DeleteInstancesV2` |
108
+ | Add public EIP | `AddIngressEipV2` |
109
+ | Create API group | `CreateApiGroupV2` |
110
+ | Create API | `CreateApiV2` |
111
+ | Update API | `UpdateApiV2` — change auth mode, path, etc. |
112
+ | List APIs | `ListApisV2` |
113
+ | Publish | `BatchPublishOrOfflineApiV2` |
114
+ | List APIs | `ListApisV2` |
115
+
116
+ ## FunctionGraph Integration
117
+
118
+ To expose a FunctionGraph function via HTTP, you need the complete chain:
119
+
120
+ ```
121
+ APIG Instance → API Group → DEDICATEDGATEWAY Trigger → Publish
122
+ ```
123
+
124
+ After the trigger is created on FunctionGraph side, publish the API in APIG:
125
+
126
+ ```bash
127
+ hcloud APIG BatchPublishOrOfflineApiV2 \
128
+ --instance_id=<apig-instance-id> \
129
+ --action=online \
130
+ --env_id=<env-id> \
131
+ --apis.1=<api-id-from-trigger>
132
+ ```
133
+
134
+ See `huawei-functiongraph` skill → `references/deploy-workflow.md` for the full end-to-end workflow.
135
+
136
+ ## Cross-Skill References
137
+
138
+ - **VPC setup**: See `huawei-vpc` for VPC, subnet, security group creation
139
+ - **EIP setup**: See `huawei-vpc` for EIP creation and binding
140
+ - **FunctionGraph**: See `huawei-functiongraph` for DEDICATEDGATEWAY trigger creation
141
+
142
+ ## References
143
+
144
+ - APIG Docs: https://support.huaweicloud.com/apig/
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: huawei-billing
3
+ description: "Use when querying bills, costs, resource usage, or billing details on Huawei Cloud (BSS). Triggers: billing, BSS, cost, bill, expense, usage report, resource usage, budget. NOT for: resource management (use huawei-ecs etc.), creating resources."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud Billing (BSS)
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud BSS <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for billing queries (BSS). Covers cost tracking, bill details, and budget management. Read-only — no resource modifications.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | Bills delayed ~24h | Yesterday's costs may not appear until the next day |
22
+ | BSS Admin role needed | IAM user must have BSS Administrator or Finance role |
23
+ | Currency conversion varies | Cross-region costs use daily exchange rates |
24
+
25
+ ## Common Workflows
26
+
27
+ | Task | Operation |
28
+ |------|-----------|
29
+ | List costs | `ListCosts --cli-region=<r> --project_id=<p>` |
30
+ | List customer bills | `ListCustomerBills --cli-region=<r> --project_id=<p>` |
31
+ | List resource usage | `ListResourceUsage --cli-region=<r> --project_id=<p>` |
32
+ | List sub-customers | `ListConsumeSubCustomers --cli-region=<r> --project_id=<p>` |
33
+ | Show account balance | `ShowCustomerAccountBalances --cli-region=<r> --project_id=<p>` |
34
+ | List conversions | `ListConversions --cli-region=<r> --project_id=<p>` |
35
+
36
+ Discover exact parameters with `--help` before executing any command. All BSS operations are read-only.
37
+
38
+ ## Troubleshooting
39
+
40
+ | Error | Fix |
41
+ |-------|-----|
42
+ | Access denied | User needs BSS Administrator or Finance role |
43
+ | No data returned | Check time range (bills have ~24h delay). Verify project_id |
44
+ | Enterprise account restrictions | Some APIs require enterprise real-name authentication |
45
+
46
+ ## Cross-Skill References
47
+
48
+ - **Resource lifecycle**: See `huawei-ecs`, `huawei-obs` for creating billable resources
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: huawei-cbr
3
+ description: "Use when creating or managing Cloud Backup and Recovery (CBR) vaults, backups, and restore operations on Huawei Cloud. Triggers: CBR, backup, restore, vault, snapshot, disaster recovery. NOT for: OBS object versioning (use huawei-obs), RDS automated backups (use huawei-rds)."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud CBR
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud CBR <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Cloud Backup and Recovery. Covers vaults, backups, restore operations, policies, and cross-region replication.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | Vault binds single resource type | Server vault != disk vault != file system vault |
22
+ | Restore needs instance stop | Most VM restore requires the target instance to be stopped first |
23
+ | Backup storage incurs charges | Retention policies affect storage costs |
24
+
25
+ ## Common Workflows
26
+
27
+ | Task | Operation |
28
+ |------|-----------|
29
+ | List vaults | `ListVaults --cli-region=<r> --project_id=<p>` |
30
+ | Create vault | `CreateVault --cli-region=<r> --project_id=<p>` |
31
+ | Create backup policy | `CreatePolicy --cli-region=<r> --project_id=<p>` |
32
+ | Create checkpoint | `CreateCheckpoint --cli-region=<r> --project_id=<p>` |
33
+ | Add resource to vault | `AddVaultResource --cli-region=<r> --project_id=<p>` |
34
+ | Batch update vault | `BatchUpdateVault --cli-region=<r> --project_id=<p>` |
35
+ | Create organization policy | `CreateOrganizationPolicy --cli-region=<r> --project_id=<p>` |
36
+
37
+ Discover exact parameters with `--help` before executing any command.
38
+
39
+ ## Troubleshooting
40
+
41
+ | Error | Fix |
42
+ |-------|-----|
43
+ | Backup creation fails | Check instance is running and agent is online |
44
+ | Restore fails | Ensure target instance is stopped before restore |
45
+ | Vault full | Increase vault capacity or adjust retention policy |
46
+
47
+ ## Cross-Skill References
48
+
49
+ - **ECS**: See `huawei-ecs` for backing up instances
50
+ - **EVS**: See `huawei-ecs` references/evs.md for disk backup
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: huawei-cce
3
+ description: "Use when creating or managing CCE Kubernetes clusters. Covers cluster creation, node pools, SWR registry, autoscaling. Triggers: CCE, Kubernetes, K8s, cluster, node pool, container, SWR. NOT for: serverless functions (use huawei-functiongraph), serverless containers (use huawei-cce for CCI redirect)."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud CCE
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for CCE (Cloud Container Engine) and SWR (Software Repository for Container). CCE uses two hcloud services: `CCE` for clusters and `SWR` for container images.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | **KooCLI 7.x: CreateCluster/CreateNodePool broken** | OPENAPI_ERROR in KooCLI 7.2.12. Use `CreateAutopilotCluster` for serverless, or Python SDK for VM clusters |
22
+ | Cluster type immutable | Cannot change hybrid/traditional after creation |
23
+ | Master managed by Huawei | No SSH to master. Use kubectl or kubectl-cce |
24
+ | Network model affects pod IP | VPC network gives pods VPC IPs |
25
+ | Addon ops use UID not name | `ShowAddonInstance` returns `metadata.uid` for install/uninstall/update |
26
+ | SWR enterprise instance costs | `postPaid` billing. One-time activation at console required |
27
+
28
+ ## Common Workflows
29
+
30
+ | Task | Operation | Service |
31
+ |------|-----------|---------|
32
+ | List clusters | `ListClusters` | CCE |
33
+ | Create cluster | `CreateCluster` | CCE |
34
+ | Delete cluster | `DeleteCluster` | CCE |
35
+ | Hibernate cluster | `HibernateCluster` | CCE |
36
+ | List node pools | `ListNodePools` | CCE |
37
+ | Create node pool | `CreateNodePool` | CCE |
38
+ | List nodes | `ListNodes` | CCE |
39
+ | Get kubeconfig | `CreateKubernetesClusterCert` | CCE |
40
+ | List addons | `ListAddonInstances` | CCE |
41
+ | Docker login (SWR) | `CreateAuthorizationToken` | SWR |
42
+ | Create SWR org | `CreateNamespace` | SWR |
43
+ | Create SWR repo | `CreateRepo` | SWR |
44
+ | List repos | `ListReposDetails` | SWR |
45
+
46
+ ## SWR Image Push Workflow
47
+
48
+ **Prerequisite**: User/agency must have `sts::createServiceBearerToken` IAM permission. Without it, `CreateAuthorizationToken` returns `SVCSTG.SWR.4030170 Insufficient permissions`. Grant via IAM console or attach SWR Admin role.
49
+
50
+ ```bash
51
+ # 1. Docker login to SWR
52
+ hcloud SWR CreateAuthorizationToken --help
53
+ docker login -u <region>@<AK> -p <token> swr.<region>.myhuaweicloud.com
54
+
55
+ # 2. Tag and push
56
+ docker tag my-app:latest swr.<region>.myhuaweicloud.com/<org>/my-app:latest
57
+ docker push swr.<region>.myhuaweicloud.com/<org>/my-app:latest
58
+
59
+ # 3. Verify
60
+ hcloud SWR ListReposDetails --cli-region=<r>
61
+ ```
62
+
63
+ > SWR Auth token valid 12h. For CCE node pull access, create long-term credential with `CreateSecret` (valid 1 year).
64
+
65
+ ## Serverless Containers (CCI)
66
+
67
+ For serverless containers without managing clusters, use CCI (Cloud Container Instance):
68
+
69
+ - No cluster needed — just namespace + network + workload
70
+ - Key ops: `CCI createCoreV1Namespace`, `CCI createNetworkingCciIoV1beta1NamespacedNetwork`, `CCI createAppsV1NamespacedDeployment`
71
+ - Namespace MUST include `namespace-kubernetes-io/flavor` annotation
72
+ - `limits == requests` strictly enforced (no overcommit)
73
+
74
+ See `hcloud CCI --help` for full operation list.
75
+
76
+ ## Troubleshooting
77
+
78
+ | Error | Fix |
79
+ |-------|-----|
80
+ | kubectl connection refused | Verify cluster Running; use `kubectl cce` (no EIP needed) |
81
+ | Node pool creation failed | Check VPC/subnet availability and flavor capacity |
82
+ | Docker push 401 | Re-run `CreateAuthorizationToken` (token expired) |
83
+ | SVCSTG.SWR.4030170 | Missing `sts::createServiceBearerToken` IAM permission. Grant SWR Admin role or add policy |
84
+ | Addon install fails | Use `metadata.uid` from `ShowAddonInstance`, not name |
85
+ | `kubectl cce` not found | Install plugin: `kubectl cce` uses AK/SK, no kubeconfig required |
86
+
87
+ ## Security Considerations
88
+
89
+ - MUST restrict kubeconfig file permissions (0600)
90
+ - MUST use IAM RBAC for cluster access, not cluster-admin
91
+ - MUST store container images in private SWR repositories
92
+
93
+ ## Cross-Skill References
94
+
95
+ - **VPC/Subnet**: See `huawei-vpc` for network prerequisites
96
+ - **EIP**: See `huawei-vpc` for cluster public access
97
+
98
+ ## References
99
+
100
+ - CCE Docs: https://support.huaweicloud.com/cce/
101
+ - SWR Docs: https://support.huaweicloud.com/swr/
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: huawei-cloud-eye
3
+ description: "Use when setting up monitoring, alarms, dashboards, or event rules on Huawei Cloud Eye (CES). Triggers: Cloud Eye, CES, monitoring, alarm, metrics, dashboard, event monitoring. NOT for: CTS audit logs (use huawei-cts), AAD anti-DDoS (use huawei-waf-aad)."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud Cloud Eye (CES)
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud CES <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Cloud Eye (CES). Covers metric queries, alarm rules, dashboards, and monitoring agent management.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | Telescope agent required for detailed metrics | Without agent: only basic CPU/network metrics. Memory, disk require agent installation on ECS |
22
+ | Alarm needs SMN topic first | Alarm notifications fail silently without a configured SMN topic |
23
+ | Cost metrics incur charges | Custom metrics and high-frequency alarms have billing implications |
24
+ | CES endpoint may vary by region | Some older regions use different endpoint URLs. Check `https://developer.huaweicloud.com/endpoint?CES` |
25
+ | Metric granularity minimum 300s | Free tier has 5-minute minimum. Higher resolution requires paid tier |
26
+
27
+ ## Prerequisites
28
+
29
+ - ECS instances need the **Telescope agent** installed for detailed metrics (memory, disk, network)
30
+ - Without agent: only SYS.ECS namespace metrics available (CPU, network bytes, disk read/write)
31
+ - Alarm notifications require an SMN topic (see `huawei-smn-dms`)
32
+
33
+ ## Common Workflows
34
+
35
+ | Task | Operation |
36
+ |------|-----------|
37
+ | List metrics | `ListMetrics --cli-region=<r> --project_id=<p>` |
38
+ | Get metric data | `BatchListMetricData --cli-region=<r> --project_id=<p>` |
39
+ | List alarms | `ListAlarms --cli-region=<r> --project_id=<p>` |
40
+ | Create alarm | `CreateAlarm` (see below) |
41
+ | Delete alarm | `BatchDeleteAlarmRules --cli-region=<r> --project_id=<p>` |
42
+ | List dashboards | `ListDashboardWidgets --cli-region=<r> --project_id=<p>` |
43
+ | Create dashboard | `CreateDashboard --cli-region=<r> --project_id=<p>` |
44
+
45
+ ## Create Alarm Rule — Param Structure
46
+
47
+ CES uses **nested object prefixes** for alarm creation. Always verify with `--help`:
48
+
49
+ ```bash
50
+ hcloud CES CreateAlarm --help
51
+ # Key params: --alarm_name, --metric.metric_name, --metric.namespace,
52
+ # --condition.period, --condition.filter, --condition.value,
53
+ # --condition.comparison_operator, --condition.count
54
+ ```
55
+
56
+ ## Troubleshooting
57
+
58
+ | Error | Fix |
59
+ |-------|-----|
60
+ | No metric data | Telescope agent not installed or ECS stopped. Install agent for detailed metrics |
61
+ | Alarm not triggering | Check metric period (minimum 300s), verify condition threshold |
62
+ | CES network timeout in region | Some regions may have CES endpoint issues. Try a different region |
63
+
64
+ ## Security
65
+
66
+ - MUST use role-based alarm notifications
67
+ - MUST not expose alarm action endpoints publicly
68
+ - SHOULD enable CES alarm history for audit
69
+
70
+ ## Cross-Skill References
71
+
72
+ - **SMN topics**: See `huawei-smn-dms` for alarm notification setup
73
+ - **ECS monitoring**: See `huawei-ecs` for instance creation