Class: Google::Apis::ComputeAlpha::ResourcePolicySnapshotSchedulePolicyRetentionPolicy

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

Overview

Policy for retention of scheduled snapshots.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ResourcePolicySnapshotSchedulePolicyRetentionPolicy

Returns a new instance of ResourcePolicySnapshotSchedulePolicyRetentionPolicy.



32146
32147
32148
# File 'lib/google/apis/compute_alpha/classes.rb', line 32146

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

Instance Attribute Details

#max_retention_daysFixnum

Maximum age of the snapshot that is allowed to be kept. Corresponds to the JSON property maxRetentionDays

Returns:

  • (Fixnum)


32132
32133
32134
# File 'lib/google/apis/compute_alpha/classes.rb', line 32132

def max_retention_days
  @max_retention_days
end

#on_policy_switchString

TODO(b/165626794): Remove this field Specifies the behavior to apply to existing, scheduled snapshots snapshots if the policy is changed. Corresponds to the JSON property onPolicySwitch

Returns:

  • (String)


32138
32139
32140
# File 'lib/google/apis/compute_alpha/classes.rb', line 32138

def on_policy_switch
  @on_policy_switch
end

#on_source_disk_deleteString

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. Corresponds to the JSON property onSourceDiskDelete

Returns:

  • (String)


32144
32145
32146
# File 'lib/google/apis/compute_alpha/classes.rb', line 32144

def on_source_disk_delete
  @on_source_disk_delete
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



32151
32152
32153
32154
32155
# File 'lib/google/apis/compute_alpha/classes.rb', line 32151

def update!(**args)
  @max_retention_days = args[:max_retention_days] if args.key?(:max_retention_days)
  @on_policy_switch = args[:on_policy_switch] if args.key?(:on_policy_switch)
  @on_source_disk_delete = args[:on_source_disk_delete] if args.key?(:on_source_disk_delete)
end