Enum google_api_proto::google::cloud::gkebackup::v1::restore_config::NamespacedResourceRestoreMode
source · #[repr(i32)]pub enum NamespacedResourceRestoreMode {
Unspecified = 0,
DeleteAndRestore = 1,
FailOnConflict = 2,
MergeSkipOnConflict = 3,
MergeReplaceVolumeOnConflict = 4,
MergeReplaceOnConflict = 5,
}
Expand description
Defines the behavior for handling the situation where sets of namespaced resources being restored already exist in the target cluster.
Variants§
Unspecified = 0
Unspecified (invalid).
DeleteAndRestore = 1
When conflicting top-level resources (either Namespaces or ProtectedApplications, depending upon the scope) are encountered, this will first trigger a delete of the conflicting resource AND ALL OF ITS REFERENCED RESOURCES (e.g., all resources in the Namespace or all resources referenced by the ProtectedApplication) before restoring the resources from the Backup. This mode should only be used when you are intending to revert some portion of a cluster to an earlier state.
FailOnConflict = 2
If conflicting top-level resources (either Namespaces or ProtectedApplications, depending upon the scope) are encountered at the beginning of a restore process, the Restore will fail. If a conflict occurs during the restore process itself (e.g., because an out of band process creates conflicting resources), a conflict will be reported.
MergeSkipOnConflict = 3
This mode merges the backup and the target cluster and skips the conflicting resources. If a single resource to restore exists in the cluster before restoration, the resource will be skipped, otherwise it will be restored.
MergeReplaceVolumeOnConflict = 4
This mode merges the backup and the target cluster and skips the conflicting resources except volume data. If a PVC to restore already exists, this mode will restore/reconnect the volume without overwriting the PVC. It is similar to MERGE_SKIP_ON_CONFLICT except that it will apply the volume data policy for the conflicting PVCs:
- RESTORE_VOLUME_DATA_FROM_BACKUP: restore data only and respect the reclaim policy of the original PV;
- REUSE_VOLUME_HANDLE_FROM_BACKUP: reconnect and respect the reclaim policy of the original PV;
- NO_VOLUME_DATA_RESTORATION: new provision and respect the reclaim policy of the original PV. Note that this mode could cause data loss as the original PV can be retained or deleted depending on its reclaim policy.
MergeReplaceOnConflict = 5
This mode merges the backup and the target cluster and replaces the conflicting resources with the ones in the backup. If a single resource to restore exists in the cluster before restoration, the resource will be replaced with the one from the backup. To replace an existing resource, the first attempt is to update the resource to match the one from the backup; if the update fails, the second attempt is to delete the resource and restore it from the backup. Note that this mode could cause data loss as it replaces the existing resources in the target cluster, and the original PV can be retained or deleted depending on its reclaim policy.
Implementations§
source§impl NamespacedResourceRestoreMode
impl NamespacedResourceRestoreMode
sourcepub fn is_valid(value: i32) -> bool
pub fn is_valid(value: i32) -> bool
Returns true
if value
is a variant of NamespacedResourceRestoreMode
.
sourcepub fn from_i32(value: i32) -> Option<NamespacedResourceRestoreMode>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<NamespacedResourceRestoreMode>
Converts an i32
to a NamespacedResourceRestoreMode
, or None
if value
is not a valid variant.
source§impl NamespacedResourceRestoreMode
impl NamespacedResourceRestoreMode
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
source§impl Clone for NamespacedResourceRestoreMode
impl Clone for NamespacedResourceRestoreMode
source§fn clone(&self) -> NamespacedResourceRestoreMode
fn clone(&self) -> NamespacedResourceRestoreMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for NamespacedResourceRestoreMode
impl Default for NamespacedResourceRestoreMode
source§fn default() -> NamespacedResourceRestoreMode
fn default() -> NamespacedResourceRestoreMode
source§impl From<NamespacedResourceRestoreMode> for i32
impl From<NamespacedResourceRestoreMode> for i32
source§fn from(value: NamespacedResourceRestoreMode) -> i32
fn from(value: NamespacedResourceRestoreMode) -> i32
source§impl Hash for NamespacedResourceRestoreMode
impl Hash for NamespacedResourceRestoreMode
source§impl Ord for NamespacedResourceRestoreMode
impl Ord for NamespacedResourceRestoreMode
source§fn cmp(&self, other: &NamespacedResourceRestoreMode) -> Ordering
fn cmp(&self, other: &NamespacedResourceRestoreMode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for NamespacedResourceRestoreMode
impl PartialEq for NamespacedResourceRestoreMode
source§fn eq(&self, other: &NamespacedResourceRestoreMode) -> bool
fn eq(&self, other: &NamespacedResourceRestoreMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for NamespacedResourceRestoreMode
impl PartialOrd for NamespacedResourceRestoreMode
source§fn partial_cmp(&self, other: &NamespacedResourceRestoreMode) -> Option<Ordering>
fn partial_cmp(&self, other: &NamespacedResourceRestoreMode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<i32> for NamespacedResourceRestoreMode
impl TryFrom<i32> for NamespacedResourceRestoreMode
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
source§fn try_from(
value: i32,
) -> Result<NamespacedResourceRestoreMode, UnknownEnumValue>
fn try_from( value: i32, ) -> Result<NamespacedResourceRestoreMode, UnknownEnumValue>
impl Copy for NamespacedResourceRestoreMode
impl Eq for NamespacedResourceRestoreMode
impl StructuralPartialEq for NamespacedResourceRestoreMode
Auto Trait Implementations§
impl Freeze for NamespacedResourceRestoreMode
impl RefUnwindSafe for NamespacedResourceRestoreMode
impl Send for NamespacedResourceRestoreMode
impl Sync for NamespacedResourceRestoreMode
impl Unpin for NamespacedResourceRestoreMode
impl UnwindSafe for NamespacedResourceRestoreMode
Blanket Implementations§
source§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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request