Class: AWS::EC2::NetworkInterface::Attachment
- Inherits:
-
Object
- Object
- AWS::EC2::NetworkInterface::Attachment
- Defined in:
- lib/aws/ec2/network_interface/attachment.rb
Instance Attribute Summary collapse
- #attach_time ⇒ Time readonly
-
#attachment_id ⇒ String
(also: #id)
readonly
Returns the attachment id.
- #delete_on_termination ⇒ Boolean (also: #delete_on_termination?)
-
#device_index ⇒ Integer
readonly
The index of the device for the network interface attachment on the instance.
-
#instance ⇒ Instance
readonly
Returns the instance the network interface is attached to.
-
#instance_owner_id ⇒ String
readonly
Returns the instance owner id.
-
#network_interface ⇒ NetworkInterface
readonly
Returns the network interface this is an attachment for.
-
#status ⇒ Symbol
readonly
Returns the attachment status.
Instance Method Summary collapse
-
#detach(options = {}) ⇒ nil
(also: #delete)
Detaches the network interface from the instance.
-
#initialize(network_interface, details) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(network_interface, details) ⇒ Attachment
Returns a new instance of Attachment.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 21 def initialize network_interface, details @network_interface = network_interface @attachment_id = details[:attachment_id] @instance = Instance.new(details[:instance_id], :owner_id => details[:instance_owner_id], :config => network_interface.config) @instance_owner_id = details[:instance_owner_id] @device_index = details[:device_index] @status = details[:status].to_sym @attach_time = details[:attach_time] @delete_on_termination = details[:delete_on_termination] end |
Instance Attribute Details
#attach_time ⇒ Time (readonly)
58 59 60 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 58 def attach_time @attach_time end |
#attachment_id ⇒ String (readonly) Also known as: id
Returns the attachment id.
35 36 37 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 35 def @attachment_id end |
#delete_on_termination ⇒ Boolean Also known as: delete_on_termination?
61 62 63 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 61 def delete_on_termination @delete_on_termination end |
#device_index ⇒ Integer (readonly)
Returns The index of the device for the network interface attachment on the instance.
52 53 54 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 52 def device_index @device_index end |
#instance ⇒ Instance (readonly)
Returns the instance the network interface is attached to.
45 46 47 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 45 def instance @instance end |
#instance_owner_id ⇒ String (readonly)
Returns the instance owner id.
48 49 50 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 48 def instance_owner_id @instance_owner_id end |
#network_interface ⇒ NetworkInterface (readonly)
Returns the network interface this is an attachment for.
41 42 43 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 41 def network_interface @network_interface end |
#status ⇒ Symbol (readonly)
Returns the attachment status.
55 56 57 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 55 def status @status end |
Instance Method Details
#detach(options = {}) ⇒ nil Also known as: delete
Detaches the network interface from the instance.
89 90 91 92 93 94 |
# File 'lib/aws/ec2/network_interface/attachment.rb', line 89 def detach = {} client_opts = {} client_opts[:attachment_id] = client_opts[:force] = [:force] == true network_interface.client.detach_network_interface(client_opts) end |