Records your Ownbox keeps
ava = m.person("email", "ava@example.com", name="Ava Reyes")
m.keep("quote", "q-1001", {"total": 450, "status": "sent"}, person=ava)Your Ownbox keeps the data, never the machine. Each kind of record is declared in machine.yaml under records:, beside actions:, and a record is a JSON object of at most 16 KB under a key of 1 to 100 characters. The same key again replaces it. person names who it is about, only on a kind declared person: true. A machine keeps at most 10,000 records and 20 MB in all; past either the call is refused, and nothing is cut short.
- Needs in machine.yaml
- its kind, declared under records in machine.yaml
- Returns
{"kept": True}.
quote = m.kept("quote", "q-1001")
page = m.kept("quote", limit=20)
while page["next"]:
page = m.kept("quote", limit=20, cursor=page["next"])With a key, that record's fields, or None. Without one, a page of that kind's records, newest first: 50 unless limit says otherwise, and at most 200. Pass next back as cursor for the page after; it is "" at the end.
- Needs in machine.yaml
- its kind, declared under records in machine.yaml
- Returns
- The record's fields, or
{"records": [{"key", "fields", "person", "updated_at"}], "next"}.
m.drop("quote", "q-1001")It is gone from your Ownbox. Dropping a key it never kept is not an error.
- Needs in machine.yaml
- its kind, declared under records in machine.yaml
- Returns
{"dropped": True}, or False when there was none.