Actions¶
An action module executes actions and answers three questions over HTTP with signed requests:
| Method and path | Purpose |
|---|---|
POST /v1/verify |
Would this action be valid? Returns approve and reason |
POST /v1/execute |
Execute it. Returns the output |
GET /v1/check/{task} |
Was it executed, and with what? |
A call contains the task, scope, epoch, sequence, term, action and input.
Included actions¶
| Action | Input |
|---|---|
kv.put |
key (at most 256 characters), value |
kv.delete |
key |
Write your own module¶
Set ACTION_MODULE_URL of controllers and auditors. ACTIONS lists what a controller may perform, and CAPABILITIES what it registers. A module must
- check on the ledger that the caller leads the named epoch and term,
- store the newest sequence and term for each scope, and refuse older ones,
- store the execution with its effect in one transaction, and return the stored output if the task is repeated,
- answer
checkfrom that record.
Answer 422 if the action is invalid, and 409 if the caller has no lease.