provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
773 B

#!/bin/bash
# GET DOMAIN : https://eu.api.ovh.com/createToken/?GET=/me*&POST=/me*&PUT=/me*&DELETE=/me*
function set_base {
BASE_URL="https://eu.api.ovh.com/1.0"
source ./.ovh-credential
}
function get_me {
local method query body tstamp sha signature
method="GET"
query="${BASE_URL}/me"
body=""
tstamp=$(date +%s)
sha=$(echo -n "$AS+$CK+$method+$query+$body+$tstamp" | shasum | cut -d ' ' -f 1)
signature="\$1\$$sha"
curl -s \
-X $method \
-H "Content-type: application/json" \
-H "X-Ovh-Application: $AK" \
-H "X-Ovh-Consumer: $CK" \
-H "X-Ovh-Signature: $signature" \
-H "X-Ovh-Timestamp: $tstamp" \
"$query" | yq -P
}
. "$MIAOU_BASEDIR/lib/init.sh"
set_base
get_me