diff options
author | tv <tv@shackspace.de> | 2015-08-05 23:33:12 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-08-05 23:33:58 +0200 |
commit | 37d5fd2d57224186bd4644ba853c70c892dfc25d (patch) | |
tree | 7b93ba151ebab3a4ea5a06b1997938df3f847ff4 /cac | |
parent | 71ef6469e17e876d99555e55532a61758e51a25b (diff) |
cac build: import from Makefile
Diffstat (limited to 'cac')
-rwxr-xr-x | cac | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -364,6 +364,34 @@ __cac_cli__poll() { __cac_cli__poll "$@" } +#? cac build cpu=.. ram=.. storage=.. os=.. +#? Build a server from available resources. +#? cpu = 1/2/3/4/5/6/7/8 limit: 16 +#? ram = 1024 (must be multiple of 4. ex. 1024 / 2048 / 3096) limit: 32768 +#? storage = 10/20/30/40/50 ... etc limit: 1000 +#? os = 75 (must be an #id from `cac templates`) +#? +__cac_cli__build() {( + reply=$(export "$@"; _cac_post_api_v1 cloudpro/build \ + cpu="$cpu" \ + ram="$ram" \ + storage="$storage" \ + os="$os" \ + ) + + 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. |