Class: Swa::EC2::Volume
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
#attachment ⇒ Object
31
32
33
|
# File 'lib/swa/ec2/volume.rb', line 31
def attachment
v.attachments.first || OpenStruct.new
end
|
#id ⇒ Object
11
12
13
|
# File 'lib/swa/ec2/volume.rb', line 11
def id
v.volume_id
end
|
#name ⇒ Object
27
28
29
|
# File 'lib/swa/ec2/volume.rb', line 27
def name
tags["Name"]
end
|
#summary ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/swa/ec2/volume.rb', line 15
def summary
[
field(v, :volume_id),
field(v, :snapshot_id),
sprintf("%5d", v.size),
field(v, :volume_type),
field(attachment, :instance_id),
pad(attachment.device, 9),
quoted(name)
].join(" ")
end
|