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.
- package/.agents/plugins/marketplace.json +20 -20
- package/LICENSE +201 -201
- package/README.md +163 -138
- package/README.zh-CN.md +161 -138
- package/bin/setup.cjs +8 -8
- package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
- package/integrations/opencode/opencode.json +14 -14
- package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
- package/package.json +46 -44
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -43
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/.mcp.json +15 -15
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +44 -44
- package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
- package/plugins/huaweicloud-core/safety/policy.json +99 -100
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +199 -199
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -124
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +185 -185
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +133 -133
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +131 -131
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -122
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +133 -127
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -100
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
- package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +224 -224
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +135 -131
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +51 -47
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +128 -127
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +110 -95
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +60 -60
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +105 -87
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +95 -95
- package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
- package/plugins/huaweicloud-core/src/mcp-server.mjs +129 -129
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +155 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +87 -0
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +137 -137
- package/plugins/huaweicloud-core/src/safety-policy.mjs +302 -302
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +91 -97
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +162 -153
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +112 -105
- package/plugins/huaweicloud-core/src/search-market.mjs +174 -169
- package/plugins/huaweicloud-core/src/setup-cli.mjs +2017 -1576
- package/plugins/huaweicloud-core/src/tools.mjs +1008 -1005
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +427 -427
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +132 -132
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +227 -227
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +202 -202
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +158 -158
- package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# IAM Quick Reference
|
|
2
|
-
|
|
3
|
-
## Common Operations
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
hcloud IAM KeystoneListProjects # list projects
|
|
7
|
-
hcloud IAM KeystoneListUsers # list users
|
|
8
|
-
hcloud IAM KeystoneListGroups # list groups
|
|
9
|
-
hcloud IAM ListCustomPolicies # list custom policies
|
|
10
|
-
hcloud IAM ListAgencies # list agencies
|
|
11
|
-
hcloud IAM KeystoneListAuthDomains # list domains
|
|
12
|
-
hcloud IAM KeystoneShowUser # show user detail
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Credential Management
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
hcloud IAM KeystoneListAccessKeys --user_id=<id> # list AK/SK for user
|
|
19
|
-
hcloud IAM CreateLoginToken # create login token
|
|
20
|
-
hcloud IAM GetAccountSummary # account summary
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Security Best Practices
|
|
24
|
-
|
|
25
|
-
1. **NEVER create IAM users** — use IAM Identity Center or temporary STS tokens
|
|
26
|
-
2. **NEVER create long-term AK/SK** — use temporary credentials
|
|
27
|
-
3. **Least privilege by default** — start empty, add only needed actions
|
|
28
|
-
4. **Scope resources** — no `*` wildcards on Resource
|
|
29
|
-
5. **Use condition keys** — `g:RequestedRegion`, `g:ResourceTag`, `g:CurrentTime`
|
|
30
|
-
6. **Rotate AK/SK every 90 days** — or use agency delegation
|
|
31
|
-
|
|
32
|
-
## IAM vs AWS Comparison
|
|
33
|
-
|
|
34
|
-
| AWS | Huawei Cloud |
|
|
35
|
-
|-----|-------------|
|
|
36
|
-
| `iam:ListUsers` | `iam:users:list` (lowercase + colon) |
|
|
37
|
-
| AWS Managed Policy | System Policy (系统策略) |
|
|
38
|
-
| Customer Managed | Custom Policy (自定义策略) |
|
|
39
|
-
| Resource-Based Policy | Project-Level Policy (项目级策略) |
|
|
40
|
-
| IAM Role | Agency (委托) |
|
|
41
|
-
|
|
42
|
-
> Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
|
|
43
|
-
|
|
44
|
-
## Confused Deputy Protection
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"Effect": "Allow",
|
|
49
|
-
"Action": ["ecs:*"],
|
|
50
|
-
"Resource": ["*"],
|
|
51
|
-
"Condition": {
|
|
52
|
-
"StringEquals": {"g:SourceAccount": "<account-id>"},
|
|
53
|
-
"StringLike": {"g:SourceUrn": "urn:fss:*"}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
```
|
|
1
|
+
# IAM Quick Reference
|
|
2
|
+
|
|
3
|
+
## Common Operations
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
hcloud IAM KeystoneListProjects # list projects
|
|
7
|
+
hcloud IAM KeystoneListUsers # list users
|
|
8
|
+
hcloud IAM KeystoneListGroups # list groups
|
|
9
|
+
hcloud IAM ListCustomPolicies # list custom policies
|
|
10
|
+
hcloud IAM ListAgencies # list agencies
|
|
11
|
+
hcloud IAM KeystoneListAuthDomains # list domains
|
|
12
|
+
hcloud IAM KeystoneShowUser # show user detail
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Credential Management
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
hcloud IAM KeystoneListAccessKeys --user_id=<id> # list AK/SK for user
|
|
19
|
+
hcloud IAM CreateLoginToken # create login token
|
|
20
|
+
hcloud IAM GetAccountSummary # account summary
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Security Best Practices
|
|
24
|
+
|
|
25
|
+
1. **NEVER create IAM users** — use IAM Identity Center or temporary STS tokens
|
|
26
|
+
2. **NEVER create long-term AK/SK** — use temporary credentials
|
|
27
|
+
3. **Least privilege by default** — start empty, add only needed actions
|
|
28
|
+
4. **Scope resources** — no `*` wildcards on Resource
|
|
29
|
+
5. **Use condition keys** — `g:RequestedRegion`, `g:ResourceTag`, `g:CurrentTime`
|
|
30
|
+
6. **Rotate AK/SK every 90 days** — or use agency delegation
|
|
31
|
+
|
|
32
|
+
## IAM vs AWS Comparison
|
|
33
|
+
|
|
34
|
+
| AWS | Huawei Cloud |
|
|
35
|
+
|-----|-------------|
|
|
36
|
+
| `iam:ListUsers` | `iam:users:list` (lowercase + colon) |
|
|
37
|
+
| AWS Managed Policy | System Policy (系统策略) |
|
|
38
|
+
| Customer Managed | Custom Policy (自定义策略) |
|
|
39
|
+
| Resource-Based Policy | Project-Level Policy (项目级策略) |
|
|
40
|
+
| IAM Role | Agency (委托) |
|
|
41
|
+
|
|
42
|
+
> Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
|
|
43
|
+
|
|
44
|
+
## Confused Deputy Protection
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"Effect": "Allow",
|
|
49
|
+
"Action": ["ecs:*"],
|
|
50
|
+
"Resource": ["*"],
|
|
51
|
+
"Condition": {
|
|
52
|
+
"StringEquals": {"g:SourceAccount": "<account-id>"},
|
|
53
|
+
"StringLike": {"g:SourceUrn": "urn:fss:*"}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-modelarts
|
|
3
|
-
description: "Use when training, deploying, or managing AI/ML models on Huawei Cloud ModelArts. Covers training jobs, model registry, online services, notebook instances. Triggers: ModelArts, model training, AI, machine learning, deep learning, notebook, inference, deployment. NOT for: general AI/ML concepts, non-Huawei platforms."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud ModelArts
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
Always run `hcloud ModelArts <Operation> --help` before constructing commands to discover exact parameter names and requirements.
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
Domain expertise for ModelArts. Covers training jobs, model deployment, notebook instances, and OBS integration.
|
|
16
|
-
|
|
17
|
-
## Critical Warnings
|
|
18
|
-
|
|
19
|
-
| Trap | Why |
|
|
20
|
-
|------|-----|
|
|
21
|
-
| OBS bucket required | All training data, model outputs, and notebook storage use OBS. Create bucket first |
|
|
22
|
-
| Training charges by duration | Pay-per-minute GPU/CPU billing. Stop unused notebooks and services |
|
|
23
|
-
| Notebook auto-stop needed | Default no auto-stop — can run indefinitely and incur charges |
|
|
24
|
-
| Model deployment needs quota | Online services may require service quota approval in new accounts |
|
|
25
|
-
| Training job output must be OBS | Local output not supported. Ensure `--output_path` is a valid OBS path |
|
|
26
|
-
|
|
27
|
-
## Prerequisites
|
|
28
|
-
|
|
29
|
-
- Training data must be stored in an OBS bucket (see `huawei-obs`)
|
|
30
|
-
- Output path for trained models must be an OBS path
|
|
31
|
-
- Notebook instances need a VPC/subnet (see `huawei-vpc`)
|
|
32
|
-
|
|
33
|
-
## Common Workflows
|
|
34
|
-
|
|
35
|
-
| Task | Operation |
|
|
36
|
-
|------|-----------|
|
|
37
|
-
| List models | `ListModels --cli-region=<r> --project_id=<p>` |
|
|
38
|
-
| List training jobs | `ListTrainJobs --cli-region=<r> --project_id=<p>` |
|
|
39
|
-
| List services | `ListServices --cli-region=<r> --project_id=<p>` |
|
|
40
|
-
| List notebooks | `ListNotebooks --cli-region=<r> --project_id=<p>` |
|
|
41
|
-
| Create model | `CreateModel --cli-region=<r> --project_id=<p>` |
|
|
42
|
-
| Create notebook | `CreateNotebook --cli-region=<r> --project_id=<p>` |
|
|
43
|
-
|
|
44
|
-
Discover operation parameters with `--help` before executing any write operation.
|
|
45
|
-
|
|
46
|
-
## Service Types
|
|
47
|
-
|
|
48
|
-
| Type | Purpose |
|
|
49
|
-
|------|---------|
|
|
50
|
-
| Training Job | Train models on GPU/CPU resources |
|
|
51
|
-
| Model | Register trained models for deployment |
|
|
52
|
-
| Service (Online) | Deploy models as REST API endpoints |
|
|
53
|
-
| Notebook | JupyterLab environments for development |
|
|
54
|
-
|
|
55
|
-
## Troubleshooting
|
|
56
|
-
|
|
57
|
-
| Error | Fix |
|
|
58
|
-
|-------|-----|
|
|
59
|
-
| OBS path not found | Verify OBS bucket exists and path is correct |
|
|
60
|
-
| Training job fails | Check training data format, resource quotas, and logs in console |
|
|
61
|
-
|
|
62
|
-
## Cross-Skill References
|
|
63
|
-
|
|
64
|
-
- **OBS storage**: See `huawei-obs` for bucket and training data management
|
|
65
|
-
- **VPC/Subnet**: See `huawei-vpc` for notebook network configuration
|
|
1
|
+
---
|
|
2
|
+
name: huawei-modelarts
|
|
3
|
+
description: "Use when training, deploying, or managing AI/ML models on Huawei Cloud ModelArts. Covers training jobs, model registry, online services, notebook instances. Triggers: ModelArts, model training, AI, machine learning, deep learning, notebook, inference, deployment. NOT for: general AI/ML concepts, non-Huawei platforms."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud ModelArts
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
Always run `hcloud ModelArts <Operation> --help` before constructing commands to discover exact parameter names and requirements.
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Domain expertise for ModelArts. Covers training jobs, model deployment, notebook instances, and OBS integration.
|
|
16
|
+
|
|
17
|
+
## Critical Warnings
|
|
18
|
+
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
|------|-----|
|
|
21
|
+
| OBS bucket required | All training data, model outputs, and notebook storage use OBS. Create bucket first |
|
|
22
|
+
| Training charges by duration | Pay-per-minute GPU/CPU billing. Stop unused notebooks and services |
|
|
23
|
+
| Notebook auto-stop needed | Default no auto-stop — can run indefinitely and incur charges |
|
|
24
|
+
| Model deployment needs quota | Online services may require service quota approval in new accounts |
|
|
25
|
+
| Training job output must be OBS | Local output not supported. Ensure `--output_path` is a valid OBS path |
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
|
|
29
|
+
- Training data must be stored in an OBS bucket (see `huawei-obs`)
|
|
30
|
+
- Output path for trained models must be an OBS path
|
|
31
|
+
- Notebook instances need a VPC/subnet (see `huawei-vpc`)
|
|
32
|
+
|
|
33
|
+
## Common Workflows
|
|
34
|
+
|
|
35
|
+
| Task | Operation |
|
|
36
|
+
|------|-----------|
|
|
37
|
+
| List models | `ListModels --cli-region=<r> --project_id=<p>` |
|
|
38
|
+
| List training jobs | `ListTrainJobs --cli-region=<r> --project_id=<p>` |
|
|
39
|
+
| List services | `ListServices --cli-region=<r> --project_id=<p>` |
|
|
40
|
+
| List notebooks | `ListNotebooks --cli-region=<r> --project_id=<p>` |
|
|
41
|
+
| Create model | `CreateModel --cli-region=<r> --project_id=<p>` |
|
|
42
|
+
| Create notebook | `CreateNotebook --cli-region=<r> --project_id=<p>` |
|
|
43
|
+
|
|
44
|
+
Discover operation parameters with `--help` before executing any write operation.
|
|
45
|
+
|
|
46
|
+
## Service Types
|
|
47
|
+
|
|
48
|
+
| Type | Purpose |
|
|
49
|
+
|------|---------|
|
|
50
|
+
| Training Job | Train models on GPU/CPU resources |
|
|
51
|
+
| Model | Register trained models for deployment |
|
|
52
|
+
| Service (Online) | Deploy models as REST API endpoints |
|
|
53
|
+
| Notebook | JupyterLab environments for development |
|
|
54
|
+
|
|
55
|
+
## Troubleshooting
|
|
56
|
+
|
|
57
|
+
| Error | Fix |
|
|
58
|
+
|-------|-----|
|
|
59
|
+
| OBS path not found | Verify OBS bucket exists and path is correct |
|
|
60
|
+
| Training job fails | Check training data format, resource quotas, and logs in console |
|
|
61
|
+
|
|
62
|
+
## Cross-Skill References
|
|
63
|
+
|
|
64
|
+
- **OBS storage**: See `huawei-obs` for bucket and training data management
|
|
65
|
+
- **VPC/Subnet**: See `huawei-vpc` for notebook network configuration
|
|
@@ -1,127 +1,133 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-obs
|
|
3
|
-
description: "Use when creating, configuring, or managing OBS buckets and objects on Huawei Cloud. Covers bucket creation, lifecycle policies, versioning, static website hosting, CORS, access control (IAM/bucket policy/ACL), cross-region replication, event notifications, and presigned URLs. Triggers on: OBS, bucket, object storage, lifecycle, versioning, static website, CORS, presigned, replication. NOT for: EVS block storage (use huawei-ecs), SFS file storage, CBR backup (use huawei-cbr)."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud OBS
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
---
|
|
2
|
+
name: huawei-obs
|
|
3
|
+
description: "Use when creating, configuring, or managing OBS buckets and objects on Huawei Cloud. Covers bucket creation, lifecycle policies, versioning, static website hosting, CORS, access control (IAM/bucket policy/ACL), cross-region replication, event notifications, and presigned URLs. Triggers on: OBS, bucket, object storage, lifecycle, versioning, static website, CORS, presigned, replication. NOT for: EVS block storage (use huawei-ecs), SFS file storage, CBR backup (use huawei-cbr)."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud OBS
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
## Routing Guard: Deploy vs Store
|
|
12
|
+
|
|
13
|
+
- If the developer's goal is to **deploy, host, or preview a web app / static website** (temporary hosting, quick preview), do NOT default to OBS. Present deployment-target options with the sandbox first: ① huawei-sandbox (recommended), ② OBS static hosting, ③ ECS, ④ CCE. Ask: "建议优先部署到沙箱(临时运行环境,可预览访问),也可选 OBS 静态托管/ECS/CCE,你想部署到哪里?"
|
|
14
|
+
- Proceed with OBS only when the developer selects OBS, explicitly asks for OBS, or the intent is long-term static hosting / CDN / file storage.
|
|
15
|
+
- OBS is a storage service; it is not a general web-hosting default.
|
|
16
|
+
|
|
17
|
+
## Critical: OBS Command Syntax
|
|
18
|
+
|
|
19
|
+
KooCLI OBS uses **obsutil-style** commands, NOT API-style operations. Always run `hcloud OBS help` (no `--`) before constructing commands:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
hcloud OBS help # NOT --help
|
|
23
|
+
hcloud OBS help <command> # e.g. hcloud OBS help mb
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Wrong (API-style) | Correct (obsutil-style) |
|
|
27
|
+
|-------------------|-------------------------|
|
|
28
|
+
| `OBS CreateBucket` | `OBS mb obs://<bucket>` |
|
|
29
|
+
| `OBS PutObject` | `OBS cp <file> obs://<bucket>/` |
|
|
30
|
+
| `OBS DeleteBucket` | `OBS rm obs://<bucket> -r` |
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
Domain expertise for Huawei Cloud Object Storage Service (OBS). Covers bucket/object lifecycle, access control, static website hosting, and presigned URLs.
|
|
35
|
+
|
|
36
|
+
## Critical Warnings
|
|
37
|
+
|
|
38
|
+
| Trap | Why |
|
|
39
|
+
|------|-----|
|
|
40
|
+
| Bucket name is global | All users share bucket namespace. Always use a unique name: `{prefix}-{timestamp}` (e.g. `mybucket-20260810155048`) |
|
|
41
|
+
| Three-layer permissions | IAM > Bucket Policy > ACL. Most restrictive wins |
|
|
42
|
+
| Versioning is irreversible | Once enabled, cannot be disabled, only suspended |
|
|
43
|
+
| OBS uses AK/SK directly | NOT IAM tokens. Auth errors mean check AK/SK validity |
|
|
44
|
+
| Static website via CLI missing | KooCLI OBS lacks website config. Use REST API or console |
|
|
45
|
+
| **OBS needs separate cred config** | `hcloud configure` is NOT enough for OBS. Before any OBS operation, call `huaweicloud_setup_obs_config` to sync credentials from hcloud profile. |
|
|
46
|
+
| **obsutil interactive prompts** | `cp`/`rm` without `-f` causes "Please input (y/n)" → Agent hangs (TIMEOUT). Always use `-f` for non-interactive. |
|
|
47
|
+
| **Directory upload adds prefix** | `cp <dir>/ obs://<bucket>/ -r` puts files under `bucket/<dir>/...`. Use `-flat` for root-level files (static sites). Preview with `-dryRun` first. |
|
|
48
|
+
|
|
49
|
+
## OBS Credential Setup (Required Before First Use)
|
|
50
|
+
|
|
51
|
+
KooCLI OBS uses a separate config file (`~/.obsutilconfig`), NOT `~/.hcloud/config.json`. All OBS commands fail with credential errors until this is configured.
|
|
52
|
+
|
|
53
|
+
**In-session bootstrap (recommended)**: Call `huaweicloud_setup_obs_config` — it syncs AK/SK from the active hcloud profile automatically. No manual key entry needed. Run this once per session before any OBS command.
|
|
54
|
+
|
|
55
|
+
**CLI fallback** (if MCP tools unavailable):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK> -t=token
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> `huaweicloud_setup_obs_config` should be called at the start of every OBS task — never assume credentials are pre-configured from a previous session.
|
|
62
|
+
|
|
63
|
+
## Common Workflows
|
|
64
|
+
|
|
65
|
+
| Task | Command |
|
|
66
|
+
|------|---------|
|
|
67
|
+
| Create bucket | `hcloud OBS mb obs://<bucket> -location=<region>` |
|
|
68
|
+
| List buckets/objects | `hcloud OBS ls [obs://<bucket>]` |
|
|
69
|
+
| Upload file | `hcloud OBS cp <file> obs://<bucket>/<key>` |
|
|
70
|
+
| Upload directory (recursive) | `hcloud OBS cp <dir>/ obs://<bucket>/ -r -f -flat` |
|
|
71
|
+
| Download object | `hcloud OBS cp obs://<bucket>/<key> <local-path>` |
|
|
72
|
+
| Set bucket ACL | `hcloud OBS chattri obs://<bucket> -acl=public-read` |
|
|
73
|
+
| Set object ACL | `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read` | Bucket ACL does NOT cascade — anonymous reads need both |
|
|
74
|
+
| Set lifecycle | `hcloud OBS lifecycle obs://<bucket> -method=put -localfile=<json>` |
|
|
75
|
+
| Set bucket policy | `hcloud OBS bucketpolicy obs://<bucket> -method=put -localfile=<json>` |
|
|
76
|
+
| Set CORS | `hcloud OBS cors obs://<bucket> -method=put -localfile=<json>` |
|
|
77
|
+
| Delete bucket | `hcloud OBS rm obs://<bucket> -r` (must be empty) |
|
|
78
|
+
| Presigned URL | `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` |
|
|
79
|
+
| Object metadata | `hcloud OBS stat obs://<bucket>/<key>` |
|
|
80
|
+
|
|
81
|
+
## Static Website Deployment Workflow
|
|
82
|
+
|
|
83
|
+
See `references/static-website.md` for the full end-to-end workflow:
|
|
84
|
+
Build → Create bucket → Upload → Set bucket ACL → Set object ACL → Configure website (REST API/console)
|
|
85
|
+
|
|
86
|
+
> KooCLI OBS does NOT support `SetBucketWebsite`. Configure static website hosting via REST API (`PUT /?website`) or the Huawei Cloud console.
|
|
87
|
+
|
|
88
|
+
## Single-File Quick Share
|
|
89
|
+
|
|
90
|
+
See `references/single-file-share.md` for the full workflow to host one file and get a shareable link in seconds:
|
|
91
|
+
|
|
92
|
+
- **Private, time-limited**: `hcloud OBS sign obs://<bucket>/<key> -e=<seconds>` (max 7 days)
|
|
93
|
+
- **Public, permanent**: `hcloud OBS cp <file> obs://<bucket>/<key> -f` + `hcloud OBS chattri obs://<bucket>/<key> -acl=public-read`, then share `https://<bucket>.obs.<region>.myhuaweicloud.com/<key>`
|
|
94
|
+
|
|
95
|
+
## Storage Classes
|
|
96
|
+
|
|
97
|
+
| Class | Use Case | Min Storage | Retrieval Fee |
|
|
98
|
+
|-------|----------|-------------|---------------|
|
|
99
|
+
| STANDARD | Frequently accessed | None | No |
|
|
100
|
+
| STANDARD_IA | Infrequent access | 30 days | Yes |
|
|
101
|
+
| ARCHIVE | Long-term archive | 90 days | Yes (hours) |
|
|
102
|
+
|
|
103
|
+
## Troubleshooting
|
|
104
|
+
|
|
105
|
+
| Error | Root Cause -> Fix |
|
|
106
|
+
|-------|------------------|
|
|
107
|
+
| AccessDenied on bucket | IAM/bucket policy/ACL conflict -> Check all three layers |
|
|
108
|
+
| BucketAlreadyExists | Name taken globally -> Generate unique name with timestamp suffix: `{prefix}-{yyyymmddHHMMSS}` |
|
|
109
|
+
| NoSuchKey | Object doesn't exist or wrong region -> Verify key and region |
|
|
110
|
+
| InvalidAccessKeyId | OBS uses AK/SK directly -> Verify AK/SK validity, OBS endpoint, OBS permissions |
|
|
111
|
+
| EntityTooLarge | Single PUT limit 5GB -> Use multipart upload |
|
|
112
|
+
| OBS --help fails | KooCLI OBS uses `help` not `--help` -> Run `hcloud OBS help` |
|
|
113
|
+
|
|
114
|
+
## Security Considerations
|
|
115
|
+
|
|
116
|
+
- MUST block public access by default
|
|
117
|
+
- MUST use HTTPS-only for buckets
|
|
118
|
+
- SHOULD enable access logging for audit
|
|
119
|
+
- SHOULD rotate presigned URL expiry (max 7 days)
|
|
120
|
+
- MUST NOT store AK/SK in bucket policies
|
|
121
|
+
|
|
122
|
+
## Cross-Skill References
|
|
123
|
+
|
|
124
|
+
- **EIP**: See `huawei-vpc` for public network access
|
|
125
|
+
- **DEW**: See `huawei-dew` for secret management
|
|
126
|
+
|
|
127
|
+
## References
|
|
128
|
+
|
|
129
|
+
- OBS Docs: https://support.huaweicloud.com/obs/
|
|
130
|
+
- Static website: references/static-website.md
|
|
131
|
+
- Single-file share: references/single-file-share.md
|
|
132
|
+
- Lifecycle: references/bucket-lifecycle.md
|
|
133
|
+
- Replication: references/replication.md
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# OBS Bucket Creation Reference
|
|
2
|
-
|
|
3
|
-
From Huawei Cloud marketplace best practices.
|
|
4
|
-
|
|
5
|
-
## Naming Rules
|
|
6
|
-
|
|
7
|
-
| Rule | Detail |
|
|
8
|
-
|------|--------|
|
|
9
|
-
| Length | 3-63 characters |
|
|
10
|
-
| Characters | Lowercase letters, numbers, `-`, `.` |
|
|
11
|
-
| No IP format | Cannot be IP address pattern |
|
|
12
|
-
| No leading/trailing `-` or `.` | Start and end must be alphanumeric |
|
|
13
|
-
| No `..` | Adjacent dots forbidden |
|
|
14
|
-
| No `-.` or `.-` | Adjacent dot-hyphen combos forbidden |
|
|
15
|
-
|
|
16
|
-
## Create Bucket
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
hcloud OBS mb obs://<bucket> [-acl=xxx] [-location=<r>] [-sc=xxx]
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
| Option | Values | Default |
|
|
23
|
-
|--------|--------|---------|
|
|
24
|
-
| `-acl` | private, public-read, public-read-write | private |
|
|
25
|
-
| `-location` | cn-south-1, cn-north-4, ... | config default |
|
|
26
|
-
| `-sc` | standard, warm, cold, deep-archive | standard |
|
|
27
|
-
|
|
28
|
-
## Quick Verify
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
hcloud OBS ls
|
|
32
|
-
hcloud OBS stat obs://<bucket>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Storage Class Guide
|
|
36
|
-
|
|
37
|
-
| Class | Access Frequency | Min Storage | Retrieval Cost |
|
|
38
|
-
|-------|-----------------|-------------|----------------|
|
|
39
|
-
| standard | Frequent | None | No |
|
|
40
|
-
| warm | Infrequent | 30 days | Yes |
|
|
41
|
-
| cold | Rare | 90 days | Yes |
|
|
42
|
-
| deep-archive | Archive | 180 days | Yes |
|
|
43
|
-
|
|
44
|
-
## Critical Rules
|
|
45
|
-
|
|
46
|
-
- Bucket name is globally unique — test with `hcloud OBS stat` before creating
|
|
47
|
-
- Region is immutable after creation
|
|
48
|
-
- ACL does NOT cascade to objects — set both bucket-level and object-level access
|
|
49
|
-
- OBS uses separate credentials (`~/.obsutilconfig`, configure via `hcloud OBS config -i`)
|
|
1
|
+
# OBS Bucket Creation Reference
|
|
2
|
+
|
|
3
|
+
From Huawei Cloud marketplace best practices.
|
|
4
|
+
|
|
5
|
+
## Naming Rules
|
|
6
|
+
|
|
7
|
+
| Rule | Detail |
|
|
8
|
+
|------|--------|
|
|
9
|
+
| Length | 3-63 characters |
|
|
10
|
+
| Characters | Lowercase letters, numbers, `-`, `.` |
|
|
11
|
+
| No IP format | Cannot be IP address pattern |
|
|
12
|
+
| No leading/trailing `-` or `.` | Start and end must be alphanumeric |
|
|
13
|
+
| No `..` | Adjacent dots forbidden |
|
|
14
|
+
| No `-.` or `.-` | Adjacent dot-hyphen combos forbidden |
|
|
15
|
+
|
|
16
|
+
## Create Bucket
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
hcloud OBS mb obs://<bucket> [-acl=xxx] [-location=<r>] [-sc=xxx]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Option | Values | Default |
|
|
23
|
+
|--------|--------|---------|
|
|
24
|
+
| `-acl` | private, public-read, public-read-write | private |
|
|
25
|
+
| `-location` | cn-south-1, cn-north-4, ... | config default |
|
|
26
|
+
| `-sc` | standard, warm, cold, deep-archive | standard |
|
|
27
|
+
|
|
28
|
+
## Quick Verify
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
hcloud OBS ls
|
|
32
|
+
hcloud OBS stat obs://<bucket>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Storage Class Guide
|
|
36
|
+
|
|
37
|
+
| Class | Access Frequency | Min Storage | Retrieval Cost |
|
|
38
|
+
|-------|-----------------|-------------|----------------|
|
|
39
|
+
| standard | Frequent | None | No |
|
|
40
|
+
| warm | Infrequent | 30 days | Yes |
|
|
41
|
+
| cold | Rare | 90 days | Yes |
|
|
42
|
+
| deep-archive | Archive | 180 days | Yes |
|
|
43
|
+
|
|
44
|
+
## Critical Rules
|
|
45
|
+
|
|
46
|
+
- Bucket name is globally unique — test with `hcloud OBS stat` before creating
|
|
47
|
+
- Region is immutable after creation
|
|
48
|
+
- ACL does NOT cascade to objects — set both bucket-level and object-level access
|
|
49
|
+
- OBS uses separate credentials (`~/.obsutilconfig`, configure via `hcloud OBS config -i`)
|