+2
-6
firewall/provider/hetzner/app.nu
+2
-6
firewall/provider/hetzner/app.nu
···
6
6
return $"https://api.hetzner.cloud/v1($path)"
7
7
}
8
8
def post [path: string] {
9
-
mut resp = $in | http post -e --full -H $authHeader --content-type application/json (makeApiUrl path)
10
-
$resp.body = $resp.body | from json
11
-
$resp
9
+
$in | http post -e --full -H $authHeader --content-type application/json (makeApiUrl path)
12
10
}
13
11
def get [path: string] {
14
-
mut resp = http get -e --full -H $authHeader (makeApiUrl path)
15
-
$resp.body = $resp.body | from json
16
-
$resp
12
+
http get -e --full -H $authHeader (makeApiUrl path)
17
13
}
18
14
19
15
# first fetch firewall to see if it even exists