summaryrefslogtreecommitdiffstats
path: root/lib/cac.sh
blob: 48a711cd00130906409d9be762bd1447b43ba836 (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
_cac_exec() {
  if test -z "${cac_via-}"; then
    (exec "$@")
  else
    ssh -q "$cac_via" -t "$@"
  fi
}

cac_listservers() {
  _cac_exec \
    curl -fsS \
      -G \
      --data-urlencode key="$cac_key" \
      --data-urlencode login="$cac_login" \
      'https://panel.cloudatcost.com/api/v1/listservers.php'
}

cac_listtasks() {
  _cac_exec \
    curl -fsS \
      -G \
      --data-urlencode key="$cac_key" \
      --data-urlencode login="$cac_login" \
      'https://panel.cloudatcost.com/api/v1/listtasks.php'
}