# Backup for GKE V1 API - Class Google::Cloud::GkeBackup::V1::Backup (v1.8.0)

1.8.0 (latest) 1.7.1 1.6.0 1.5.1 1.4.0 1.3.0 1.2.0 1.1.1 1.0.0 0.12.0 0.11.0 0.10.1 0.9.0 0.8.0 0.7.2 0.6.0 0.5.1 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Backup for GKE V1 API class Google::Cloud::GkeBackup::V1::Backup.

Represents a request to perform a single point-in-time capture of
some portion of the state of a GKE cluster, the record of the backup
operation itself, and an anchor for the underlying artifacts that
comprise the Backup (the config backup and VolumeBackups).

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #all_namespaces

    def all_namespaces() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. If True, all namespaces were included in the Backup.

  Note: The following fields are mutually exclusive: `all_namespaces`, `selected_namespaces`, `selected_applications`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #cluster_metadata

    def cluster_metadata() -> ::Google::Cloud::GkeBackup::V1::Backup::ClusterMetadata

**Returns**

- ([::Google::Cloud::GkeBackup::V1::Backup::ClusterMetadata](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup-ClusterMetadata)) --- Output only. Information about the GKE cluster from which this Backup was created.

### #complete_time

    def complete_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Protobuf-Timestamp)) --- Output only. Completion time of the Backup

### #config_backup_size_bytes

    def config_backup_size_bytes() -> ::Integer

**Returns**

- (::Integer) --- Output only. The size of the config backup in bytes.

### #contains_secrets

    def contains_secrets() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. Whether or not the Backup contains Kubernetes Secrets. Controlled by the parent BackupPlan's [include_secrets](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-BackupConfig#Google__Cloud__GkeBackup__V1__BackupPlan__BackupConfig_include_secrets_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::BackupConfig#include_secrets (method)") value.

### #contains_volume_data

    def contains_volume_data() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. Whether or not the Backup contains volume data. Controlled by the parent BackupPlan's [include_volume_data](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-BackupConfig#Google__Cloud__GkeBackup__V1__BackupPlan__BackupConfig_include_volume_data_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::BackupConfig#include_volume_data (method)") value.

### #create_time

    def create_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The timestamp when this Backup resource was created.

### #delete_lock_days

    def delete_lock_days() -> ::Integer

**Returns**

- (::Integer) --- Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be "locked" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive).

  Defaults to parent BackupPlan's
  [backup_delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_delete_lock_days (method)")
  setting and may only be increased
  (either at creation time or in a subsequent update).

### #delete_lock_days=

    def delete_lock_days=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be "locked" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive).


  Defaults to parent BackupPlan's
  [backup_delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_delete_lock_days (method)")
  setting and may only be increased
  (either at creation time or in a subsequent update).
**Returns**

- (::Integer) --- Optional. Minimum age for this Backup (in days). If this field is set to a non-zero value, the Backup will be "locked" against deletion (either manual or automatic deletion) for the number of days provided (measured from the creation time of the Backup). MUST be an integer value between 0-90 (inclusive).

  Defaults to parent BackupPlan's
  [backup_delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_delete_lock_days (method)")
  setting and may only be increased
  (either at creation time or in a subsequent update).

### #delete_lock_expire_time

    def delete_lock_expire_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time at which an existing delete lock will expire for this backup (calculated from create_time + [delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup#Google__Cloud__GkeBackup__V1__Backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::Backup#delete_lock_days (method)")).

### #description

    def description() -> ::String

**Returns**

- (::String) --- Optional. User specified descriptive string for this Backup.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. User specified descriptive string for this Backup.
**Returns**

- (::String) --- Optional. User specified descriptive string for this Backup.

### #encryption_key

    def encryption_key() -> ::Google::Cloud::GkeBackup::V1::EncryptionKey

**Returns**

- ([::Google::Cloud::GkeBackup::V1::EncryptionKey](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-EncryptionKey)) --- Output only. The customer managed encryption key that was used to encrypt the Backup's artifacts. Inherited from the parent BackupPlan's [encryption_key](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-BackupConfig#Google__Cloud__GkeBackup__V1__BackupPlan__BackupConfig_encryption_key_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::BackupConfig#encryption_key (method)") value.

### #etag

    def etag() -> ::String

**Returns**

- (::String) --- Output only. `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a backup from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform backup updates in order to avoid race conditions: An `etag` is returned in the response to `GetBackup`, and systems are expected to put that etag in the request to `UpdateBackup` or `DeleteBackup` to ensure that their change will be applied to the same version of the resource.

### #labels

    def labels() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. A set of custom labels supplied by user.

### #labels=

    def labels=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. A set of custom labels supplied by user.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Optional. A set of custom labels supplied by user.

### #manual

    def manual() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. This flag indicates whether this Backup resource was created manually by a user or via a schedule in the BackupPlan. A value of True means that the Backup was created manually.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Output only. The fully qualified name of the Backup. `projects/*/locations/*/backupPlans/*/backups/*`

### #permissive_mode

    def permissive_mode() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. If false, Backup will fail when Backup for GKE detects Kubernetes configuration that is non-standard or requires additional setup to restore.

  Inherited from the parent BackupPlan's
  [permissive_mode](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-BackupConfig#Google__Cloud__GkeBackup__V1__BackupPlan__BackupConfig_permissive_mode_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::BackupConfig#permissive_mode (method)")
  value.

### #pod_count

    def pod_count() -> ::Integer

**Returns**

- (::Integer) --- Output only. The total number of Kubernetes Pods contained in the Backup.

### #resource_count

    def resource_count() -> ::Integer

**Returns**

- (::Integer) --- Output only. The total number of Kubernetes resources included in the Backup.

### #retain_days

    def retain_days() -> ::Integer

**Returns**

- (::Integer) --- Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value \>= 0:

  - If 0, no automatic deletion will occur for this Backup.
  - If not 0, this must be \>= [delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup#Google__Cloud__GkeBackup__V1__Backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::Backup#delete_lock_days (method)") and \<= 365.

  Once a Backup is created, this value may only be increased.

  Defaults to the parent BackupPlan's
  [backup_retain_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_retain_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_retain_days (method)")
  value.

### #retain_days=

    def retain_days=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value \>= 0:


  - If 0, no automatic deletion will occur for this Backup.
  - If not 0, this must be \>= [delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup#Google__Cloud__GkeBackup__V1__Backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::Backup#delete_lock_days (method)") and \<= 365.

  Once a Backup is created, this value may only be increased.

  Defaults to the parent BackupPlan's
  [backup_retain_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_retain_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_retain_days (method)")
  value.
**Returns**

- (::Integer) --- Optional. The age (in days) after which this Backup will be automatically deleted. Must be an integer value \>= 0:

  - If 0, no automatic deletion will occur for this Backup.
  - If not 0, this must be \>= [delete_lock_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup#Google__Cloud__GkeBackup__V1__Backup_delete_lock_days_instance_ "Google::Cloud::GkeBackup::V1::Backup#delete_lock_days (method)") and \<= 365.

  Once a Backup is created, this value may only be increased.

  Defaults to the parent BackupPlan's
  [backup_retain_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-BackupPlan-RetentionPolicy#Google__Cloud__GkeBackup__V1__BackupPlan__RetentionPolicy_backup_retain_days_instance_ "Google::Cloud::GkeBackup::V1::BackupPlan::RetentionPolicy#backup_retain_days (method)")
  value.

### #retain_expire_time

    def retain_expire_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The time at which this Backup will be automatically deleted (calculated from create_time + [retain_days](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup#Google__Cloud__GkeBackup__V1__Backup_retain_days_instance_ "Google::Cloud::GkeBackup::V1::Backup#retain_days (method)")).

### #satisfies_pzi

    def satisfies_pzi() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. \[Output Only\] Reserved for future use.

### #satisfies_pzs

    def satisfies_pzs() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. \[Output Only\] Reserved for future use.

### #selected_applications

    def selected_applications() -> ::Google::Cloud::GkeBackup::V1::NamespacedNames

**Returns**

- ([::Google::Cloud::GkeBackup::V1::NamespacedNames](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-NamespacedNames)) --- Output only. If set, the list of ProtectedApplications whose resources were included in the Backup.


  Note: The following fields are mutually exclusive: `selected_applications`, `all_namespaces`, `selected_namespaces`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #selected_namespaces

    def selected_namespaces() -> ::Google::Cloud::GkeBackup::V1::Namespaces

**Returns**

- ([::Google::Cloud::GkeBackup::V1::Namespaces](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Namespaces)) --- Output only. If set, the list of namespaces that were included in the Backup.


  Note: The following fields are mutually exclusive: `selected_namespaces`, `all_namespaces`, `selected_applications`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #size_bytes

    def size_bytes() -> ::Integer

**Returns**

- (::Integer) --- Output only. The total size of the Backup in bytes = config backup size + sum(volume backup sizes)

### #state

    def state() -> ::Google::Cloud::GkeBackup::V1::Backup::State

**Returns**

- ([::Google::Cloud::GkeBackup::V1::Backup::State](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Cloud-GkeBackup-V1-Backup-State)) --- Output only. Current state of the Backup

### #state_reason

    def state_reason() -> ::String

**Returns**

- (::String) --- Output only. Human-readable description of why the backup is in the current `state`. This field is only meant for human readability and should not be used programmatically as this field is not guaranteed to be consistent.

### #uid

    def uid() -> ::String

**Returns**

- (::String) --- Output only. Server generated global unique identifier of [UUID4](https://en.wikipedia.org/wiki/Universally_unique_identifier)

### #update_time

    def update_time() -> ::Google::Protobuf::Timestamp

**Returns**

- ([::Google::Protobuf::Timestamp](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-gke_backup-v1/latest/Google-Protobuf-Timestamp)) --- Output only. The timestamp when this Backup resource was last updated.

### #volume_count

    def volume_count() -> ::Integer

**Returns**

- (::Integer) --- Output only. The total number of volume backups contained in the Backup.