Skip to main content

Module model

Module model 

Source
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§

BlobRetention
Blob retention as reported by kopia repository status --json → blobRetention.
CleanupLogsStats
cleanupLogsStats — the cleanup-logs result. Repository log blobs are real blobs, so deletedBlobSize is freed storage as well (a small figure, but a true one).
CleanupSupersededIndexesStats
cleanupSupersededIndexesStats — the delete-superseded-epoch-indexes result. Real blob deletes, so its deletedTotalSize is freed storage too.
ClientOptions
Client identity options reported by kopia repository status.
ContentFormat
Content format block from kopia repository status.
DeleteUnreferencedPacksStats
deleteUnreferencedPacksStats — the quick-delete-blobs / full-delete-blobs result. 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 show on a file object streams the file’s raw bytes instead, so callers must check DirEntry::entry_type before 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.
DirSummaryLite
The aggregate subtree counters under a directory entry’s summ block — the subset of DirSummary a directory listing renders. All optional: kopia may extend or omit counters across releases.
EntryError
One {path, error} entry from a snapshot’s rootEntry.summ.errors. Kopia records the source-relative path and the full error string for every entry it could not include.
EpochParameters
kopia’s epoch-manager parameters, as reported inside repository status --json → contentFormat.epochParameters.
IndexBlobEntry
One entry from kopia index list --json — a single content-index blob.
MaintenanceCadence
A maintenance cadence block (quick / full) from maintenance info.
MaintenanceInfo
Result of kopia maintenance info --json.
MaintenanceRun
One entry in a per-task maintenance run history (schedule.runs[task][]).
MaintenanceRunExtra
One statistics block on a MaintenanceRun — kopia’s maintenancestats.Extra, which is {Kind string; Data json.RawMessage}.
MaintenanceSchedule
The schedule block: when maintenance next runs, plus the per-task run history kopia keeps in the same blob.
RepositoryStatus
Result of kopia repository status --json.
RootEntry
The rootEntry of a snapshot — the top directory object plus its summary.
SnapshotCreateResult
Result of kopia snapshot create <path> --json.
SnapshotListEntry
One entry from kopia snapshot list --json.
SnapshotSource
Kopia’s snapshot identity triple: userName@host:path. Present on both snapshot-create results and snapshot-list entries.
SnapshotStats
The stats block present on each kopia snapshot list --json entry. These are the new/modified/unchanged-style counters.
StorageInfo
Storage backend block from kopia repository status. config is left as a raw JSON value because its shape is backend-specific (filesystem path vs S3 bucket/endpoint vs …).

Enums§

SnapshotCreateOutcome
What a kopia snapshot create actually did.

Constants§

KIND_CLEANUP_LOGS_STATS
extra[].kind for CleanupLogsStats.
KIND_CLEANUP_SUPERSEDED_INDEXES_STATS
extra[].kind for CleanupSupersededIndexesStats.
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[].kind for DeleteUnreferencedPacksStats.
TASK_FULL_DELETE_BLOBS
kopia maintenance task: the TASK_QUICK_DELETE_BLOBS twin in a full run.
TASK_QUICK_DELETE_BLOBS
kopia maintenance task: delete blobs no index references, in a quick run. The deletedTotalSize its TASK_DELETE_UNREFERENCED_PACKS_STATS extra reports is storage actually freed from the backend.

Functions§

partition_incomplete
Split a raw snapshot list --json result into (complete, incomplete), preserving order. See SnapshotListEntry::incomplete_reason.
reclaimed_bytes_since
Bytes of backend storage actually freed by the maintenance run that happened between two kopia maintenance info observations.
user_tags
Strip kopia’s tag: manifest-key prefix from a snapshot tags map, yielding the tags under the keys the CLI was given (--tags key:value → manifest tag:key).