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§
- Client
Options - Client identity options reported by
kopia repository status. - Content
Format - Content format block from
kopia repository status. - 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
Schedule - The
scheduleblock: when maintenance next runs. The detailed per-taskrunshistory is left as a raw value (its shape is large and unstable). - 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 …).
Functions§
- 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).