class AwsPocketknife::Cli::RdsSnapshot

Public Instance Methods

clean(db_name, days) click to toggle source
# File lib/aws_pocketknife/cli/rds_snapshot.rb, line 30
def clean(db_name, days)
  dry_run = options.fetch("dry_run", true)
  AwsPocketknife::Rds.clean_snapshots db_name: db_name,
                                      days: days,
                                      dry_run: dry_run
end
create(db_name) click to toggle source
# File lib/aws_pocketknife/cli/rds_snapshot.rb, line 38
def create(db_name)
  AwsPocketknife::Rds.create_snapshot db_name: db_name
end
list(db_name) click to toggle source
# File lib/aws_pocketknife/cli/rds_snapshot.rb, line 9
def list(db_name)
  snapshots = AwsPocketknife::Rds.describe_snapshots(db_name: db_name)
  headers = [ 'Name', 'Creation Time', 'Snapshot Type', 'Status','Port', 'Engine', 'Version', 'Storage (Gb)', 'IOPS']
  data = []
  snapshots.each do |h|
    data << [h.db_snapshot_identifier,
             h.snapshot_create_time,
             h.snapshot_type,
             h.status,
             h.port,
             h.engine,
             h.engine_version,
             h.allocated_storage,
             h.iops
    ]
  end
  AwsPocketknife::Rds.pretty_table(headers: headers, data: data)
end