Expand description
Typed models for kopia --json output (kopia 0.23).
These structs are modeled against the actual JSON kopia emits, captured by
round-tripping a filesystem repository. Field names match kopia’s keys
exactly via #[serde(rename_all = "camelCase")] (plus explicit renames
where kopia diverges, e.g. uniqueIDHex). None of these use
deny_unknown_fields: kopia adds fields across releases and we must tolerate
them. Times are chrono::DateTime<Utc>.
Note on stdout vs stderr: kopia prints its progress (Snapshotting ...,
Restored N files) to stderr and the machine-readable --json result
to stdout. The client parses stdout only.
Structs§
- Blob
Retention - Blob retention as reported by
kopia repository status --json→blobRetention. - Cleanup
Logs Stats cleanupLogsStats— thecleanup-logsresult. Repository log blobs are real blobs, sodeletedBlobSizeis freed storage as well (a small figure, but a true one).- Cleanup
Superseded Indexes Stats cleanupSupersededIndexesStats— thedelete-superseded-epoch-indexesresult. Real blob deletes, so itsdeletedTotalSizeis freed storage too.- Client
Options - Client identity options reported by
kopia repository status. - Content
Format - Content format block from
kopia repository status. - Delete
Unreferenced Packs Stats deleteUnreferencedPacksStats— thequick-delete-blobs/full-delete-blobsresult. This is where reclaimed storage is reported: the task issues real blob deletes against the backend.- DirEntry
- One entry of a kopia directory manifest (
kopia show <dir-object-id>). - DirManifest
- A kopia directory manifest: what
kopia show <dir-object-id>emits —{"stream":"kopia:directory","entries":[…]}. (kopia showon a file object streams the file’s raw bytes instead, so callers must checkDirEntry::entry_typebefore showing an object as a directory.) - DirSummary
- Directory summary embedded under a root entry (
summ). Carries the aggregate counts kopia computed while walking the tree. - DirSummary
Lite - The aggregate subtree counters under a directory entry’s
summblock — the subset ofDirSummarya directory listing renders. All optional: kopia may extend or omit counters across releases. - Entry
Error - One
{path, error}entry from a snapshot’srootEntry.summ.errors. Kopia records the source-relative path and the full error string for every entry it could not include. - Epoch
Parameters - kopia’s epoch-manager parameters, as reported inside
repository status --json→contentFormat.epochParameters. - Index
Blob Entry - One entry from
kopia index list --json— a single content-index blob. - Maintenance
Cadence - A maintenance cadence block (
quick/full) frommaintenance info. - Maintenance
Info - Result of
kopia maintenance info --json. - Maintenance
Run - One entry in a per-task maintenance run history (
schedule.runs[task][]). - Maintenance
RunExtra - One statistics block on a
MaintenanceRun— kopia’smaintenancestats.Extra, which is{Kind string; Data json.RawMessage}. - Maintenance
Schedule - The
scheduleblock: when maintenance next runs, plus the per-task run history kopia keeps in the same blob. - Repository
Status - Result of
kopia repository status --json. - Root
Entry - The
rootEntryof a snapshot — the top directory object plus its summary. - Snapshot
Create Result - Result of
kopia snapshot create <path> --json. - Snapshot
List Entry - One entry from
kopia snapshot list --json. - Snapshot
Source - Kopia’s snapshot identity triple:
userName@host:path. Present on both snapshot-create results and snapshot-list entries. - Snapshot
Stats - The
statsblock present on eachkopia snapshot list --jsonentry. These are the new/modified/unchanged-style counters. - Storage
Info - Storage backend block from
kopia repository status.configis left as a raw JSON value because its shape is backend-specific (filesystem path vs S3 bucket/endpoint vs …).
Enums§
- Snapshot
Create Outcome - What a
kopia snapshot createactually did.
Constants§
- KIND_
CLEANUP_ LOGS_ STATS extra[].kindforCleanupLogsStats.- KIND_
CLEANUP_ SUPERSEDED_ INDEXES_ STATS extra[].kindforCleanupSupersededIndexesStats.- TASK_
CLEANUP_ LOGS - kopia maintenance task: expire old repository log blobs per
logRetention. - TASK_
DELETE_ SUPERSEDED_ EPOCH_ INDEXES - kopia maintenance task: drop index blobs superseded by epoch compaction.
- TASK_
DELETE_ UNREFERENCED_ PACKS_ STATS extra[].kindforDeleteUnreferencedPacksStats.- TASK_
FULL_ DELETE_ BLOBS - kopia maintenance task: the
TASK_QUICK_DELETE_BLOBStwin in a full run. - TASK_
QUICK_ DELETE_ BLOBS - kopia maintenance task: delete blobs no index references, in a quick run.
The
deletedTotalSizeitsTASK_DELETE_UNREFERENCED_PACKS_STATSextra reports is storage actually freed from the backend.
Functions§
- partition_
incomplete - Split a raw
snapshot list --jsonresult into(complete, incomplete), preserving order. SeeSnapshotListEntry::incomplete_reason. - reclaimed_
bytes_ since - Bytes of backend storage actually freed by the maintenance run that
happened between two
kopia maintenance infoobservations. - user_
tags - Strip kopia’s
tag:manifest-key prefix from a snapshottagsmap, yielding the tags under the keys the CLI was given (--tags key:value→ manifesttag:key).