diff options
Diffstat (limited to 'get_consumer_key.sh')
-rwxr-xr-x | get_consumer_key.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/get_consumer_key.sh b/get_consumer_key.sh new file mode 100755 index 0000000..12ca489 --- /dev/null +++ b/get_consumer_key.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -eu + +if [ -z "$OVH_APP_KEY" ]; then + echo 'Need $OVH_APP_KEY!' + echo "https://eu.api.ovh.com/createApp/" + exit 1 +fi + +BODY=' +{ + "accessRules": [ + { + "method": "DELETE", + "path": "/domain/zone/*" + }, + { + "method": "GET", + "path": "/domain/zone/*" + }, + { + "method": "POST", + "path": "/domain/zone/*" + }, + { + "method": "PUT", + "path": "/domain/zone/*" + }, + { + "method": "GET", + "path": "/domain/*" + }, + { + "method": "PUT", + "path": "/domain/*" + }, + { + "method": "POST", + "path": "/domain/*/nameServers/update" + } + ] +} +' + +echo $BODY | xh --json --print=b POST https://eu.api.ovh.com/1.0/auth/credential "X-Ovh-Application:$OVH_APP_KEY" |