pub struct SnapshotPolicySpec {Show 23 fields
pub repository: Option<RepositoryRef>,
pub repositories: Vec<RepositoryRef>,
pub identity: Option<Identity>,
pub sources: Vec<Source>,
pub copy_method: CopyMethod,
pub volume_snapshot_class_name: Option<String>,
pub staging: Option<StagingSpec>,
pub group_by: Option<GroupBy>,
pub retention: Option<Retention>,
pub default_deletion_policy: Option<DeletionPolicy>,
pub compression: Option<Compression>,
pub files: Option<Files>,
pub extra_args: Vec<String>,
pub error_handling: Option<ErrorHandling>,
pub upload: Option<Upload>,
pub verification: Option<Verification>,
pub preflight: Option<PreflightSpec>,
pub suspend: bool,
pub hooks: Option<Hooks>,
pub mover: Option<MoverSpec>,
pub credential_projection: Option<CredentialProjection>,
pub deletion: Option<PolicyDeletionSpec>,
pub adoption: Option<SnapshotAdoption>,
}Expand description
What to back up: sources, identity, retention, policy, hooks.
Fields§
§repository: Option<RepositoryRef>Discriminated reference to a Repository or ClusterRepository.
Mutually exclusive with repositories (exactly one of the two is set).
repositories: Vec<RepositoryRef>Multi-repository fan-out: every listed Repository/ClusterRepository
receives its own independent backup of each source — one Snapshot CR +
one mover Job per (source, repository) pair, so the captures are separate
kopia snapshots, not copies of one another. Identity resolves per-repo
under that repository’s identityDefaults. Mutually exclusive with
repository (exactly one of the two is set) AND with hooks: with N
concurrent children the first finisher would run the thaw hook while the
other N-1 movers still read — use a single-repo policy plus a
SnapshotReplication when hooks are needed for a second target.
identity: Option<Identity>Identity overrides — what kopia records as username@hostname:path.
sources: Vec<Source>What to back up (at least one source; webhook-enforced).
copy_method: CopyMethodHow the source volume is captured before kopia reads it: Snapshot (default), Direct, or Clone.
volume_snapshot_class_name: Option<String>VolumeSnapshotClass used when copyMethod snapshots/clones the source. Absent or
empty both mean auto-select the default class for the source PVC’s CSI driver, so a
GitOps-templated value (Flux/Kustomize ${VAR}) is safe when the variable is unset.
staging: Option<StagingSpec>Staging knobs for copyMethod: Snapshot/Clone (e.g. how long to wait for
the CSI capture to become ready before failing the backup).
group_by: Option<GroupBy>Multi-PVC consistency grouping; None opts into independent per-PVC snapshots.
retention: Option<Retention>GFS retention, enforced by the operator pruning Snapshot CRs.
default_deletion_policy: Option<DeletionPolicy>Default deletionPolicy for Snapshot CRs created against this config.
compression: Option<Compression>Compression algorithm + per-extension opt-outs.
files: Option<Files>Paths/patterns kopia should skip while snapshotting.
extra_args: Vec<String>Escape hatch for kopia flags not yet modeled.
error_handling: Option<ErrorHandling>Backup-side error handling: let a snapshot complete-with-errors instead of failing outright.
upload: Option<Upload>Upload parallelism (kopia’s --max-parallel-snapshots / --max-parallel-file-reads).
verification: Option<Verification>First-class backup verification; opt-in (absent ⇒ no verification runs).
preflight: Option<PreflightSpec>Named CEL preconditions evaluated before each backup run; opt-in (absent ⇒
no preflight). A failing check holds the Snapshot in Pending
(PreflightFailed) and, after timeout, fails it.
suspend: boolPause this recipe declaratively (schedules and reconcile skip a suspended policy).
hooks: Option<Hooks>Pre/post snapshot hooks that run in the workload, not the mover.
mover: Option<MoverSpec>Per-recipe mover overrides (resources, cache, security context).
credential_projection: Option<CredentialProjection>Opt-in credential-Secret projection into each backup mover’s namespace (default off).
deletion: Option<PolicyDeletionSpec>Deletion semantics for the Snapshot CRs carrying this recipe’s config label.
adoption: Option<SnapshotAdoption>Per-policy override of automatic adoption for discovered snapshots whose
resolved identity matches this recipe; absent inherits the repository’s
catalog.adoption (see effective_adoption).
Trait Implementations§
Source§impl Clone for SnapshotPolicySpec
impl Clone for SnapshotPolicySpec
Source§fn clone(&self) -> SnapshotPolicySpec
fn clone(&self) -> SnapshotPolicySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SnapshotPolicySpec
impl Debug for SnapshotPolicySpec
Source§impl<'de> Deserialize<'de> for SnapshotPolicySpec
impl<'de> Deserialize<'de> for SnapshotPolicySpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SnapshotPolicySpec
impl JsonSchema for SnapshotPolicySpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for SnapshotPolicySpec
impl PartialEq for SnapshotPolicySpec
Source§fn eq(&self, other: &SnapshotPolicySpec) -> bool
fn eq(&self, other: &SnapshotPolicySpec) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SnapshotPolicySpec
impl Serialize for SnapshotPolicySpec
impl StructuralPartialEq for SnapshotPolicySpec
Auto Trait Implementations§
impl Freeze for SnapshotPolicySpec
impl RefUnwindSafe for SnapshotPolicySpec
impl Send for SnapshotPolicySpec
impl Sync for SnapshotPolicySpec
impl Unpin for SnapshotPolicySpec
impl UnsafeUnpin for SnapshotPolicySpec
impl UnwindSafe for SnapshotPolicySpec
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more