Class: AWS::EC2::Attachment
- Inherits:
-
Resource
- Object
- 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’)
51 52 53 |
# File 'lib/aws/ec2/attachment.rb', line 51 def device @device end |
#instance ⇒ Instance (readonly)
Returns the EC2 instance the volume is attached to.
47 48 49 |
# File 'lib/aws/ec2/attachment.rb', line 47 def instance @instance end |
#volume ⇒ Volume (readonly)
Returns the volume that is attached.
44 45 46 |
# File 'lib/aws/ec2/attachment.rb', line 44 def volume @volume end |
Instance Method Details
#attach_time ⇒ Time
Returns the time at which this attachment was created.
64 |
# File 'lib/aws/ec2/attachment.rb', line 64 attribute :attach_time |
#delete(options = {}) ⇒ Object
Detaches the volume from its instance.
109 110 111 |
# File 'lib/aws/ec2/attachment.rb', line 109 def delete = {} client.detach_volume(.merge()) end |
#delete_on_termination? ⇒ Boolean
Returns true
if the volume will be deleted on instance termination.
69 |
# File 'lib/aws/ec2/attachment.rb', line 69 attribute :delete_on_termination? |
#exists? ⇒ Boolean
Returns true if the attachment exists.
95 96 97 |
# File 'lib/aws/ec2/attachment.rb', line 95 def exists? !.nil? end |
#status ⇒ Symbol
Returns the attachment status. Possible values are:
-
:attaching
-
:attached
-
:detaching
-
:detached
60 |
# File 'lib/aws/ec2/attachment.rb', line 60 attribute :status, :to_sym => true |