summaryrefslogtreecommitdiffstats
path: root/cac
diff options
context:
space:
mode:
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.