返回顶部
u

ucloud

UCloud Cloud Management - Complete Version

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
194
下载量
0
收藏
概述
安装方式
版本历史

ucloud

# UCloud Skill - 完整版本 UCloud云资源管理工具,支持所有主要资源类型的完整操作。 ## 先决条件 在使用本工具之前,需要先安装 UCloud CLI 命令行工具。 安装方法请参考官方文档:https://github.com/UCloudDoc-Team/cli/blob/master/intro.md 安装完成后,确认 CLI 已正确安装: ```bash ucloud --version ``` ## 环境变量 ```bash # 必需配置 export UCLOUD_PUBLIC_KEY="your_public_key_here" export UCLOUD_PRIVATE_KEY="your_private_key_here" # 可选配置 export UCLOUD_PROJECT_ID="your_project_id" # 默认项目ID export UCLOUD_REGION="cn-wlcb" # 默认地域 export UCLOUD_ZONE="cn-wlcb-01" # 默认可用区 ``` **注意**: API密钥从 https://console.ucloud.cn/ 获取 ## 支持的资源类型和操作 ### 云主机 (uhost) **操作**: list, create, start, stop, restart, delete, reset-password, resize ### MySQL 数据库 **操作**: - db: list, create, start, stop, restart, delete, reset-password, resize, restore, create-slave, promote-slave - conf: list, describe, download, apply, clone, delete, update - backup: list, create, delete, download - logs: list, download, delete, archive ### Redis 缓存 **操作**: list, create, start, stop, restart, delete ### Memcached 缓存 **操作**: list, create, restart, delete ### 弹性IP (eip) **操作**: list, allocate, bind, unbind, release, modify-bw, modify-traffic-mode ### 云硬盘 (udisk) **操作**: list, create, delete, attach, detach, expand, snapshot, list-snapshot, delete-snapshot, restore ### 负载均衡 (ulb) **操作**: list, create, delete, update - vserver: list, create, delete, update - backend: list, add, delete, update - policy: list, add, delete, update - ssl: list, add, delete, describe, bind, unbind ### 虚拟私有云 (vpc) **操作**: list, create, delete, create-intercome, delete-intercome, list-intercome ### 子网 (subnet) **操作**: list, create, delete, list-resource ### 防火墙 (firewall) **操作**: list, create, delete, update, apply, add-rule, remove-rule, resource, copy ### 镜像 (image) **操作**: list, create, delete, copy ### 项目 (project) **操作**: list, create, update, delete ### GlobalSSH加速 (gssh) **操作**: list, create, delete, update, location ### 全球加速 (pathx) **操作**: uga (list, create, delete, describe, add-port, delete-port), upath ### 对等连接 (udpn) **操作**: list, create, delete, modify-bw ### 物理主机 (uphost) **操作**: list ### 带宽包 (bw) **操作**: pkg (list, create, delete), shared (list, create, delete, resize) ### 区域查询 (region) **操作**: list ### 配置管理 (config) **操作**: list ## 使用方法 ### 基本语法 ```bash # 资源类型和操作 node /root/.openclaw/skills/ucloud/ucloud.mjs --action <操作> --resource <资源类型> # 列出所有主机 node /root/.openclaw/skills/ucloud/ucloud.mjs --action list --resource uhost # 创建主机 node /root/.openclaw/skills/ucloud/ucloud.mjs --action create --resource uhost \ --cpu 2 --memory-gb 4 \ --password "YourPassword123" \ --image-id "uimage-xxxxx" ``` # 列出所有MySQL node /root/.openclaw/skills/ucloud/ucloud.mjs --action list --resource mysql ``` ### MySQL高级操作示例 ```bash # MySQL配置管理 node /root/.openclaw/skills/ucloud/ucloud.mjs --action conf --resource mysql --conf-action list node /root/.openclaw/skills/ucloud/ucloud.mjs --action conf --resource mysql --conf-action describe --conf-id "conf-xxx" # MySQL备份 node /root/.openclaw/skills/ucloud/ucloud.mjs --action backup --resource mysql node /root/.openclaw/skills/ucloud/ucloud.mjs --action backup-create --resource mysql --id "udb-xxx" ``` ### 弹性IP示例 ```bash # 申请EIP node /root/.openclaw/skills/ucloud/ucloud.mjs --action allocate --resource eip --bandwidth-mb 5 --line BGP # 绑定EIP到主机 node /root/.openclaw/skills/ucloud/ucloud.mjs --action bind --resource eip --eip-id "eip-xxx" --resource-id "uhost-xxx" ``` ### VPC示例 ```bash # 创建VPC node /root/.openclaw/skills/ucloud/ucloud.mjs --action create --resource vpc --name "my-vpc" --segment "192.168.0.0/16" # 创建子网 node /root/.openclaw/skills/ucloud/ucloud.mjs --action create --resource subnet --name "my-subnet" --vpc-id "vpc-xxx" --segment "192.168.1.0/24" ``` ### 防火墙示例 ```bash # 创建防火墙 node /root/.openclaw/skills/ucloud/ucloud.mjs --action create --resource firewall --name "my-fw" \ --rules "TCP|22|0.0.0.0/0|ACCEPT|HIGH,TCP|80|0.0.0.0/0|ACCEPT|MEDIUM" # 添加规则 node /root/.openclaw/skills/ucloud/ucloud.mjs --action add-rule --resource firewall --id "fw-xxx" --rules "TCP|443|0.0.0.0/0|ACCEPT|LOW" ``` ### 负载均衡示例 ```bash # 创建负载均衡 node /root/.openclaw/skills/ucloud/ucloud.mjs --action create --resource ulb --name "my-ulb" --mode outer # 创建虚拟服务器 node /root/.openclaw/skills/ucloud/ucloud.mjs --action vserver --resource ulb --vserver-action create \ --ulb-id "ulb-xxx" --name "web-server" --protocol http --frontend-port 80 # 添加后端 node /root/.openclaw/skills/ucloud/ucloud.mjs --action vserver --resource ulb --vserver-action backend --vserver-action add \ --ulb-id "ulb-xxx" --vserver-id "vserver-xxx" --backend-ip "10.0.0.1" --backend-port 8080 ``` ## 常用参数 ### 通用参数 - `--region` - 覆盖默认地域 - `--zone` - 覆盖默认可用区 - `--json` - 返回JSON格式输出 ### ID参数 - `--id` / `--uhost-id` / `--udb-id` / `--cache-id` / `--udisk-id` / `--ulb-id` / `--vpc-id` / `--subnet-id` / `--eip-id` / `--firewall-id` / `--image-id` / `--snapshot-id` / `--backup-id` / `--conf-id` / `--rule-id` / `--vserver-id` / `--backend-id` / `--policy-id` / `--cert-id` ### 主机参数 - `--cpu` - CPU核心数 (required for create) - `--memory-gb` - 内存大小GB (required for create) - `--password` - 密码 (required for create, reset-password) - `--image-id` - 镜像ID (required for create) - `--name` - 主机名称 - `--count` - 创建数量 (default: 1) ### MySQL参数 - `--name` - 数据库名称 (required for create, min 6 chars) - `--version` - MySQL版本 (required for create) - `--password` - 数据库密码 (required for create, reset-password) - `--conf-id` - 配置ID (required for create) - `--memory-size-gb` - 内存大小GB (default: 1) - `--disk-size-gb` - 磁盘大小GB (default: 20) - `--port` - 端口 (default: 3306) - `--mode` - 模式 Normal/HA (default: Normal) ### Redis参数 - `--name` - 实例名称 (required for create) - `--size-gb` - 容量大小GB (required for create) - `--version` - Redis版本 (optional) - `--password` - 密码 (optional) ### EIP参数 - `--bandwidth-mb` - 带宽Mbps (required for allocate) - `--line` - 线路类型 BGP/International - `--resource-id` - 资源ID (for bind/unbind) - `--traffic-mode` - 流量模式 Bandwidth/Traffic ### 防火墙参数 - `--name` - 防火墙名称 (required for create) - `--rules` - 规则列表或--rules-file - 规则格式: 协议|端口|IP|操作|级别 ## 注意事项 1. 删除操作不可逆,请谨慎操作 2. 调整配置可能导致服务短暂中断 3. 重要操作前建议创建备份 4. 镜像ID可通过 `--action list --resource image` 查询 5. MySQL配置ID可通过 `--action conf --resource mysql` 查询 ## 日志记录 所有创建(create)和删除(delete)资源的操作都会自动记录到当前工作目录的 `logs` 文件夹中。 - 日志文件格式:`ucloud-operations-YYYY-MM-DD.jsonl` - 每条日志记录包含: - `timestamp`: 操作时间戳 - `action`: 操作类型(create/delete) - `resource`: 资源类型 - `params`: 操作参数 - `success`: 操作是否成功 - `data` 或 `error`: 操作结果或错误信息 示例日志记录: ```json {"timestamp":"2026-03-14T10:30:00.000Z","action":"create","resource":"uhost","params":{"cpu":"2","memoryGb":"4","imageId":"uimage-xxx","name":"test-host","count":"1"},"success":true,"data":{...}} ``` ## 输出格式 成功返回: ```json { "success": true, "data": [...] } ``` 失败返回: ```json { "success": false, "error": "错误信息" } ```

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ucloud-infra-1776088503 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ucloud-infra-1776088503 技能

通过命令行安装

skillhub install ucloud-infra-1776088503

下载 Zip 包

⬇ 下载 ucloud v1.0.0

文件大小: 8.32 KB | 发布时间: 2026-4-15 14:46

v1.0.0 最新 2026-4-15 14:46
Initial release of the complete UCloud cloud management skill.

- Supports full management for all major UCloud resource types (uhost, MySQL, Redis, EIP, udisk, ULB, VPC, Firewall, etc.)
- Offers listing, creation, deletion, configuration, resizing, and more for each resource type
- Requires UCloud CLI and relevant API environment variables (UCLOUD_PUBLIC_KEY, UCLOUD_PRIVATE_KEY)
- Provides comprehensive usage instructions and command examples for common UCloud operations
- Automatically logs all create/delete operations in structured log files
- Standardized JSON output for both success and error responses

┌──────────┬───────┬──────────────────────────────────────────────────┐
│ 产品 │ 资源 │ 支持的操作 │
│ │ 标识 │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 云主机 │ uhost │ list, create, start, stop, restart, delete, │
│ │ │ reset-password, resize │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ │ │ list, create, start, stop, restart, delete, │
│ MySQL │ mysql │ reset-password, resize, restore, create-slave, │
│ 数据库 │ │ promote-slave,以及配置管理(conf)、备份(backup) │
│ │ │ 、日志(logs) │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ Redis │ redis │ list, create, start, stop, restart, delete │
│ 缓存 │ │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ Memcache │ memca │ list, create, restart, delete │
│ d 缓存 │ ched │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 弹性IP │ eip │ list, allocate, bind, unbind, release, │
│ │ │ modify-bw, modify-traffic-mode │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ │ │ list, create, delete, attach, detach, expand, │
│ 云硬盘 │ udisk │ snapshot, list-snapshot, delete-snapshot, │
│ │ │ restore │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 负载均衡 │ ulb │ list, create, delete, update,以及虚拟服务器(vse │
│ │ │ rver)、后端(backend)、策略(policy)、SSL证书管理 │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 虚拟私有 │ vpc │ list, create, delete, create-intercome, │
│ 云 │ │ delete-intercome, list-intercome │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 子网 │ subne │ list, create, delete, list-resource │
│ │ t │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 防火墙 │ firew │ list, create, delete, update, apply, add-rule, │
│ │ all │ remove-rule, resource, copy │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 镜像 │ image │ list, create, delete, copy │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 项目 │ proje │ list, create, update, delete │
│ │ ct │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ GlobalSS │ gssh │ list, create, delete, update, location │
│ H加速 │ │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 全球加速 │ pathx │ UGA(list/create/delete/describe/add-port/delete- │
│ │ │ port)、UPath │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 对等连接 │ udpn │ list, create, delete, modify-bw │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 物理主机 │ uphos │ list │
│ │ t │ │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ │ │ 带宽包(pkg): │
│ 带宽包 │ bw │ list/create/delete;共享带宽(shared): │
│ │ │ list/create/delete/resize │
├──────────┼───────┼──────────────────────────────────────────────────┤
│ 区域查询 │ regio │ list │
│ │ n │ │
└──────────┴───────┴──────────────────────────────────────────────────┘

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部