Class: Google::Apis::AlloydbV1::AutomatedBackupPolicy

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/alloydb_v1/classes.rb,
lib/google/apis/alloydb_v1/representations.rb,
lib/google/apis/alloydb_v1/representations.rb

Overview

Message describing the user-specified automated backup policy. All fields in the automated backup policy are optional. Defaults for each field are provided if they are not set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AutomatedBackupPolicy

Returns a new instance of AutomatedBackupPolicy.



85
86
87
# File 'lib/google/apis/alloydb_v1/classes.rb', line 85

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#backup_windowString

The length of the time window during which a backup can be taken. If a backup does not succeed within this time window, it will be canceled and considered failed. The backup window must be at least 5 minutes long. There is no upper bound on the window. If not set, it defaults to 1 hour. Corresponds to the JSON property backupWindow

Returns:

  • (String)


37
38
39
# File 'lib/google/apis/alloydb_v1/classes.rb', line 37

def backup_window
  @backup_window
end

#enabledBoolean Also known as: enabled?

Whether automated automated backups are enabled. If not set, defaults to true. Corresponds to the JSON property enabled

Returns:

  • (Boolean)


42
43
44
# File 'lib/google/apis/alloydb_v1/classes.rb', line 42

def enabled
  @enabled
end

#encryption_configGoogle::Apis::AlloydbV1::EncryptionConfig

EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Corresponds to the JSON property encryptionConfig



49
50
51
# File 'lib/google/apis/alloydb_v1/classes.rb', line 49

def encryption_config
  @encryption_config
end

#labelsHash<String,String>

Labels to apply to backups created using this configuration. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


54
55
56
# File 'lib/google/apis/alloydb_v1/classes.rb', line 54

def labels
  @labels
end

#locationString

The location where the backup will be stored. Currently, the only supported option is to store the backup in the same region as the cluster. If empty, defaults to the region of the cluster. Corresponds to the JSON property location

Returns:

  • (String)


61
62
63
# File 'lib/google/apis/alloydb_v1/classes.rb', line 61

def location
  @location
end

#quantity_based_retentionGoogle::Apis::AlloydbV1::QuantityBasedRetention

A quantity based policy specifies that a certain number of the most recent successful backups should be retained. Corresponds to the JSON property quantityBasedRetention



67
68
69
# File 'lib/google/apis/alloydb_v1/classes.rb', line 67

def quantity_based_retention
  @quantity_based_retention
end

#time_based_retentionGoogle::Apis::AlloydbV1::TimeBasedRetention

A time based retention policy specifies that all backups within a certain time period should be retained. Corresponds to the JSON property timeBasedRetention



73
74
75
# File 'lib/google/apis/alloydb_v1/classes.rb', line 73

def time_based_retention
  @time_based_retention
end

#weekly_scheduleGoogle::Apis::AlloydbV1::WeeklySchedule

A weekly schedule starts a backup at prescribed start times within a day, for the specified days of the week. The weekly schedule message is flexible and can be used to create many types of schedules. For example, to have a daily backup that starts at 22:00, configure the start_times field to have one element "22:00" and the days_of_week field to have all seven days of the week. Corresponds to the JSON property weeklySchedule



83
84
85
# File 'lib/google/apis/alloydb_v1/classes.rb', line 83

def weekly_schedule
  @weekly_schedule
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



90
91
92
93
94
95
96
97
98
99
# File 'lib/google/apis/alloydb_v1/classes.rb', line 90

def update!(**args)
  @backup_window = args[:backup_window] if args.key?(:backup_window)
  @enabled = args[:enabled] if args.key?(:enabled)
  @encryption_config = args[:encryption_config] if args.key?(:encryption_config)
  @labels = args[:labels] if args.key?(:labels)
  @location = args[:location] if args.key?(:location)
  @quantity_based_retention = args[:quantity_based_retention] if args.key?(:quantity_based_retention)
  @time_based_retention = args[:time_based_retention] if args.key?(:time_based_retention)
  @weekly_schedule = args[:weekly_schedule] if args.key?(:weekly_schedule)
end