compshare-api
管理优云智算CompShare平台的GPU实例全生命周期,包括创建、查询、启动、停止、重启、重置密码和删除实例;当用户需要创建GPU云服务器、查询实例状态、管理实例启停、重置实例密码或删除实例时使用
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/chsengni/compshare-apiCompShare API 技能
任务目标
- 本技能用于:管理优云智算CompShare平台的GPU实例资源
- 能力包含:创建GPU实例、查询实例列表、启动/停止/重启实例、重置密码、删除实例
- 触发条件:用户需要创建或管理CompShare平台的GPU云服务器实例
前置准备
依赖安装
pip install ucloud-sdk-python3 PyYAML paramiko
配置文件
在使用前,需要配置文件
1.编辑配置文件,填入API凭证:
compshare:
public_key: "your-public-key"
private_key: "your-private-key"
region: "cn-wlcb"
zone: "cn-wlcb-01"
base_url: "https://api.compshare.cn"
-
获取API凭证:
- 登录 CompShare 控制台:https://console.compshare.cn/
- 进入「API管理」页面:https://console.compshare.cn/uaccount/api_manage
- 创建并获取
public_key和private_key
-
配置文件查找优先级:
- 命令行参数
--config指定的路径 - 默认路径
assets/config.yaml(Skill目录下)
- 命令行参数
操作步骤
1. 创建GPU实例
调用 scripts/compshare_client.py 脚本,使用 create 命令:
python scripts/compshare_client.py create \
--gpu-type 4090 \
--gpu-count 1 \
--cpu 16 \
--memory 64 \
--disk-size 200 \
--image-id compshareImage-165jmhx19ik7 \
--name "my-instance"
2. 查询实例列表
调用脚本使用 list 命令:
python scripts/compshare_client.py list
# 或查询特定实例
python scripts/compshare_client.py list --instance-ids "instance-id-1,instance-id-2"
3. 启动实例
正常开机(带GPU):
python scripts/compshare_client.py start --instance-id <UHostId>
无卡开机(不带GPU,节省费用):
python scripts/compshare_client.py start --instance-id <UHostId> --without-gpu
4. 停止实例
调用脚本使用 stop 命令:
python scripts/compshare_client.py stop --instance-id <UHostId>
5. 重启实例
调用脚本使用 reboot 命令:
python scripts/compshare_client.py reboot --instance-id <UHostId>
6. 重置实例密码
调用脚本使用 reset-password 命令:
python scripts/compshare_client.py reset-password --instance-id <UHostId> --password <new-password>
7. 删除实例
调用脚本使用 delete 命令:
python scripts/compshare_client.py delete --instance-id <UHostId>
8. SSH连接实例
通过实例的 SshLoginCommand 和 Password 连接实例:
- 先查询实例获取 SSH 登录信息:
python scripts/compshare_client.py list
# 返回结果中包含 SshLoginCommand 和 Password
- 使用 SSH 客户端连接:
python scripts/ssh_client.py connect \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password"
9. SSH远程执行命令
python scripts/ssh_client.py exec \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--cmd "ls -la /home"
10. SSH文件操作
列出目录:
python scripts/ssh_client.py ls \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--path "/home"
上传文件:
python scripts/ssh_client.py upload \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--local ./local_file.txt \
--remote /home/remote_file.txt
下载文件:
python scripts/ssh_client.py download \
--ssh-command "ssh -p 12345 [email protected]" \
--password "your-password" \
--remote /home/remote_file.txt \
--local ./local_file.txt
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-chsengni-compshare-api": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
xiangongyun-api
仙宫云GPU云服务平台API集成工具,支持实例管理、私有镜像管理、账号管理等全量操作;当用户需要查询或管理仙宫云GPU实例、操作私有镜像、查询账户余额或充值时使用
skills-update-manager
管理已安装技能的注册、版本跟踪与自动更新检查;当用户安装新技能、检查技能更新或配置更新策略时使用。
comfyui-api
通过 HTTP API 与 ComfyUI 服务交互,支持工作流提交与执行、队列管理、文件上传和能力探测;自动检测视频工作流并使用合适超时;简洁输出执行结果;当用户需要使用 ComfyUI 生成图像、视频、音频或管理服务时使用