summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile0
-rwxr-xr-xcac22
2 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index e69de29..0000000
--- a/Makefile
+++ /dev/null
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.