summary refs log tree commit diff stats
path: root/get_consumer_key.sh
blob: 12ca489d0b74099f81c22bac16dff46dc52ce5a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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"