Class: Awshark::Rds::Subcommand
- Inherits:
-
Thor
- Object
- Thor
- Awshark::Rds::Subcommand
- Includes:
- ClassOptions
- Defined in:
- lib/awshark/rds/subcommand.rb
Instance Method Summary collapse
Methods included from ClassOptions
Instance Method Details
#check ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/awshark/rds/subcommand.rb', line 19 def check puts "\n+++ Instances +++" list checks = manager.check_reservations pattern = "%-15s %-15s %-15s %-15s %s\n" puts "\n+++ Check +++" printf pattern, 'Reserved', 'Instances', 'Type', 'MultiAZ', 'Comment' checks.each do |c| printf pattern, c.reserved_count, c.instance_count, c.type, c.multi_az, comment(c) end end |
#list ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/awshark/rds/subcommand.rb', line 40 def list instances = manager.instances instances = instances.sort_by(&:name) pattern = "%-30s %-15s %-20s %-10s %-10s %s\n" printf pattern, 'Name', 'Type', 'Engine (Version)', 'MultiAZ', 'Encrypted', 'State' instances.each do |i| printf pattern, i.name, i.type, "#{i.engine} (#{i.engine_version})", i.multi_az, i.encrypted, i.state end end |
#reservations ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/awshark/rds/subcommand.rb', line 59 def reservations reservations = manager.reservations pattern = "%-30s %-26s %-30s %s\n" printf pattern, 'Reserved', 'Type', 'MultiAZ', 'Offering' reservations.each do |r| printf pattern, r.count, r.type, r.multi_az, r.offering_type end end |