summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-08-05 22:52:06 +0200
committertv <tv@shackspace.de>2015-08-05 22:54:29 +0200
commita14225984551e96f785bd427203b3e61483bdc34 (patch)
tree2a0b77a4dada9f8d096d19bd294d278e00510a50
parent98f23051b72600f95e06846ed2463432ed7af3f1 (diff)
cac templates: import from Makefile
-rw-r--r--Makefile7
-rwxr-xr-xcac13
2 files changed, 10 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ca9a52f..34a27fe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,6 @@
-listservers listtemplates:
- @ set -eu; \
- . ~/.secrets/cac; \
- ssh -q $$cac_via -t curl -fsS \
- "https://panel.cloudatcost.com/api/v1/$@.php?key=$$cac_key\\&login=$$cac_login" \
- | jq -r .
-
cloudpro-resources:
@ set -eu; \
. ~/.secrets/cac; \
diff --git a/cac b/cac
index 358e4cd..c8151d4 100755
--- a/cac
+++ b/cac
@@ -86,6 +86,13 @@ __cac_cli__servers() {
jq -r . $cac_servers_cache
}
+#? cac templates
+#? Print cached templates JSON.
+#?
+__cac_cli__templates() {
+ jq -r . $cac_templates_cache
+}
+
#? cac update
#? Fetch and cache servers and templates JSON.
#?
@@ -353,11 +360,11 @@ _cac_listservers() {(
)}
_cac_listtemplates() {(
- servers=$(_cac_get_api_v1 listtemplates)
- status=$(echo $servers | jq -r .status)
+ templates=$(_cac_get_api_v1 listtemplates)
+ status=$(echo $templates | jq -r .status)
if [ "$status" = ok ]; then
- echo "$servers" | jq -r .data
+ echo "$templates" | jq -r .data
else
echo "cac_listtemplates: bad listtemplates status: $status" >&2
exit 1