huaweicloud-devkit 1.1.0-next.2 → 1.1.0-next.21
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/README.md +64 -1
- package/README.zh-CN.md +63 -1
- package/package.json +3 -1
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -1
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +46 -21
- package/plugins/huaweicloud-core/openclaw.plugin.json +1 -1
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +136 -24
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +15 -14
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +1 -1
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +5 -1
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +27 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +11 -11
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +6 -5
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +596 -93
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +0 -1
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +8 -4
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +19 -12
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +52 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +12 -6
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +7 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +7 -7
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +2 -0
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +8 -0
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +30 -1
- package/plugins/huaweicloud-core/src/auth/service.mjs +33 -0
- package/plugins/huaweicloud-core/src/detect-framework.mjs +25 -3
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +67 -5
- package/plugins/huaweicloud-core/src/mcp-server.mjs +23 -0
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +11 -3
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +436 -21
- package/plugins/huaweicloud-core/src/search-market.mjs +1 -0
- package/plugins/huaweicloud-core/src/setup-cli.mjs +605 -50
- package/plugins/huaweicloud-core/src/tools.mjs +193 -18
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +29 -8
|
@@ -69,7 +69,7 @@ secret_value = client.get_secret(secret_id="my-secret")
|
|
|
69
69
|
|
|
70
70
|
# hcloud (for approved automation only)
|
|
71
71
|
|
|
72
|
-
hcloud CSMS
|
|
72
|
+
hcloud CSMS DownloadSecretBlob --secret_name=<name>
|
|
73
73
|
|
|
74
74
|
# WARNING: Output goes to stdout. Pipe directly, never capture in agent.
|
|
75
75
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-ecs
|
|
3
|
-
description: 'Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers.
|
|
3
|
+
description: 'Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers.
|
|
4
|
+
|
|
5
|
+
HC活动场景(ECS+Nginx部署后端服务)触发词: HC活动, 华为HC, HC大会, 活动部署, HC ECS, 活动流程, 部署后端, Nginx部署, Nodejs部署, 上线后端服务, 部署个人网站, /hc-activity/.'
|
|
4
6
|
version: 1
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -59,6 +61,7 @@ Flavor families are **region-dependent**. Always run `hcloud ECS ListFlavors --c
|
|
|
59
61
|
| Attach disk | hcloud EVS AttachVolume --volume_id=<id> --server_id=<id> | references/evs.md |
|
|
60
62
|
| Delete instance | hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true | references/create-instance.md |
|
|
61
63
|
| Reboot instance | hcloud ECS BatchRebootServers --reboot.servers.1.id=<id> --reboot.type=SOFT | NOT `RebootServer` — that operation does not exist |
|
|
64
|
+
| HC活动部署 | 按量付费购买ECS+Nginx部署后端服务 | references/hc-activity.md |
|
|
62
65
|
|
|
63
66
|
## How to Search for Instances
|
|
64
67
|
|
|
@@ -186,3 +189,4 @@ For Flexus X, use standard ECS CreateServers flow with `x1.*` flavors. For Flexu
|
|
|
186
189
|
- ECS Docs: https://support.huaweicloud.com/ecs/
|
|
187
190
|
- Flavor specs: references/flavors.md
|
|
188
191
|
- Create instance: references/create-instance.md
|
|
192
|
+
- HC活动 ECS+Nginx部署: references/hc-activity.md
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# HC活动 ECS + Nginx/Node.js 部署后端服务
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
在华为云 cn-north-4 区域,按量付费购买 ECS,部署后端代码仓的后端服务。
|
|
6
|
+
|
|
7
|
+
## 前置条件
|
|
8
|
+
|
|
9
|
+
- 后端代码仓 git 地址
|
|
10
|
+
- 账户已有默认 VPC 和子网(Agent 自动查询)
|
|
11
|
+
|
|
12
|
+
## 流程
|
|
13
|
+
|
|
14
|
+
1. 查询 VPC/子网,创建安全组,放通 SSH(22)仅本机IP、HTTP(80)全网
|
|
15
|
+
2. 查询镜像(推荐 HCE 2.0)和规格,直接购买1核2G
|
|
16
|
+
3. 创建 keypair,创建按量付费 ECS(系统盘 SSD 40GB),轮询等待 ACTIVE
|
|
17
|
+
4. 创建 5_bgp 按流量计费 EIP,绑定到 ECS 端口
|
|
18
|
+
5. SSH 登录,安装 Node.js 18,git clone 代码仓,npm install
|
|
19
|
+
6. Nginx反向代理:80->:3000
|
|
20
|
+
7. 验证 /hc-activity/api/title 和 /hc-activity/health
|
|
21
|
+
|
|
22
|
+
## 注意事项
|
|
23
|
+
|
|
24
|
+
- 后端3000仅监听回环
|
|
25
|
+
- Nginx修改后 nginx -t 再 reload
|
|
26
|
+
- 按量付费停机仍计费
|
|
27
|
+
- 删除实例时 --delete_publicip=true --delete_volume=true
|
|
@@ -42,14 +42,14 @@ Domain expertise for Huawei Cloud Identity and Access Management (IAM). Covers u
|
|
|
42
42
|
|
|
43
43
|
## Common Workflows
|
|
44
44
|
|
|
45
|
-
| Task | Command
|
|
46
|
-
| ------------------------ |
|
|
47
|
-
| List users | hcloud IAM
|
|
48
|
-
| Create group | hcloud IAM
|
|
49
|
-
| Create custom policy | hcloud IAM
|
|
50
|
-
| Create agency | hcloud IAM CreateAgency --agency.name=<n> --agency.domain_id=<id> --agency.
|
|
51
|
-
| Get temporary credential | hcloud STS
|
|
52
|
-
| Attach policy
|
|
45
|
+
| Task | Command | Steps |
|
|
46
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
47
|
+
| List users | hcloud IAM KeystoneListUsers --cli-region=<r> | references/iam-ops.md |
|
|
48
|
+
| Create group | hcloud IAM CreateGroupV5 --group_name=<name> | references/iam-ops.md |
|
|
49
|
+
| Create custom policy | hcloud IAM CreateCloudServiceCustomPolicy --role.display_name=<n> --role.type=<type> --role.policy.Statement.1.Effect=Allow | references/policy-examples.md |
|
|
50
|
+
| Create agency | hcloud IAM CreateAgency --agency.name=<n> --agency.domain_id=<id> --agency.trust_domain_name=<domain> | references/agency.md |
|
|
51
|
+
| Get temporary credential | hcloud STS AssumeAgency --agency_urn=<urn> --agency_session_name=<n> --duration_seconds=3600 | references/sts.md |
|
|
52
|
+
| Attach policy to group | hcloud IAM AttachGroupPolicyV5 --group_id=<id> --policy_id=<id> | references/iam-ops.md |
|
|
53
53
|
|
|
54
54
|
## Policy Examples (Least Privilege)
|
|
55
55
|
|
|
@@ -88,10 +88,10 @@ FunctionGraph needs an agency to access VPC resources (RDS, DCS, etc.):
|
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
# 1. Create agency with FunctionGraph trust
|
|
91
|
-
hcloud IAM CreateAgency --
|
|
91
|
+
hcloud IAM CreateAgency --agency.name=<name> --agency.trust_domain_name=functiongraph
|
|
92
92
|
|
|
93
|
-
# 2.
|
|
94
|
-
hcloud IAM
|
|
93
|
+
# 2. Grant role to agency
|
|
94
|
+
hcloud IAM AssociateAgencyWithDomainPermission --agency_id=<id> --role_id=<role-id>
|
|
95
95
|
|
|
96
96
|
# 3. Use in CreateFunction
|
|
97
97
|
hcloud FunctionGraph CreateFunction ... --app_xrole=<agency-name>
|
|
@@ -40,7 +40,7 @@ hcloud RDS <Operation> --cli-region=<region> [--key=value ...]
|
|
|
40
40
|
| Automated backups use OBS | Backup storage incurs separate charges. Set retention period explicitly |
|
|
41
41
|
| Storage auto-scaling off by default | Enable before storage runs out or instance goes read-only |
|
|
42
42
|
| `--password` conflicts with KooCLI | Use `--cli-jsonInput=<file>` with JSON file (see `--cli-jsonInput` section below). The `printf "b\n"` workaround is broken in KooCLI 7.2.12+ |
|
|
43
|
-
| Volume type must match flavor | General→CLOUDSSD; Dedicated→CLOUDSSD\|ESSD; ARM→
|
|
43
|
+
| Volume type must match flavor | General→CLOUDSSD; Dedicated→CLOUDSSD\|ESSD; ARM→CLOUDSSD |
|
|
44
44
|
| Flavor not in region | Always `ListFlavors` first. Spec codes vary by region |
|
|
45
45
|
| `database_name` is case-sensitive | Use `MySQL` / `PostgreSQL` / `SQLServer` / `MariaDB` — NOT lower-case `mysql` |
|
|
46
46
|
| Instance creation takes 3–8 min | Status: BUILD→MODIFYING→ACTIVE. Poll every 15s: `hcloud RDS ListInstances --cli-region=<r> --instance_id=<id> \| jq '.instances[0].status'` |
|
|
@@ -55,7 +55,7 @@ hcloud RDS <Operation> --cli-region=<region> [--key=value ...]
|
|
|
55
55
|
hcloud RDS ListInstances --cli-region=<r>
|
|
56
56
|
hcloud RDS ListFlavors --database_name=<engine> --cli-region=<r>
|
|
57
57
|
hcloud RDS ListDatastores --database_name=<engine> --cli-region=<r>
|
|
58
|
-
hcloud RDS ListEngineFlavors --instance_id=<id> --cli-region=<r>
|
|
58
|
+
hcloud RDS ListEngineFlavors --instance_id=<id> --availability_zone_ids=<az> --ha_mode=<mode> --cli-region=<r>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### Create Instance
|
|
@@ -109,7 +109,7 @@ hcloud RDS CreateInstance --cli-region=<r> \
|
|
|
109
109
|
| `--name` | Yes | Instance name |
|
|
110
110
|
| `--datastore` | Yes | `--datastore.type=<engine> --datastore.version=<version>` |
|
|
111
111
|
| `--flavor_ref` | Yes | From `ListFlavors` output |
|
|
112
|
-
| `--volume` | Yes | Type matching: General→CLOUDSSD, Dedicated→CLOUDSSD\|ESSD, ARM→
|
|
112
|
+
| `--volume` | Yes | Type matching: General→CLOUDSSD, Dedicated→CLOUDSSD\|ESSD, ARM→CLOUDSSD |
|
|
113
113
|
| `--vpc_id` | Yes | Must exist in target region |
|
|
114
114
|
| `--subnet_id` | Yes | Must exist in target region |
|
|
115
115
|
| `--security_group_id` | Yes | Must have DB port open |
|
|
@@ -150,7 +150,8 @@ hcloud RDS CreateRestoreInstance --instance_id=<id> --backup_id=<id> --name=<new
|
|
|
150
150
|
## Read Replicas
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
|
|
153
|
+
# Create a read replica via CreateInstance with --replica_of_id
|
|
154
|
+
hcloud RDS CreateInstance --replica_of_id=<primary-id> --name=<name> --flavor_ref=<id> --volume.type=<vol-type> --volume.size=<size> --cli-region=<r>
|
|
154
155
|
```
|
|
155
156
|
|
|
156
157
|
## Fault Diagnosis
|
|
@@ -159,7 +160,7 @@ hcloud RDS CreateReadReplica --replica_of_id=<primary-id> --name=<name> --flavor
|
|
|
159
160
|
hcloud RDS ListErrorLogs --instance_id=<id> --start_date=2024-01-01T00:00:00Z --end_date=2024-01-31T23:59:59Z --cli-region=<r>
|
|
160
161
|
hcloud RDS ListSlowLogs --instance_id=<id> --start_date=... --end_date=... --cli-region=<r>
|
|
161
162
|
hcloud RDS ShowReplicationStatus --instance_id=<id> --cli-region=<r>
|
|
162
|
-
hcloud RDS ListInstanceDiagnosis --cli-region=<r>
|
|
163
|
+
hcloud RDS ListInstanceDiagnosis --engine=<engine> --cli-region=<r>
|
|
163
164
|
```
|
|
164
165
|
|
|
165
166
|
## Connecting
|