diff options
author | tv <tv@krebsco.de> | 2015-05-20 20:18:33 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-05-20 20:18:33 +0200 |
commit | 300ab6a687c874e78e8f4a76a02a2482dab4ffb3 (patch) | |
tree | b41b0455419b4a6a2343da0d12833fc7b9d03567 /lib | |
parent | f104b3711309770f06a881248cb71fd625827dc6 (diff) |
lib/cac.sh: add _cac_post_api_v1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cac.sh | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -19,6 +19,17 @@ _cac_get_api_v1() { -G "https://panel.cloudatcost.com/api/v1/$1.php" } +_cac_post_api_v1() { + _cac_exec curl -fsS \ + $(shift + set -- "$@" login="$cac_login" key="$cac_key" + for arg; do + echo -d $(printf '%s' "$arg" | url_encode) + done + ) \ + -X POST "https://panel.cloudatcost.com/api/v1/$1.php" +} + cac_listservers() { _cac_get_api_v1 listservers } |