Class: MMS::Resource::SnapshotSchedule

Inherits:
MMS::Resource show all
Defined in:
lib/mms/resource/snapshot_schedule.rb

Instance Attribute Summary collapse

Attributes inherited from MMS::Resource

#client, #data, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MMS::Resource

#_load, cache_key, find, #from_hash, #invalidate_cache, #to_hash

Instance Attribute Details

#cluster_checkpoint_interval_minObject

Returns the value of attribute cluster_checkpoint_interval_min.



7
8
9
# File 'lib/mms/resource/snapshot_schedule.rb', line 7

def cluster_checkpoint_interval_min
  @cluster_checkpoint_interval_min
end

#daily_snapshot_retention_daysObject

Returns the value of attribute daily_snapshot_retention_days.



8
9
10
# File 'lib/mms/resource/snapshot_schedule.rb', line 8

def daily_snapshot_retention_days
  @daily_snapshot_retention_days
end

#monthly_snapshot_retention_monthsObject

Returns the value of attribute monthly_snapshot_retention_months.



10
11
12
# File 'lib/mms/resource/snapshot_schedule.rb', line 10

def monthly_snapshot_retention_months
  @monthly_snapshot_retention_months
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/mms/resource/snapshot_schedule.rb', line 3

def name
  @name
end

#snapshot_interval_hoursObject

Returns the value of attribute snapshot_interval_hours.



5
6
7
# File 'lib/mms/resource/snapshot_schedule.rb', line 5

def snapshot_interval_hours
  @snapshot_interval_hours
end

#snapshot_retention_daysObject

Returns the value of attribute snapshot_retention_days.



6
7
8
# File 'lib/mms/resource/snapshot_schedule.rb', line 6

def snapshot_retention_days
  @snapshot_retention_days
end

#weekly_snapshot_retention_weeksObject

Returns the value of attribute weekly_snapshot_retention_weeks.



9
10
11
# File 'lib/mms/resource/snapshot_schedule.rb', line 9

def weekly_snapshot_retention_weeks
  @weekly_snapshot_retention_weeks
end

Class Method Details

._find(client, group_id, cluster_id) ⇒ Object



38
39
40
# File 'lib/mms/resource/snapshot_schedule.rb', line 38

def self._find(client, group_id, cluster_id)
  client.get('/groups/' + group_id + '/backupConfigs/' + cluster_id + '/snapshotSchedule')
end

.table_headerObject



34
35
36
# File 'lib/mms/resource/snapshot_schedule.rb', line 34

def self.table_header
  %w(Group Cluster IntervalHours RetentionDays CheckpointIntervalMin RetentionDays RetentionWeeks RetentionMonths)
end

Instance Method Details

#clusterMMS::Resource::Cluster



13
14
15
# File 'lib/mms/resource/snapshot_schedule.rb', line 13

def cluster
  MMS::Resource::Cluster.find(@client, @data['groupId'], @data['clusterId'])
end

#table_rowObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/mms/resource/snapshot_schedule.rb', line 17

def table_row
  [
    cluster.group.name,
    cluster.name,
    @snapshot_interval_hours,
    @snapshot_retention_days,
    @cluster_checkpoint_interval_min,
    @daily_snapshot_retention_days,
    @weekly_snapshot_retention_weeks,
    @monthly_snapshot_retention_months
  ]
end

#table_sectionObject



30
31
32
# File 'lib/mms/resource/snapshot_schedule.rb', line 30

def table_section
  [table_row]
end