OVH
Manage OVHcloud services via the bundled ovh-cli.py script.
Setup
Store credentials in environment:
CODEBLOCK0
Get credentials:
- 1. Go to https://ca.api.ovh.com/createToken/ (or eu/us variant)
- Create application with desired permissions
- Validate the consumer key via the provided URL
Endpoints: ovh-eu, ovh-ca, ovh-us, soyoustart-eu, soyoustart-ca, kimsufi-eu, INLINECODE7
Usage
The script is at scripts/ovh-cli.py. Commands:
CODEBLOCK1
Common Patterns
Check domain expiry:
CODEBLOCK2
Add DNS record:
CODEBLOCK3
Manage VPS:
CODEBLOCK4
Notes
- - DNS changes require
refresh to apply - Use
--json flag for machine-readable output - Some operations are async; check status with subsequent calls
OVH
通过捆绑的 ovh-cli.py 脚本管理 OVHcloud 服务。
设置
将凭据存储在环境变量中:
bash
export OVH_ENDPOINT=ovh-ca # 或 ovh-eu、ovh-us 等
export OVHAPPKEY=your-app-key
export OVHAPPSECRET=your-app-secret
export OVHCONSUMERKEY=your-consumer-key
获取凭据:
- 1. 访问 https://ca.api.ovh.com/createToken/(或 eu/us 变体)
- 使用所需权限创建应用程序
- 通过提供的 URL 验证消费者密钥
端点: ovh-eu、ovh-ca、ovh-us、soyoustart-eu、soyoustart-ca、kimsufi-eu、kimsufi-ca
用法
脚本位于 scripts/ovh-cli.py。命令:
bash
账户信息
ovh-cli.py me
域名
ovh-cli.py domains # 列出所有域名
ovh-cli.py domain
# 获取域名信息
ovh-cli.py domain renew # 检查续费信息
DNS(OVH 管理的区域,非 Cloudflare)
ovh-cli.py dns # 列出 DNS 记录
ovh-cli.py dns get # 获取特定记录
ovh-cli.py dns create --type A --subdomain www --target 1.2.3.4 [--ttl 300]
ovh-cli.py dns update --target 5.6.7.8
ovh-cli.py dns delete
ovh-cli.py dns refresh # 刷新区域(应用更改)
VPS
ovh-cli.py vps # 列出所有 VPS
ovh-cli.py vps # VPS 详情
ovh-cli.py vps status # 当前状态
ovh-cli.py vps reboot # 重启 VPS
ovh-cli.py vps start # 启动 VPS
ovh-cli.py vps stop # 停止 VPS
ovh-cli.py vps ips # 列出 IP
云项目
ovh-cli.py cloud # 列出项目
ovh-cli.py cloud instances # 列出实例
ovh-cli.py cloud instance # 实例详情
专用服务器
ovh-cli.py dedicated # 列出服务器
ovh-cli.py dedicated # 服务器详情
ovh-cli.py dedicated reboot # 重启服务器
SSL 证书
ovh-cli.py ssl # 列出证书
ovh-cli.py ssl # 证书详情
账单与订单
ovh-cli.py bills [--limit N] # 最近账单
ovh-cli.py orders [--limit N] # 最近订单
常见模式
检查域名到期时间:
bash
ovh-cli.py domain pushp.ovh renew
添加 DNS 记录:
bash
ovh-cli.py dns pushp.ovh create --type A --subdomain api --target 203.0.113.50
ovh-cli.py dns pushp.ovh refresh
管理 VPS:
bash
ovh-cli.py vps myvps status
ovh-cli.py vps myvps reboot
注意事项
- - DNS 更改需要执行 refresh 才能生效
- 使用 --json 标志获取机器可读的输出
- 某些操作是异步的;可通过后续调用检查状态