]> git.nbdom.net Git - nb.git/commitdiff
ovh-api
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 14 Dec 2016 15:17:30 +0000 (16:17 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 14 Dec 2016 15:17:30 +0000 (16:17 +0100)
bin/ovh-api

index 3a685b2794f509e87498f199c0447f767eff78ca..a1b2d48fe426824135c2bc8e6aa2c52be850b2bd 100755 (executable)
@@ -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)