huaweicloud-devkit 1.0.2-next.2 → 1.0.2-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/.agents/plugins/marketplace.json +18 -18
- package/README.md +81 -51
- package/README.zh-CN.md +81 -49
- package/bin/setup.cjs +5 -3
- package/integrations/opencode/opencode.json +1 -4
- package/package.json +61 -44
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +64 -17
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +25 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +45 -44
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +127 -42
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +17 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +56 -53
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +108 -5
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
- package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
- package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +20 -102
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +11 -4
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +9 -9
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +24 -26
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +510 -10
- package/plugins/huaweicloud-core/src/search-market.mjs +46 -12
- package/plugins/huaweicloud-core/src/setup-cli.mjs +1251 -181
- package/plugins/huaweicloud-core/src/tools.mjs +600 -122
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +12 -15
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +267 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
|
@@ -9,6 +9,7 @@ Huawei Cloud IAM uses a different action naming convention from AWS. Actions use
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Examples:
|
|
12
|
+
|
|
12
13
|
- `ecs:servers:list` (NOT `ecs:ListInstances`)
|
|
13
14
|
- `obs:bucket:GetBucket` (NOT `s3:GetBucket`)
|
|
14
15
|
- `vpc:vpcs:list` (NOT `vpc:DescribeVpcs`)
|
|
@@ -18,77 +19,100 @@ Always verify exact action names via `https://support.huaweicloud.com/usermanual
|
|
|
18
19
|
## Read-Only Policies
|
|
19
20
|
|
|
20
21
|
### ECS Read-Only
|
|
22
|
+
|
|
21
23
|
```json
|
|
22
24
|
{
|
|
23
25
|
"Version": "1.1",
|
|
24
|
-
"Statement": [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"Statement": [
|
|
27
|
+
{
|
|
28
|
+
"Effect": "Allow",
|
|
29
|
+
"Action": ["ecs:servers:list", "ecs:servers:get", "ecs:*:list", "ecs:*:get"],
|
|
30
|
+
"Resource": ["*"]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
29
33
|
}
|
|
30
34
|
```
|
|
31
35
|
|
|
32
36
|
### OBS Read-Only (scoped bucket)
|
|
37
|
+
|
|
33
38
|
```json
|
|
34
39
|
{
|
|
35
40
|
"Version": "1.1",
|
|
36
|
-
"Statement": [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
"Statement": [
|
|
42
|
+
{
|
|
43
|
+
"Effect": "Allow",
|
|
44
|
+
"Action": ["obs:bucket:Get*", "obs:bucket:List*", "obs:object:Get*"],
|
|
45
|
+
"Resource": ["obs:*:*:bucket:my-bucket", "obs:*:*:bucket:my-bucket/*"]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
41
48
|
}
|
|
42
49
|
```
|
|
43
50
|
|
|
44
51
|
### FunctionGraph Read-Only
|
|
52
|
+
|
|
45
53
|
```json
|
|
46
54
|
{
|
|
47
55
|
"Version": "1.1",
|
|
48
|
-
"Statement": [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
"Statement": [
|
|
57
|
+
{
|
|
58
|
+
"Effect": "Allow",
|
|
59
|
+
"Action": [
|
|
60
|
+
"functiongraph:function:getConfig",
|
|
61
|
+
"functiongraph:function:list",
|
|
62
|
+
"functiongraph:function:invoke",
|
|
63
|
+
"functiongraph:trigger:list"
|
|
64
|
+
],
|
|
65
|
+
"Resource": ["*"]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
53
68
|
}
|
|
54
69
|
```
|
|
55
70
|
|
|
56
71
|
## Full-Access (Scoped)
|
|
57
72
|
|
|
58
73
|
### RDS Operator
|
|
74
|
+
|
|
59
75
|
```json
|
|
60
76
|
{
|
|
61
77
|
"Version": "1.1",
|
|
62
|
-
"Statement": [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
"Statement": [
|
|
79
|
+
{
|
|
80
|
+
"Effect": "Allow",
|
|
81
|
+
"Action": ["rds:*"],
|
|
82
|
+
"Resource": ["*"],
|
|
83
|
+
"Condition": { "StringEquals": { "g:ResourceTag/Environment": ["dev", "staging"] } }
|
|
84
|
+
}
|
|
85
|
+
]
|
|
68
86
|
}
|
|
69
87
|
```
|
|
70
88
|
|
|
71
89
|
### FunctionGraph Developer
|
|
90
|
+
|
|
72
91
|
```json
|
|
73
92
|
{
|
|
74
93
|
"Version": "1.1",
|
|
75
|
-
"Statement": [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
"Statement": [
|
|
95
|
+
{
|
|
96
|
+
"Effect": "Allow",
|
|
97
|
+
"Action": ["functiongraph:function:*", "functiongraph:trigger:*", "functiongraph:runtime:list"],
|
|
98
|
+
"Resource": ["*"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
80
101
|
}
|
|
81
102
|
```
|
|
82
103
|
|
|
83
104
|
### APIG Operator
|
|
105
|
+
|
|
84
106
|
```json
|
|
85
107
|
{
|
|
86
108
|
"Version": "1.1",
|
|
87
|
-
"Statement": [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
"Statement": [
|
|
110
|
+
{
|
|
111
|
+
"Effect": "Allow",
|
|
112
|
+
"Action": ["apig:instance:*", "apig:api:*", "apig:group:*", "apig:environment:*"],
|
|
113
|
+
"Resource": ["*"]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
92
116
|
}
|
|
93
117
|
```
|
|
94
118
|
|
|
@@ -104,15 +128,17 @@ Always verify exact action names via `https://support.huaweicloud.com/usermanual
|
|
|
104
128
|
```json
|
|
105
129
|
{
|
|
106
130
|
"Version": "1.1",
|
|
107
|
-
"Statement": [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
131
|
+
"Statement": [
|
|
132
|
+
{
|
|
133
|
+
"Effect": "Allow",
|
|
134
|
+
"Action": ["ecs:*"],
|
|
135
|
+
"Resource": ["*"],
|
|
136
|
+
"Condition": {
|
|
137
|
+
"StringEquals": { "g:SourceAccount": "0123456789" },
|
|
138
|
+
"StringLike": { "g:SourceUrn": "urn:fss:*" }
|
|
139
|
+
}
|
|
114
140
|
}
|
|
115
|
-
|
|
141
|
+
]
|
|
116
142
|
}
|
|
117
143
|
```
|
|
118
144
|
|
|
@@ -31,13 +31,13 @@ hcloud IAM GetAccountSummary # account summary
|
|
|
31
31
|
|
|
32
32
|
## IAM vs AWS Comparison
|
|
33
33
|
|
|
34
|
-
| AWS
|
|
35
|
-
|
|
36
|
-
| `iam:ListUsers`
|
|
37
|
-
| AWS Managed Policy
|
|
38
|
-
| Customer Managed
|
|
39
|
-
| Resource-Based Policy | Project-Level Policy (项目级策略)
|
|
40
|
-
| IAM Role
|
|
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
41
|
|
|
42
42
|
> Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
|
|
43
43
|
|
|
@@ -49,8 +49,8 @@ hcloud IAM GetAccountSummary # account summary
|
|
|
49
49
|
"Action": ["ecs:*"],
|
|
50
50
|
"Resource": ["*"],
|
|
51
51
|
"Condition": {
|
|
52
|
-
"StringEquals": {"g:SourceAccount": "<account-id>"},
|
|
53
|
-
"StringLike": {"g:SourceUrn": "urn:fss:*"}
|
|
52
|
+
"StringEquals": { "g:SourceAccount": "<account-id>" },
|
|
53
|
+
"StringLike": { "g:SourceUrn": "urn:fss:*" }
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-modelarts
|
|
3
|
-
description:
|
|
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
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,13 +16,13 @@ Domain expertise for ModelArts. Covers training jobs, model deployment, notebook
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| OBS bucket required
|
|
22
|
-
| Training charges by duration
|
|
23
|
-
| Notebook auto-stop needed
|
|
24
|
-
| Model deployment needs quota
|
|
25
|
-
| Training job output must be OBS | Local output not supported. Ensure `--output_path` is a valid OBS path
|
|
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
26
|
|
|
27
27
|
## Prerequisites
|
|
28
28
|
|
|
@@ -32,31 +32,31 @@ Domain expertise for ModelArts. Covers training jobs, model deployment, notebook
|
|
|
32
32
|
|
|
33
33
|
## Common Workflows
|
|
34
34
|
|
|
35
|
-
| Task
|
|
36
|
-
|
|
37
|
-
| List models
|
|
38
|
-
| List training jobs | `ListTrainJobs --cli-region=<r> --project_id=<p>`
|
|
39
|
-
| List services
|
|
40
|
-
| List notebooks
|
|
41
|
-
| Create model
|
|
42
|
-
| Create notebook
|
|
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
43
|
|
|
44
44
|
Discover operation parameters with `--help` before executing any write operation.
|
|
45
45
|
|
|
46
46
|
## Service Types
|
|
47
47
|
|
|
48
|
-
| Type
|
|
49
|
-
|
|
50
|
-
| Training Job
|
|
51
|
-
| Model
|
|
52
|
-
| Service (Online) | Deploy models as REST API endpoints
|
|
53
|
-
| Notebook
|
|
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
54
|
|
|
55
55
|
## Troubleshooting
|
|
56
56
|
|
|
57
|
-
| Error
|
|
58
|
-
|
|
59
|
-
| OBS path not found | Verify OBS bucket exists and path is correct
|
|
57
|
+
| Error | Fix |
|
|
58
|
+
| ------------------ | ---------------------------------------------------------------- |
|
|
59
|
+
| OBS path not found | Verify OBS bucket exists and path is correct |
|
|
60
60
|
| Training job fails | Check training data format, resource quotas, and logs in console |
|
|
61
61
|
|
|
62
62
|
## Cross-Skill References
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-obs
|
|
3
|
-
description:
|
|
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
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -23,11 +23,11 @@ hcloud OBS help # NOT --help
|
|
|
23
23
|
hcloud OBS help <command> # e.g. hcloud OBS help mb
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
| Wrong (API-style)
|
|
27
|
-
|
|
28
|
-
| `OBS CreateBucket` | `OBS mb obs://<bucket>`
|
|
29
|
-
| `OBS PutObject`
|
|
30
|
-
| `OBS DeleteBucket` | `OBS rm obs://<bucket> -r`
|
|
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
31
|
|
|
32
32
|
## Overview
|
|
33
33
|
|
|
@@ -35,16 +35,16 @@ Domain expertise for Huawei Cloud Object Storage Service (OBS). Covers bucket/ob
|
|
|
35
35
|
|
|
36
36
|
## Critical Warnings
|
|
37
37
|
|
|
38
|
-
| Trap
|
|
39
|
-
|
|
40
|
-
| Bucket name is global
|
|
41
|
-
| Three-layer permissions
|
|
42
|
-
| Versioning is irreversible
|
|
43
|
-
| OBS uses AK/SK directly
|
|
44
|
-
| Static website via CLI missing
|
|
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**
|
|
47
|
-
| **Directory upload adds prefix**
|
|
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
48
|
|
|
49
49
|
## OBS Credential Setup (Required Before First Use)
|
|
50
50
|
|
|
@@ -62,21 +62,21 @@ hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK> -t=token
|
|
|
62
62
|
|
|
63
63
|
## Common Workflows
|
|
64
64
|
|
|
65
|
-
| Task
|
|
66
|
-
|
|
67
|
-
| Create bucket
|
|
68
|
-
| List buckets/objects
|
|
69
|
-
| Upload file
|
|
70
|
-
| Upload directory (recursive) | `hcloud OBS cp <dir>/ obs://<bucket>/ -r -f -flat`
|
|
71
|
-
| Download object
|
|
72
|
-
| Set bucket ACL
|
|
73
|
-
| Set object ACL
|
|
74
|
-
| Set lifecycle
|
|
75
|
-
| Set bucket policy
|
|
76
|
-
| Set CORS
|
|
77
|
-
| Delete bucket
|
|
78
|
-
| Presigned URL
|
|
79
|
-
| Object metadata
|
|
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
80
|
|
|
81
81
|
## Static Website Deployment Workflow
|
|
82
82
|
|
|
@@ -94,22 +94,23 @@ See `references/single-file-share.md` for the full workflow to host one file and
|
|
|
94
94
|
|
|
95
95
|
## Storage Classes
|
|
96
96
|
|
|
97
|
-
| Class
|
|
98
|
-
|
|
99
|
-
| STANDARD
|
|
100
|
-
| STANDARD_IA | Infrequent access
|
|
101
|
-
| ARCHIVE
|
|
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
102
|
|
|
103
103
|
## Troubleshooting
|
|
104
104
|
|
|
105
|
-
| Error
|
|
106
|
-
|
|
107
|
-
| AccessDenied on bucket
|
|
108
|
-
| BucketAlreadyExists
|
|
109
|
-
| NoSuchKey
|
|
110
|
-
| InvalidAccessKeyId
|
|
111
|
-
| EntityTooLarge
|
|
112
|
-
| OBS --help fails
|
|
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
|
+
| Configuration file is not well-formed | `~/.obsutilconfig` was generated by a non-standard path (CRLF line endings or field-order differences). Even `hcloud OBS --help` fails. Rebuild it with `hcloud OBS config -e=<endpoint> -i=<AK> -k=<SK>` (or `huaweicloud_setup_obs_config`) -> retry |
|
|
113
114
|
|
|
114
115
|
## Security Considerations
|
|
115
116
|
|
|
@@ -4,14 +4,14 @@ From Huawei Cloud marketplace best practices.
|
|
|
4
4
|
|
|
5
5
|
## Naming Rules
|
|
6
6
|
|
|
7
|
-
| Rule
|
|
8
|
-
|
|
9
|
-
| Length
|
|
10
|
-
| Characters
|
|
11
|
-
| No IP format
|
|
12
|
-
| No leading/trailing `-` or `.` | Start and end must be alphanumeric
|
|
13
|
-
| No `..`
|
|
14
|
-
| No `-.` or `.-`
|
|
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
15
|
|
|
16
16
|
## Create Bucket
|
|
17
17
|
|
|
@@ -19,11 +19,11 @@ From Huawei Cloud marketplace best practices.
|
|
|
19
19
|
hcloud OBS mb obs://<bucket> [-acl=xxx] [-location=<r>] [-sc=xxx]
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
| Option
|
|
23
|
-
|
|
24
|
-
| `-acl`
|
|
25
|
-
| `-location` | cn-south-1, cn-north-4, ...
|
|
26
|
-
| `-sc`
|
|
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
27
|
|
|
28
28
|
## Quick Verify
|
|
29
29
|
|
|
@@ -34,12 +34,12 @@ hcloud OBS stat obs://<bucket>
|
|
|
34
34
|
|
|
35
35
|
## Storage Class Guide
|
|
36
36
|
|
|
37
|
-
| Class
|
|
38
|
-
|
|
39
|
-
| standard
|
|
40
|
-
| warm
|
|
41
|
-
| cold
|
|
42
|
-
| deep-archive | Archive
|
|
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
43
|
|
|
44
44
|
## Critical Rules
|
|
45
45
|
|
|
@@ -3,24 +3,29 @@
|
|
|
3
3
|
> KooCLI OBS uses obsutil-style commands. `OBS CreateBucket` → `OBS mb`. `SetBucketWebsite` is NOT supported in KooCLI OBS (use API/SDK).
|
|
4
4
|
|
|
5
5
|
## Create Bucket
|
|
6
|
+
|
|
6
7
|
hcloud OBS mb obs://<bucket> -location=<region>
|
|
7
8
|
|
|
8
9
|
## Lifecycle Rules (JSON)
|
|
10
|
+
|
|
9
11
|
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
"Rules": [{
|
|
13
|
+
"ID": "move-to-ia-after-30d",
|
|
14
|
+
"Status": "Enabled",
|
|
15
|
+
"Filter": {"Prefix": ""},
|
|
16
|
+
"Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}],
|
|
17
|
+
"Expiration": {"Days": 365}
|
|
18
|
+
}]
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
## Apply
|
|
22
|
+
|
|
20
23
|
hcloud OBS lifecycle obs://<bucket> -method=put -localfile=<lifecycle.json>
|
|
21
24
|
|
|
22
25
|
## Static Website
|
|
26
|
+
|
|
23
27
|
Not available via KooCLI OBS CLI. Use `hcloud OBS chattri obs://<bucket> -acl=public-read` for bucket ACL, or use API/SDK for website configuration.
|
|
24
28
|
|
|
25
29
|
## Cross-Region Replication
|
|
30
|
+
|
|
26
31
|
Requires: source bucket versioning enabled, destination bucket in different region, replication IAM role.
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
OBS 使用 **obsutil-style** 子命令,不是 API-style 操作名:
|
|
8
8
|
|
|
9
|
-
| 错误写法(API-style) | 正确写法(obsutil-style)
|
|
10
|
-
|
|
11
|
-
| `OBS --help`
|
|
12
|
-
| `OBS CreateBucket`
|
|
13
|
-
| `OBS PutObject`
|
|
14
|
-
| `OBS DeleteBucket`
|
|
15
|
-
| `OBS ListBuckets`
|
|
9
|
+
| 错误写法(API-style) | 正确写法(obsutil-style) |
|
|
10
|
+
| --------------------- | --------------------------------------------- |
|
|
11
|
+
| `OBS --help` | `hcloud OBS help`(无 `--`,`help` 是子命令) |
|
|
12
|
+
| `OBS CreateBucket` | `hcloud OBS mb obs://<bucket>` |
|
|
13
|
+
| `OBS PutObject` | `hcloud OBS cp <file> obs://<bucket>/` |
|
|
14
|
+
| `OBS DeleteBucket` | `hcloud OBS rm obs://<bucket> -r` |
|
|
15
|
+
| `OBS ListBuckets` | `hcloud OBS ls` |
|
|
16
16
|
|
|
17
17
|
## 独立凭证配置
|
|
18
18
|
|
|
@@ -45,6 +45,7 @@ hcloud OBS config -i
|
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
**规避方法**:
|
|
48
|
+
|
|
48
49
|
1. 先 `-dryRun` 预览实际键名,再执行真实上传
|
|
49
50
|
2. 或先将本地目录重命名为目标前缀名,如 `mv devkit/ root/` 后上传 `root/`
|
|
50
51
|
3. 或使用 `-flat` 参数(如支持)
|
|
@@ -60,11 +61,11 @@ KooCLI OBS **不支持** `SetBucketWebsite` 命令。配置静态网站托管需
|
|
|
60
61
|
|
|
61
62
|
## 权限模型(三层)
|
|
62
63
|
|
|
63
|
-
| 层级
|
|
64
|
-
|
|
65
|
-
| IAM Policy
|
|
66
|
-
| Bucket Policy | 桶级
|
|
67
|
-
| ACL
|
|
64
|
+
| 层级 | 作用域 | 优先级 |
|
|
65
|
+
| ------------- | ----------- | ------ |
|
|
66
|
+
| IAM Policy | 用户/用户组 | 最高 |
|
|
67
|
+
| Bucket Policy | 桶级 | 中 |
|
|
68
|
+
| ACL | 对象级 | 最低 |
|
|
68
69
|
|
|
69
70
|
**关键规则**:三层中**最严格**的生效。Bucket Policy 设为 public-read,但 IAM deny 了 → 结果是 deny。
|
|
70
71
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Host one file and get a shareable link in seconds. Two options:
|
|
4
4
|
|
|
5
|
-
| Option
|
|
6
|
-
|
|
7
|
-
| Presigned URL | Time-limited private link | Keep private
|
|
8
|
-
| Public URL
|
|
5
|
+
| Option | Link type | Bucket/object visibility | Expiry |
|
|
6
|
+
| ------------- | ------------------------- | ----------------------------- | -------------------------- |
|
|
7
|
+
| Presigned URL | Time-limited private link | Keep private | `-e=<seconds>`, max 7 days |
|
|
8
|
+
| Public URL | Permanent public link | Set object `-acl=public-read` | None |
|
|
9
9
|
|
|
10
10
|
## Option 1: Presigned URL (private, time-limited)
|
|
11
11
|
|