From 0f2c928a2fc9505d1eea19ee184d788b698da9a1 Mon Sep 17 00:00:00 2001 From: Henry Ault Date: Fri, 1 May 2015 12:05:16 -0700 Subject: [PATCH] small update --- main/app/do/core.hook | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/main/app/do/core.hook b/main/app/do/core.hook index 73c726a94..27d8e27d4 100644 --- a/main/app/do/core.hook +++ b/main/app/do/core.hook @@ -53,7 +53,7 @@ $% [%thou p=httr] == == -- !: -|% +|% ::: ++ parse-img => jo %- ot @@ -213,6 +213,7 @@ $% [%thou p=httr] :: ++ poke-json |= [ost=bone you=ship act=json] + ^- [(list move) _+>.$] =+ do=(need ((ot action/so ~):jo act)) ?+ do !! %list @@ -234,26 +235,32 @@ $% [%thou p=httr] [ost %give %nice ~] ~ %reboot + :_ +>.$ =+ id=(need ((ot id/ni ~):jo act)) ~& id - :+ (reboot-droplet ost id) - [%ost %give %nice ~] + ^- (list move) + :+ `move`(reboot-droplet ost id) + [ost %give %nice ~] ~ == -:: + ++ reboot-droplet - |= [ost=bone id=@ud] - =+ ^= reboot - :~ ost /reboot - ~[%digitalocean %api] /v2/droplets/(scot %ud id)/actions - :- %post - (jobe type/s/'reboot' ~) - (mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~) - == - (httpreq reboot) -:: + |= [os=bone id=@ud] + %- httpreq :* + os + /reboot + ~[%digitalocean %api] + =+ path=`path`/v2/droplets/'5073686'/actions + ~& path + path + [%post `json`(jobe type/s/'reboot' ~)] + (mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~) + *quay + == + ++ list-droplets |= os=bone + ~& 'poked' =+ ^= lis :~ os /list ~[%digitalocean %api] /v2/droplets