Class: AwsHelpers::RDS::SnapshotProgress

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_helpers/rds/snapshot_progress.rb

Class Method Summary collapse

Class Method Details

.report(snapshot) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/aws_helpers/rds/snapshot_progress.rb', line 7

def self.report(snapshot)

  loop do
    snapshot_details = snapshot.describe

    status = snapshot_details[:status]
    db_snapshot_identifier = snapshot_details[:db_snapshot_identifier]
    percent_progress = snapshot_details[:percent_progress]

    puts "Snapshot #{db_snapshot_identifier} #{status}, progress #{percent_progress}%"
    case status
      when SnapShotStatus::AVAILABLE
        break
      when SnapShotStatus::DELETING
        raise "Failed to create snapshot #{db_snapshot_identifier}"
      else
        sleep 30
    end
  end

end