Class: Builderator::Model::Cleaner::Snapshots
- Defined in:
- lib/builderator/model/cleaner/snapshots.rb
Overview
EC2 Snapshot Resources
Constant Summary collapse
- PROPERTIES =
%w(state owner_id description volume_size)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#find, #in_use?, #initialize, #select, #unused
Constructor Details
This class inherits a constructor from Builderator::Model::Cleaner::Base
Instance Method Details
#fetch ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/builderator/model/cleaner/snapshots.rb', line 18 def fetch @resources = {}.tap do |s| Util.ec2.describe_snapshots(:filters => [ { :name => 'status', :values => %w(completed) } ], :owner_ids => ['self']).each do |page| page.snapshots.each do |snap| properties = Util.(snap.) properties['creation_date'] = snap.start_time.to_datetime PROPERTIES.each { |pp| properties[pp] = snap[pp.to_sym] } s[snap.snapshot_id] = { :id => snap.snapshot_id, :properties => properties, :volume => snap.volume_id } end end end end |