this repository contains all needed bash functions to interact with OVH API
![]() |
1 month ago | |
---|---|---|
bin | 1 month ago | |
etc | 1 month ago | |
.gitignore | 1 month ago | |
Makefile | 1 month ago | |
README.md | 1 month ago | |
make.env | 1 month ago |
This is a simple OVH API wrapper in BASH
All API specifications is here : OVH API
It use the same configuration file as for the go-ovh wrapper
You need to follow : createApp And add the Application_key,secret_key and consumer_key to the ovh.conf
Examples
Get all VPS
./ovhcli get vps
[
"vps-3e2da6b4.vps.ovh.net",
"vps-556c9180.vps.ovh.net",
"vps-59e2e922.vps.ovh.net",
"vps-76fdb68a.vps.ovh.net",
"vps-89819518.vps.ovh.net",
"vps-b280dcff.vps.ovh.net",
"vps-f31d3392.vps.ovh.net"
]
Get all records for a DNS Zone "linuxforward.com"
./ovhcli get domain/zone/linuxforward.com/record/
[
5344790631,
5344790632,
5344790633,
5344790634,
5344790635,
5344790636,
5344790637,
[...]
5344790668,
5344790669,
5344790670,
5344790671
]
Get info from a specific DNS Zone record
./ovhcli get domain/zone/linuxforward.com/record/5344790650
{
"fieldType": "A",
"id": 5344790650,
"subDomain": "demodev",
"target": "51.91.101.38",
"ttl": 0,
"zone": "linuxforward.com"
}
List all details from all VPS
./ovhcli get vps | jq -r '.[]' | while read vps; do ./ovhcli get vps/${vps} | jq '[.name, .model.name, .model.version, .model.disk, .model.memory]|@tsv' ; done | column -t
vps-3e2da6b4.vps.ovh.net vps-value-1-2-40 2019v1 40 2048
vps-556c9180.vps.ovh.net vps-value-1-2-40 2019v1 40 2048
vps-59e2e922.vps.ovh.net vps-value-1-2-40 2019v1 40 2048
vps-76fdb68a.vps.ovh.net vps-starter-1-2-20 2019v1 20 2048
vps-89819518.vps.ovh.net vps-value-1-2-40 2019v1 40 2048
vps-b280dcff.vps.ovh.net vps-value-1-2-40 2019v1 40 2048
vps-f31d3392.vps.ovh.net vps-starter-1-2-20 2019v1 20 2048
If credentials are revoked
./ovhcli get vps
{
"class": "Client::Forbidden",
"message": "This credential is not valid",
"httpCode": "403 Forbidden",
"errorCode": "INVALID_CREDENTIAL"
}