Class: Cumulus::EC2::EbsGroupDiff

Inherits:
Common::Diff show all
Includes:
EbsGroupChange
Defined in:
lib/ec2/models/EbsGroupDiff.rb

Overview

Public: Represents a single difference between local configuration and AWS configuration

Constant Summary

Constants included from EbsGroupChange

Cumulus::EC2::EbsGroupChange::AZ, Cumulus::EC2::EbsGroupChange::VG_ADDED, Cumulus::EC2::EbsGroupChange::VG_COUNT, Cumulus::EC2::EbsGroupChange::VG_REMOVED

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



22
23
24
# File 'lib/ec2/models/EbsGroupDiff.rb', line 22

def asset_type
  "EBS Volume Group"
end

#aws_nameObject



26
27
28
# File 'lib/ec2/models/EbsGroupDiff.rb', line 26

def aws_name
  @aws.name
end

#diff_stringObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ec2/models/EbsGroupDiff.rb', line 30

def diff_string
  case @type
  when AZ
    [
      "Availability Zone:",
      Colors.aws_changes("\tAWS - #{aws}"),
      Colors.local_changes("\tLocal - #{local}"),
    ].join("\n")
  when VG_ADDED
    Colors.added("Volume Group Added: #{local.count} x #{local.description}")
  when VG_REMOVED
    Colors.unmanaged("Volume Group Unmanaged: #{aws.count} x #{aws.description}")
  when VG_COUNT
    Colors.local_changes("Count changed from #{aws.count} to #{local.count}: #{local.description}")
  end
end