From b7d800c029cd91074d16d603674d36ef8fa549cc Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 14 Dec 2016 16:17:30 +0100 Subject: [PATCH] ovh-api --- bin/ovh-api | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/ovh-api b/bin/ovh-api index 3a685b27..a1b2d48f 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -34,6 +34,8 @@ my %Opt = ( get_options(\%Opt); # Auth if ($_ = $Opt{activate}) { + system qq|curl -s -XPOST -H"X-Ovh-Application: $_" -H "Content-type: application/json" https://eu.api.ovh.com/1.0/auth/credential -d '{"accessRules": [ { "method": "GET", "path": "/*" },{ "method": "PUT", "path": "/*" },{ "method": "POST", "path": "/*" },{ "method": "DELETE", "path": "/*" } ] }'|.'|jq .'; + exit; exec qq|curl -s -XPOST -H"X-Ovh-Application: $_" -H "Content-type: application/json" https://eu.api.ovh.com/1.0/auth/credential -d '{"accessRules": [ { "method": "GET", "path": "/*" } ] }'|.'|jq .'; #print qq|curl -XPOST -H"X-Ovh-Application: $_" -H "Content-type: application/json" https://eu.api.ovh.com/1.0/auth/credential -d '{"accessRules": [ { "method": "GET", "path": "/*" } ], "redirection":"https://www.mywebsite.com/" }'\n|; #exec("curl","-XPOST",'-H',"X-Ovh-Application: $_",'-H','Content-type: application/json','https://eu.api.ovh.com/1.0/auth/credential','-d',qq|'{"accessRules": [ { "method": "GET", "path": "/*" } ],"redirection":"https://www.mywebsite.com/" }'|); @@ -194,7 +196,7 @@ Quick usage: =head1 OPTIONS option[activate=s] [KEY] Activate a key (first bit before ":" or KEY[0]) - option[method|m=s] Method (default: GET) + option[method|m=s] Method (default: GET) option[verbose|v+] Verbose mode: increase the verbosity level. option[debug+] Debug mode: increase the verbosity level. option[version|V] Print version (default: $VERSION) -- 2.47.3