diff options
author | tv <tv@shackspace.de> | 2015-08-05 23:39:19 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-08-05 23:39:19 +0200 |
commit | a865fff4e019ce31abc5e1ed2ecf916e838ab26f (patch) | |
tree | fc9974863c5f4f610f1016728e20eae47579e434 /cac | |
parent | 37d5fd2d57224186bd4644ba853c70c892dfc25d (diff) |
cac delete: import from Makefile
Diffstat (limited to 'cac')
-rwxr-xr-x | cac | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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. |