Class: Cumulus::Kinesis::StreamDiff

Inherits:
Common::Diff show all
Includes:
Common::TagsDiff, StreamChange
Defined in:
lib/kinesis/models/StreamDiff.rb

Overview

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

Constant Summary

Constants included from StreamChange

Cumulus::Kinesis::StreamChange::RETENTION, Cumulus::Kinesis::StreamChange::SHARDS, Cumulus::Kinesis::StreamChange::TAGS

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::TagsDiff

#tags_diff_string, #tags_to_add, #tags_to_remove

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



30
31
32
# File 'lib/kinesis/models/StreamDiff.rb', line 30

def asset_type
  "Stream"
end

#aws_nameObject



34
35
36
# File 'lib/kinesis/models/StreamDiff.rb', line 34

def aws_name
  @aws.stream_name
end

#aws_tagsObject



26
27
28
# File 'lib/kinesis/models/StreamDiff.rb', line 26

def aws_tags
  @aws
end

#diff_stringObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/kinesis/models/StreamDiff.rb', line 38

def diff_string
  case @type
  when SHARDS
    [
      "Shards:",
      Colors.aws_changes("\tAWS - #{aws}"),
      Colors.local_changes("\tLocal - #{local}"),
    ].join("\n")
  when RETENTION
    [
      "Retention:",
      Colors.aws_changes("\tAWS - #{aws} hours"),
      Colors.local_changes("\tLocal - #{local} hours"),
    ].join("\n")
  when TAGS
    tags_diff_string
  end
end

#local_tagsObject



22
23
24
# File 'lib/kinesis/models/StreamDiff.rb', line 22

def local_tags
  @local
end