Class: Seiton::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/seiton/cli.rb

Instance Method Summary collapse

Instance Method Details

#amiObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/seiton/cli.rb', line 30

def ami
  unless options[:before_datetime] then
    puts '--before-datetime must be specified. (--before-datetime=YYYY/MM/DD)'
    exit 1
  end

  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Ec2.new
  seiton.ec2_image(options[:check], options[:before_datetime], ignores)
end

#ebs_snapshotObject



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/seiton/cli.rb', line 42

def ebs_snapshot
  unless options[:before_datetime] then
    puts '--before-datetime must be specified. (--before-datetime=YYYY/MM/DD)'
    exit 1
  end

  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Ec2.new
  seiton.ebs_snapshots(options[:check],
                       options[:before_datetime], ignores)
end

#eipObject



79
80
81
82
83
# File 'lib/seiton/cli.rb', line 79

def eip
  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Ec2.new
  seiton.eip(options[:check], ignores)
end

#initObject



24
25
26
27
# File 'lib/seiton/cli.rb', line 24

def init
  require 'seiton/init'
  Seiton::Init.welcome
end

#instanceObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/seiton/cli.rb', line 55

def instance
  unless options[:before_datetime] then
    puts '--before-datetime must be specified. (--before-datetime=YYYY/MM/DD)'
    exit 1
  end

  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Ec2.new
  seiton.ec2_instance(options[:check], options[:before_datetime], ignores)
end

#rds_snapshotObject



67
68
69
70
71
72
73
74
75
76
# File 'lib/seiton/cli.rb', line 67

def rds_snapshot
  unless options[:before_datetime] then
    puts '--before-datetime must be specified. (--before-datetime=YYYY/MM/DD)'
    exit 1
  end

  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Rds.new
  seiton.rds_snapshot(options[:check], options[:before_datetime], ignores)
end

#sqs_queueObject



86
87
88
89
90
# File 'lib/seiton/cli.rb', line 86

def sqs_queue
  ignores = Seiton::Ignores.new(options[:ignores_file], options[:ignores]).generate
  seiton = Seiton::Sqs.new
  seiton.sqs_queue(options[:check], ignores)
end

#versionObject



19
20
21
# File 'lib/seiton/cli.rb', line 19

def version
  puts Seiton::VERSION
end