ovh-api-bash-client/README.md

77 lines
1.7 KiB
Markdown
Raw Normal View History

orovh API Bash client
2014-04-17 20:13:09 +02:00
================
A bash client for OVH API (https://api.ovh.com/)
Initialize
----------
2014-04-17 22:17:09 +02:00
### Retrieve dependency
2014-04-17 22:17:44 +02:00
First in order to retrieve needed dependency, run:
2014-04-17 22:17:09 +02:00
```
make
```
2014-04-17 21:31:01 +02:00
### Create an OVH API Application
2014-04-17 21:28:03 +02:00
In order to create a new OVH API application, run:
2014-04-17 20:16:30 +02:00
```
2014-04-19 21:59:27 +02:00
./ovh-api-bash-client.sh --initApp
2014-04-17 20:16:30 +02:00
```
2014-04-17 20:13:09 +02:00
2014-04-17 21:31:01 +02:00
### Create a Consumer Key
In order to create a new consumer key, run:
```
2014-04-19 21:59:27 +02:00
./ovh-api-bash-client.sh --init
2014-04-17 21:31:01 +02:00
```
Options
-------
### Show help
```
./ovh-api-bash-client.sh --help
```
2014-04-17 21:31:01 +02:00
Possible arguments are:
```
--url <url> : the API URL to call, for example /domains (default is /me)
--method <method> : the HTTP method to use, for example POST (default is GET)
--data <JSON data> : the data body to send with the request
--target <CA|EU> : the target API (default is EU)
--init : to initialize the consumer key
--initApp : to initialize the API application
--list-profile : list available profiles in profile/ directory
--profile <value>
* default : from script directory
* <dir> : from profile/<dir> directory
2014-04-17 21:31:01 +02:00
```
2014-04-17 20:13:09 +02:00
Usage
-----
2014-04-17 21:31:01 +02:00
### Just some examples:
2014-04-17 21:28:03 +02:00
To make a basic call on GET /me just run:
2014-04-17 20:16:30 +02:00
```
2014-04-19 21:59:27 +02:00
./ovh-api-bash-client.sh
2014-04-17 20:16:30 +02:00
```
2014-04-17 20:13:09 +02:00
2014-04-17 21:28:03 +02:00
To retrieve your domain list, run:
```
2014-04-19 21:59:27 +02:00
./ovh-api-bash-client.sh --url "/domain"
2014-04-17 21:28:03 +02:00
```
To activate the monitoring on your dedicated server, run:
```
2014-04-19 21:59:27 +02:00
./ovh-api-bash-client.sh --method PUT --url "/dedicated/server/ns00000.ovh.net" --data '{"monitoring": true}'
2014-04-17 21:28:03 +02:00
```
To create a Consumer key for different account or usage (profile is created if missing)
```
./ovh-api-bash-client.sh --profile demo1 --init
./ovh-api-bash-client.sh --profile demo2 --init
```