Class: AWS::EC2::Attachment
- Inherits:
-
Object
- Object
- 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 ⇒ Object
readonly
Returns the value of attribute device.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#volume ⇒ Object
readonly
Returns the value of attribute volume.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
True if the attachments are the same.
-
#attach_time ⇒ Time
The time at which this attachment was created.
-
#delete(opts = {}) ⇒ Object
Detaches the volume from an instance.
-
#delete_on_termination? ⇒ Boolean
True if the volume will be deleted on instance termination.
-
#exists? ⇒ Boolean
True if the attachment exists.
-
#status ⇒ Symbol
The attachment status.
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
41 42 43 |
# File 'lib/aws/ec2/attachment.rb', line 41 def device @device end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
40 41 42 |
# File 'lib/aws/ec2/attachment.rb', line 40 def instance @instance end |
#volume ⇒ Object (readonly)
Returns the value of attribute volume.
39 40 41 |
# File 'lib/aws/ec2/attachment.rb', line 39 def volume @volume end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Returns True if the attachments are the same.
86 87 88 89 90 91 |
# File 'lib/aws/ec2/attachment.rb', line 86 def ==(other) other.kind_of?(Attachment) and other.volume == volume and other.instance == instance and other.device == device end |
#attach_time ⇒ Time
Returns The time at which this attachment was created.
68 69 70 |
# File 'lib/aws/ec2/attachment.rb', line 68 def attach_time retrieve_attribute(:attach_time) { describe_call } end |
#delete(opts = {}) ⇒ Object
Detaches the volume from an instance.
52 53 54 55 56 |
# File 'lib/aws/ec2/attachment.rb', line 52 def delete(opts = {}) client.detach_volume(opts.merge(:volume_id => volume.id, :instance_id => instance.id, :device => device)) end |
#delete_on_termination? ⇒ Boolean
Returns True if the volume will be deleted on instance termination.
74 75 76 |
# File 'lib/aws/ec2/attachment.rb', line 74 def delete_on_termination? retrieve_attribute(:delete_on_termination?) { describe_call } end |
#exists? ⇒ Boolean
Returns True if the attachment exists.
79 80 81 |
# File 'lib/aws/ec2/attachment.rb', line 79 def exists? !.nil? end |
#status ⇒ Symbol
Returns The attachment status. Possible values:
-
:attaching
-
:attached
-
:detaching
-
:detached
.
63 64 65 |
# File 'lib/aws/ec2/attachment.rb', line 63 def status retrieve_attribute(:status) { describe_call } end |