diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2024-01-16 17:15:12 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2024-01-16 17:15:12 +0100 |
commit | 1cd168e9491d8405186090fce482a31f907aa7d1 (patch) | |
tree | f4bd228b13ec30b5781ba23b9c98fcf0d64af941 | |
parent | 8551865b4ab342d5f0dfdfafda313b3d8a4d8fa4 (diff) | |
download | automato-1cd168e9491d8405186090fce482a31f907aa7d1.tar.gz |
HttpJsonState + examplesmain
-rw-r--r-- | example/minimal/actions.yml | 8 | ||||
-rw-r--r-- | example/minimal/endpoints.yml | 5 | ||||
-rw-r--r-- | example/minimal/triggers.yml | 2 | ||||
-rw-r--r-- | example/web/actions.yml | 13 | ||||
-rw-r--r-- | example/web/endpoints.yml | 17 | ||||
-rw-r--r-- | example/web/triggers.yml | 2 | ||||
-rw-r--r-- | example/web/webroot/data.json | 7 |
7 files changed, 54 insertions, 0 deletions
diff --git a/example/minimal/actions.yml b/example/minimal/actions.yml new file mode 100644 index 0000000..4d84a39 --- /dev/null +++ b/example/minimal/actions.yml @@ -0,0 +1,8 @@ +--- +example: + trigger: + - conditional: + interval: 10 + when: + - True + then: [] diff --git a/example/minimal/endpoints.yml b/example/minimal/endpoints.yml new file mode 100644 index 0000000..c083b90 --- /dev/null +++ b/example/minimal/endpoints.yml @@ -0,0 +1,5 @@ +host: + info: {} + transports: {} + commands: {} + states: {} diff --git a/example/minimal/triggers.yml b/example/minimal/triggers.yml new file mode 100644 index 0000000..35a4657 --- /dev/null +++ b/example/minimal/triggers.yml @@ -0,0 +1,2 @@ +conditional: + class: automato.trigger.ConditionalTrigger diff --git a/example/web/actions.yml b/example/web/actions.yml new file mode 100644 index 0000000..6c407d5 --- /dev/null +++ b/example/web/actions.yml @@ -0,0 +1,13 @@ +--- +example: + trigger: + - conditional: + interval: 10 + when: + - localhost.jsondata.value1 == 42 + - localhost.jsondata.dict.value3 + then: + - localhost.get: + method: GET + path: / + diff --git a/example/web/endpoints.yml b/example/web/endpoints.yml new file mode 100644 index 0000000..34ebb9d --- /dev/null +++ b/example/web/endpoints.yml @@ -0,0 +1,17 @@ +localhost: + info: {} + transports: + web: + class: automato.transport.http.HttpTransport + address: http://localhost:8000 + commands: + get: + class: automato.command.http.HttpCommand + transport: web + states: + jsondata: + class: automato.state.http.HttpJsonState + transport: web + path: data.json + method: GET + diff --git a/example/web/triggers.yml b/example/web/triggers.yml new file mode 100644 index 0000000..35a4657 --- /dev/null +++ b/example/web/triggers.yml @@ -0,0 +1,2 @@ +conditional: + class: automato.trigger.ConditionalTrigger diff --git a/example/web/webroot/data.json b/example/web/webroot/data.json new file mode 100644 index 0000000..c681424 --- /dev/null +++ b/example/web/webroot/data.json @@ -0,0 +1,7 @@ +{ + "value1": 42, + "dict": { + "value2": "test", + "value3": true + } +} |