ovh-api-bash-client/README.md

62 lines
1.2 KiB
Markdown
Raw Normal View History

2014-04-17 20:13:09 +02:00
ovhApiBashClient
================
A bash client for OVH API (https://api.ovh.com/)
Initialize
----------
2014-04-17 22:17:09 +02:00
### Retrieve dependency
First in order to retrieve needed dependecy, run:
```
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-17 20:13:09 +02:00
./ovhApiBashClient.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:
```
./ovhApiBashClient.sh --init
```
Options
-------
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
--init : to initialize the consumer key
--initApp : to initialize the API application
```
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-17 20:13:09 +02:00
./ovhApiBashClient.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:
```
./ovhApiBashClient.sh --url "/domain"
```
To activate the monitoring on your dedicated server, run:
```
./ovhApiBashClient.sh --method PUT --url "/dedicated/server/ns00000.ovh.net" --data '{"monitoring": true}'
```