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, find, #from_hash, #invalidate_cache, #set_client, #set_data, #to_hash

Instance Attribute Details

#cluster_checkpoint_interval_minObject

Returns the value of attribute cluster_checkpoint_interval_min.



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

def cluster_checkpoint_interval_min
  @cluster_checkpoint_interval_min
end

#daily_snapshot_retention_daysObject

Returns the value of attribute daily_snapshot_retention_days.



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

def daily_snapshot_retention_days
  @daily_snapshot_retention_days
end

#monthly_snapshot_retention_monthsObject

Returns the value of attribute monthly_snapshot_retention_months.



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

def monthly_snapshot_retention_months
  @monthly_snapshot_retention_months
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#snapshot_interval_hoursObject

Returns the value of attribute snapshot_interval_hours.



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

def snapshot_interval_hours
  @snapshot_interval_hours
end

#snapshot_retention_daysObject

Returns the value of attribute snapshot_retention_days.



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

def snapshot_retention_days
  @snapshot_retention_days
end

#weekly_snapshot_retention_weeksObject

Returns the value of attribute weekly_snapshot_retention_weeks.



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

def weekly_snapshot_retention_weeks
  @weekly_snapshot_retention_weeks
end

Class Method Details

._find(client, group_id, cluster_id) ⇒ Object



40
41
42
# File 'lib/mms/resource/snapshot_schedule.rb', line 40

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

.table_headerObject



36
37
38
# File 'lib/mms/resource/snapshot_schedule.rb', line 36

def self.table_header
  ['Group', 'Cluster', 'IntervalHours', 'RetentionDays', 'CheckpointIntervalMin', 'RetentionDays', 'RetentionWeeks', 'RetentionMonths']
end

Instance Method Details

#clusterMMS::Resource::Cluster



15
16
17
# File 'lib/mms/resource/snapshot_schedule.rb', line 15

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

#table_rowObject



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

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



32
33
34
# File 'lib/mms/resource/snapshot_schedule.rb', line 32

def table_section
  [table_row]
end