Class: Google::Cloud::GkeBackup::V1::RestoreConfig

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/gkebackup/v1/restore.rb

Overview

Configuration of a restore. Next id: 9

Defined Under Namespace

Modules: ClusterResourceConflictPolicy, NamespacedResourceRestoreMode, VolumeDataRestorePolicy Classes: ClusterResourceRestoreScope, GroupKind, SubstitutionRule

Instance Attribute Summary collapse

Instance Attribute Details

#all_namespaces::Boolean

Returns Restore all namespaced resources in the Backup if set to "True". Specifying this field to "False" is an error.

Returns:

  • (::Boolean)

    Restore all namespaced resources in the Backup if set to "True". Specifying this field to "False" is an error.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#cluster_resource_conflict_policy::Google::Cloud::GkeBackup::V1::RestoreConfig::ClusterResourceConflictPolicy

Returns Defines the behavior for handling the situation where cluster-scoped resources being restored already exist in the target cluster. This MUST be set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if cluster_resource_restore_scope is not empty.

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#cluster_resource_restore_scope::Google::Cloud::GkeBackup::V1::RestoreConfig::ClusterResourceRestoreScope

Returns Identifies the cluster-scoped resources to restore from the Backup. Not specifying it means NO cluster resource will be restored.

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#namespaced_resource_restore_mode::Google::Cloud::GkeBackup::V1::RestoreConfig::NamespacedResourceRestoreMode

Returns Defines the behavior for handling the situation where sets of namespaced resources being restored already exist in the target cluster. This MUST be set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#selected_applications::Google::Cloud::GkeBackup::V1::NamespacedNames

Returns A list of selected ProtectedApplications to restore. The listed ProtectedApplications and all the resources to which they refer will be restored.

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#selected_namespaces::Google::Cloud::GkeBackup::V1::Namespaces

Returns A list of selected Namespaces to restore from the Backup. The listed Namespaces and all resources contained in them will be restored.

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#substitution_rules::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::SubstitutionRule>

Returns A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no substitution will occur.

Returns:

  • (::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::SubstitutionRule>)

    A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no substitution will occur.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end

#volume_data_restore_policy::Google::Cloud::GkeBackup::V1::RestoreConfig::VolumeDataRestorePolicy

Returns Specifies the mechanism to be used to restore volume data. Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as NO_VOLUME_DATA_RESTORATION).

Returns:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'proto_docs/google/cloud/gkebackup/v1/restore.rb', line 179

class RestoreConfig
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # This is a direct map to the Kubernetes GroupKind type
  # [GroupKind](https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind)
  # and is used for identifying specific "types" of resources to restore.
  # @!attribute [rw] resource_group
  #   @return [::String]
  #     API group string of a Kubernetes resource, e.g.
  #     "apiextensions.k8s.io", "storage.k8s.io", etc.
  #     Note: use empty string for core API group
  # @!attribute [rw] resource_kind
  #   @return [::String]
  #     Kind of a Kubernetes resource, e.g.
  #     "CustomResourceDefinition", "StorageClass", etc.
  class GroupKind
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Identifies the cluster-scoped resources to restore from the Backup.
  # @!attribute [rw] selected_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     A list of "types" of cluster-scoped resources to be restored from the
  #     Backup.  An empty list means that NO cluster-scoped resources will be
  #     restored. Note that Namespaces and PersistentVolume restoration is
  #     handled separately and is not governed by this field.
  class ClusterResourceRestoreScope
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A transformation rule to be applied against Kubernetes resources as they
  # are selected for restoration from a Backup. A rule contains both filtering
  # logic (which resources are subject to substitution) and substitution logic.
  # @!attribute [rw] target_namespaces
  #   @return [::Array<::String>]
  #     (Filtering parameter) Any resource subject to substitution must be
  #     contained within one of the listed Kubernetes Namespace in the Backup.
  #     If this field is not provided, no namespace filtering will be performed
  #     (all resources in all Namespaces, including all cluster-scoped resources,
  #     will be candidates for substitution).
  #     To mix cluster-scoped and namespaced resources in the same rule, use an
  #     empty string ("") as one of the target namespaces.
  # @!attribute [rw] target_group_kinds
  #   @return [::Array<::Google::Cloud::GkeBackup::V1::RestoreConfig::GroupKind>]
  #     (Filtering parameter) Any resource subject to substitution must belong to
  #     one of the listed "types".
  #     If this field is not provided, no type filtering will be performed (all
  #     resources of all types matching previous filtering parameters will be
  #     candidates for substitution).
  # @!attribute [rw] target_json_path
  #   @return [::String]
  #     Required. This is a [JSONPath]
  #     (https://kubernetes.io/docs/reference/kubectl/jsonpath/)
  #     expression that matches specific fields of candidate
  #     resources and it operates as both a filtering parameter (resources that
  #     are not matched with this expression will not be candidates for
  #     substitution) as well as a field identifier (identifies exactly which
  #     fields out of the candidate resources will be modified).
  # @!attribute [rw] original_value_pattern
  #   @return [::String]
  #     (Filtering parameter) This is a [regular expression]
  #     (https://en.wikipedia.org/wiki/Regular_expression)
  #     that is compared against the fields matched by the target_json_path
  #     expression (and must also have passed the previous filters).
  #     Substitution will not be performed against fields whose
  #     value does not match this expression. If this field is NOT specified,
  #     then ALL fields matched by the target_json_path expression will undergo
  #     substitution. Note that an empty (e.g., "", rather than unspecified)
  #     value for for this field will only match empty fields.
  # @!attribute [rw] new_value
  #   @return [::String]
  #     This is the new value to set for any fields that pass the filtering and
  #     selection criteria. To remove a value from a Kubernetes resource, either
  #     leave this field unspecified, or set it to the empty string ("").
  class SubstitutionRule
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Defines how volume data should be restored
  module VolumeDataRestorePolicy
    # Unspecified (illegal).
    VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED = 0

    # For each PVC to be restored, will create a new underlying volume (and PV)
    # from the corresponding VolumeBackup contained within the Backup.
    RESTORE_VOLUME_DATA_FROM_BACKUP = 1

    # For each PVC to be restored, attempt to reuse the original PV contained
    # in the Backup (with its original underlying volume).  Note that option
    # is likely only usable when restoring a workload to its original cluster.
    REUSE_VOLUME_HANDLE_FROM_BACKUP = 2

    # For each PVC to be restored, PVCs will be created without any particular
    # action to restore data.  In this case, the normal Kubernetes provisioning
    # logic would kick in, and this would likely result in either dynamically
    # provisioning blank PVs or binding to statically provisioned PVs.
    NO_VOLUME_DATA_RESTORATION = 3
  end

  # Defines the behavior for handling the situation where cluster-scoped
  # resources being restored already exist in the target cluster.
  module ClusterResourceConflictPolicy
    # Unspecified. Only allowed if no cluster-scoped resources will be
    # restored.
    CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED = 0

    # Do not attempt to restore the conflicting resource.
    USE_EXISTING_VERSION = 1

    # Delete the existing version before re-creating it from the Backup.
    # Note that this is a dangerous option which could cause unintentional
    # data loss if used inappropriately - for example, deleting a CRD will
    # cause Kubernetes to delete all CRs of that type.
    USE_BACKUP_VERSION = 2
  end

  # Defines the behavior for handling the situation where sets of namespaced
  # resources being restored already exist in the target cluster.
  module NamespacedResourceRestoreMode
    # Unspecified (invalid).
    NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED = 0

    # 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.
    DELETE_AND_RESTORE = 1

    # 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.
    FAIL_ON_CONFLICT = 2
  end
end