small update

This commit is contained in:
Henry Ault 2015-05-01 12:05:16 -07:00
parent 460c7e723b
commit 0f2c928a2f

View File

@ -53,7 +53,7 @@ $% [%thou p=httr]
== == == ==
-- --
!: !:
|% |% :::
++ parse-img ++ parse-img
=> jo => jo
%- ot %- ot
@ -213,6 +213,7 @@ $% [%thou p=httr]
:: ::
++ poke-json ++ poke-json
|= [ost=bone you=ship act=json] |= [ost=bone you=ship act=json]
^- [(list move) _+>.$]
=+ do=(need ((ot action/so ~):jo act)) =+ do=(need ((ot action/so ~):jo act))
?+ do !! ?+ do !!
%list %list
@ -234,26 +235,32 @@ $% [%thou p=httr]
[ost %give %nice ~] [ost %give %nice ~]
~ ~
%reboot %reboot
:_ +>.$
=+ id=(need ((ot id/ni ~):jo act)) =+ id=(need ((ot id/ni ~):jo act))
~& id ~& id
:+ (reboot-droplet ost id) ^- (list move)
[%ost %give %nice ~] :+ `move`(reboot-droplet ost id)
[ost %give %nice ~]
~ ~
== ==
::
++ reboot-droplet ++ reboot-droplet
|= [ost=bone id=@ud] |= [os=bone id=@ud]
=+ ^= reboot %- httpreq :*
:~ ost /reboot os
~[%digitalocean %api] /v2/droplets/(scot %ud id)/actions /reboot
:- %post ~[%digitalocean %api]
(jobe type/s/'reboot' ~) =+ path=`path`/v2/droplets/'5073686'/actions
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~) ~& path
== path
(httpreq reboot) [%post `json`(jobe type/s/'reboot' ~)]
:: (mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~)
*quay
==
++ list-droplets ++ list-droplets
|= os=bone |= os=bone
~& 'poked'
=+ ^= lis =+ ^= lis
:~ os /list :~ os /list
~[%digitalocean %api] /v2/droplets ~[%digitalocean %api] /v2/droplets