Class: Cumulus::AutoScaling::ScheduledActionDiff

Inherits:
Common::Diff
  • Object
show all
Includes:
ScheduledActionChange
Defined in:
lib/autoscaling/models/ScheduledActionDiff.rb

Overview

Public: Represents a single difference between local configuration and AWS configuration of Scheduled Actions

Constant Summary

Constants included from ScheduledActionChange

Cumulus::AutoScaling::ScheduledActionChange::DESIRED, Cumulus::AutoScaling::ScheduledActionChange::ENDTIME, Cumulus::AutoScaling::ScheduledActionChange::MAX, Cumulus::AutoScaling::ScheduledActionChange::MIN, Cumulus::AutoScaling::ScheduledActionChange::RECURRENCE, Cumulus::AutoScaling::ScheduledActionChange::START

Constants included from Common::DiffChange

Common::DiffChange::ADD, Common::DiffChange::MODIFIED, Common::DiffChange::UNMANAGED

Instance Attribute Summary

Attributes inherited from Common::Diff

#aws, #changes, #info_only, #local, #type

Instance Method Summary collapse

Methods included from Common::DiffChange

next_change_id

Methods inherited from Common::Diff

#add_string, added, #initialize, #local_name, modified, #to_s, unmanaged, #unmanaged_string

Constructor Details

This class inherits a constructor from Cumulus::Common::Diff

Instance Method Details

#asset_typeObject



44
45
46
# File 'lib/autoscaling/models/ScheduledActionDiff.rb', line 44

def asset_type
  "Scheduled action"
end

#aws_nameObject



48
49
50
# File 'lib/autoscaling/models/ScheduledActionDiff.rb', line 48

def aws_name
  @aws.scheduled_action_name
end

#diff_stringObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/autoscaling/models/ScheduledActionDiff.rb', line 23

def diff_string
  diff_lines = []

  case @type
  when START
    diff_lines << "Start: AWS - #{Colors.aws_changes(@aws.start_time)}, Local - #{Colors.local_changes(@local.start)}"
  when ENDTIME
    diff_lines << "End: AWS - #{Colors.aws_changes(@aws.end_time)}, Local - #{Colors.local_changes(@local.end)}"
  when RECURRENCE
    diff_lines << "Recurrence: AWS - #{Colors.aws_changes(@aws.recurrence)}, Local - #{Colors.local_changes(@local.recurrence)}"
  when MIN
    diff_lines << "Min size: AWS - #{Colors.aws_changes(@aws.min_size)}, Local - #{Colors.local_changes(@local.min)}"
  when MAX
    diff_lines << "Max size: AWS - #{Colors.aws_changes(@aws.max_size)}, Local - #{Colors.local_changes(@local.max)}"
  when DESIRED
    diff_lines << "Desired capacity: AWS - #{Colors.aws_changes(@aws.desired_capacity)}, Local - #{Colors.local_changes(@local.desired)}"
  end

  diff_lines.flatten.join("\n")
end