List a function's triggers on the branch
Authorization
bearer In: header
Path Parameters
Database id
uuidBranch id
uuidFunction name
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/functions/string/triggers"[ { "bucket": "string", "dead_count": 0, "dropped_count": 0, "enabled": true, "events": [ "string" ], "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "last_delivered_at": "2019-08-24T14:15:22Z", "last_delivery_error": "string", "last_error": "string", "pg_database": "string", "prefix": "string", "schema": "string", "source": "table", "state": "string", "table": "string" }]Set a function's secret on the branch PUT
The function sees it in `env`. A name is a letter or `_`, then up to 127 of A-Z, a-z, 0-9 and `_`; a value is at most 64 KiB, and the function's secrets on the branch at most 128 KiB together. The value is never returned, logged or echoed in an error.
Add a trigger to a function on the branch POST
A `table` trigger is installed in the branch's database by the worker (`pending_install`, then `installed` or `failed`); each committed matching row change is then POSTed to the function's `fetch` handler with header `chelabase-event: db` and body `{id, type, schema, table, record, old_record, txid}` (over 256 KiB: `record` and `old_record` null, `truncated: true` and `primary_key`). Delivery is at least once (dedupe on `id`): a non-2xx answer is retried with backoff, and the 10th failure makes the event dead (`dead_count`). Events queue while the function is disabled; a pending event is never dropped, and dead events past 10,000 per database or 7 days are removed and counted (`dropped_count`). The database's compute stays awake while it has an installed table trigger. A `storage` trigger starts `installed`. A new branch inherits the triggers.