diff options
| author | tv <tv@krebsco.de> | 2026-10-24 07:11:29 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-24 07:11:29 +0200 |
| commit | 2a434e9c9e67b81d48a9d55fd8b0be436bf2e649 (patch) | |
| tree | d20607e1a37d032573de24d7895a2efdc7bbd2e5 /src/remake/api.rs | |
| parent | 6aececaf6fa9892bb48bb7b2cee96c8ed73e98e7 (diff) | |
add the import kind of remake
Diffstat (limited to 'src/remake/api.rs')
| -rw-r--r-- | src/remake/api.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/remake/api.rs b/src/remake/api.rs index 988bb34..51cbe07 100644 --- a/src/remake/api.rs +++ b/src/remake/api.rs @@ -24,9 +24,15 @@ //! `?force=true` accepts `settleSecs` below the dormancy threshold and `switchDelaySecs` //! below one keepalive interval: for tests and debugging, not for real swarms. //! -//! `kind` is `compact` (no spec) or `replace`, whose spec is +//! `kind` is `compact` (no spec), `replace`, whose spec is //! `{ "document": {…store root…}, "rules": [{"from": "a", "to": "b"}, {"from": "c", "drop": true}] }` -//! (see `kind::Replace`). Reports leave the replacement document out (`contentBytes`). +//! (see `kind::Replace`), or `import`, whose spec is +//! `{ "document": "<base64 of an Automerge document>", "rules": […] }` (see +//! `kind::Import`; `GET /admin/document` exports one). Reports leave the document out +//! (`contentBytes`). Requests may be up to 64 MiB. +//! +//! Restoring a backup, keeping writes made since at their paths: +//! `base64 -w0 backup.automerge | jq -Rs '{kind: "import", spec: {document: ., rules: [{from: "", to: ""}]}}' | curl --data-binary @- -H 'Content-Type: application/json' …/admin/remakes` use std::time::Duration; |
