summaryrefslogtreecommitdiffstats
path: root/cac
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-08-05 23:39:19 +0200
committertv <tv@shackspace.de>2015-08-05 23:39:19 +0200
commita865fff4e019ce31abc5e1ed2ecf916e838ab26f (patch)
treefc9974863c5f4f610f1016728e20eae47579e434 /cac
parent37d5fd2d57224186bd4644ba853c70c892dfc25d (diff)
cac delete: import from Makefile
Diffstat (limited to 'cac')
-rwxr-xr-xcac22
1 files changed, 22 insertions, 0 deletions
diff --git a/cac b/cac
index 1347f70..e194475 100755
--- a/cac
+++ b/cac
@@ -392,6 +392,28 @@ __cac_cli__build() {(
esac
)}
+#? cac delete SERVERSPEC
+#? Delete / terminate server to add resources.
+#?
+__cac_cli__delete() {(
+ server=$(__cac_cli__getserver "$1")
+ sid=$(echo $server | jq -r .sid)
+
+ reply=$(_cac_post_api_v1 cloudpro/delete sid="$sid")
+
+ case $(echo $reply | jq -r .status) in
+ ok)
+ echo $reply | jq -r . >&2
+ __cac_cli__update
+ ;;
+ *)
+ echo bad reply: >&2
+ echo $reply | jq -r . >&2
+ exit 23
+ ;;
+ esac
+)}
+
#?
#? SERVERSPEC is a query like "mode:Safe", "sdate:08/04/2015", etc.