2020-04-23 23:53:00 +03:00
|
|
|
/- *s3
|
2020-04-24 02:33:55 +03:00
|
|
|
/+ s3-json, default-agent, verb, dbug
|
2020-04-23 23:53:00 +03:00
|
|
|
~% %s3-top ..is ~
|
|
|
|
|%
|
|
|
|
+$ card card:agent:gall
|
|
|
|
+$ versioned-state
|
|
|
|
$% state-zero
|
|
|
|
==
|
|
|
|
::
|
2020-04-24 02:33:55 +03:00
|
|
|
+$ state-zero [%0 =credentials =configuration]
|
2020-04-23 23:53:00 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
=| state-zero
|
|
|
|
=* state -
|
|
|
|
::
|
|
|
|
%- agent:dbug
|
|
|
|
%+ verb |
|
|
|
|
^- agent:gall
|
|
|
|
~% %s3-agent-core ..card ~
|
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
::
|
|
|
|
++ on-init on-init:def
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= old-vase=vase
|
|
|
|
[~ this(state !<(state-zero old-vase))]
|
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
~/ %s3-poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
^- (quip card _this)
|
|
|
|
|^
|
|
|
|
?> (team:title our.bowl src.bowl)
|
|
|
|
=^ cards state
|
|
|
|
?+ mark (on-poke:def mark vase)
|
|
|
|
%s3-action (poke-action !<(action vase))
|
|
|
|
==
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ poke-action
|
|
|
|
|= act=action
|
|
|
|
^- (quip card _state)
|
2020-04-24 00:30:59 +03:00
|
|
|
:- [%give %fact [/all]~ %s3-update !>(act)]~
|
|
|
|
?- -.act
|
|
|
|
%set-endpoint
|
|
|
|
state(endpoint.credentials endpoint.act)
|
|
|
|
::
|
|
|
|
%set-access-key-id
|
|
|
|
state(access-key-id.credentials access-key-id.act)
|
|
|
|
::
|
|
|
|
%set-secret-access-key
|
|
|
|
state(secret-access-key.credentials secret-access-key.act)
|
2020-04-24 02:33:55 +03:00
|
|
|
::
|
|
|
|
%set-current-bucket
|
|
|
|
%_ state
|
|
|
|
current-bucket.configuration bucket.act
|
|
|
|
buckets.configuration (~(put in buckets.configuration) bucket.act)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%add-bucket
|
|
|
|
state(buckets.configuration (~(put in buckets.configuration) bucket.act))
|
|
|
|
::
|
|
|
|
%remove-bucket
|
|
|
|
state(buckets.configuration (~(del in buckets.configuration) bucket.act))
|
2020-04-24 00:30:59 +03:00
|
|
|
==
|
2020-04-23 23:53:00 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ on-watch
|
|
|
|
~/ %s3-watch
|
|
|
|
|= =path
|
|
|
|
^- (quip card _this)
|
|
|
|
|^
|
|
|
|
?> (team:title our.bowl src.bowl)
|
|
|
|
=/ cards=(list card)
|
2020-04-24 02:33:55 +03:00
|
|
|
?+ path (on-watch:def path)
|
|
|
|
[%all ~]
|
|
|
|
:~ (give %s3-update !>([%credentials credentials]))
|
|
|
|
(give %s3-update !>([%configuration configuration]))
|
|
|
|
==
|
2020-04-23 23:53:00 +03:00
|
|
|
==
|
|
|
|
[cards this]
|
|
|
|
::
|
|
|
|
++ give
|
|
|
|
|= =cage
|
2020-04-24 02:33:55 +03:00
|
|
|
^- card
|
|
|
|
[%give %fact ~ cage]
|
2020-04-23 23:53:00 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ on-leave on-leave:def
|
2020-08-14 21:36:29 +03:00
|
|
|
++ on-peek
|
|
|
|
~/ %s3-peek
|
|
|
|
|= =path
|
|
|
|
^- (unit (unit cage))
|
2020-08-19 03:25:35 +03:00
|
|
|
?. (team:title our.bowl src.bowl) ~
|
|
|
|
?+ path [~ ~]
|
2020-08-14 21:36:29 +03:00
|
|
|
[%x %credentials ~]
|
2020-08-17 22:57:46 +03:00
|
|
|
[~ ~ %s3-update !>(`update`[%credentials credentials])]
|
2020-08-19 03:25:35 +03:00
|
|
|
::
|
2020-08-14 21:36:29 +03:00
|
|
|
[%x %configuration ~]
|
2020-08-17 22:57:46 +03:00
|
|
|
[~ ~ %s3-update !>(`update`[%configuration configuration])]
|
2020-08-14 21:36:29 +03:00
|
|
|
==
|
2020-04-23 23:53:00 +03:00
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-arvo on-arvo:def
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
--
|