Class: Swa::EC2::Image
Instance Attribute Summary
Attributes inherited from Resource
#aws_resource
Instance Method Summary
collapse
#tags
Methods inherited from Resource
#data, delegate, #initialize, list
Constructor Details
This class inherits a constructor from Swa::Resource
Instance Method Details
#delete ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'lib/swa/ec2/image.rb', line 30
def delete
ebs_snapshot_ids = ami.block_device_mappings.map do |mapping|
mapping.ebs.snapshot_id if mapping.ebs
end.compact
deregister
ebs_snapshot_ids.each do |snapshot_id|
ami.client.delete_snapshot(:snapshot_id => snapshot_id)
end
end
|
#id ⇒ Object
11
12
13
|
# File 'lib/swa/ec2/image.rb', line 11
def id
ami.image_id
end
|
#name ⇒ Object
23
24
25
|
# File 'lib/swa/ec2/image.rb', line 23
def name
ami.name
end
|
#summary ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/swa/ec2/image.rb', line 15
def summary
[
field(ami, :image_id),
ami.creation_date.sub(".000Z", "Z"),
quoted(name)
].join(" ")
end
|