Class: AWS::EC2::Attachment
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::EC2::Attachment
- Defined in:
- lib/aws/ec2/attachment.rb
Overview
Represents an attachment of an Amazon EBS volume to an instance.
Instance Attribute Summary collapse
-
#device ⇒ String
readonly
Returns how the device is exposed to the instance (e.g. '/dev/sdh').
-
#instance ⇒ Instance
readonly
Returns the EC2 instance the volume is attached to.
-
#volume ⇒ Volume
readonly
Returns the volume that is attached.
Instance Method Summary collapse
-
#attach_time ⇒ Time
Returns the time at which this attachment was created.
-
#delete(options = {}) ⇒ Object
Detaches the volume from its instance.
-
#delete_on_termination? ⇒ Boolean
Returns
true
if the volume will be deleted on instance termination. -
#exists? ⇒ Boolean
Returns true if the attachment exists.
-
#status ⇒ Symbol
Returns the attachment status.
Instance Attribute Details
#device ⇒ String (readonly)
Returns how the device is exposed to the instance (e.g. '/dev/sdh')
49 50 51 |
# File 'lib/aws/ec2/attachment.rb', line 49 def device @device end |
#instance ⇒ Instance (readonly)
Returns the EC2 instance the volume is attached to.
45 46 47 |
# File 'lib/aws/ec2/attachment.rb', line 45 def instance @instance end |
#volume ⇒ Volume (readonly)
Returns the volume that is attached.
42 43 44 |
# File 'lib/aws/ec2/attachment.rb', line 42 def volume @volume end |
Instance Method Details
#attach_time ⇒ Time
Returns the time at which this attachment was created.
63 |
# File 'lib/aws/ec2/attachment.rb', line 63 attribute :attach_time |
#delete(options = {}) ⇒ Object
Detaches the volume from its instance.
99 100 101 |
# File 'lib/aws/ec2/attachment.rb', line 99 def delete = {} client.detach_volume(.merge()) end |
#delete_on_termination? ⇒ Boolean
Returns true
if the volume will be deleted
on instance termination.
68 |
# File 'lib/aws/ec2/attachment.rb', line 68 attribute :delete_on_termination, :boolean => true |
#exists? ⇒ Boolean
Returns true if the attachment exists.
85 86 87 |
# File 'lib/aws/ec2/attachment.rb', line 85 def exists? !.nil? end |
#status ⇒ Symbol
Returns the attachment status. Possible values are:
:attaching
:attached
:detaching
:detached
59 |
# File 'lib/aws/ec2/attachment.rb', line 59 attribute :status, :to_sym => true |