Class: Aws::EC2::NetworkInterface
- Inherits:
-
Object
- Object
- Aws::EC2::NetworkInterface
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-ec2/network_interface.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#attachment ⇒ Types::NetworkInterfaceAttachment
The network interface attachment.
-
#availability_zone ⇒ String
The Availability Zone.
-
#description ⇒ String
A description.
-
#groups ⇒ Array<Types::GroupIdentifier>
Any security groups for the network interface.
- #id ⇒ String (also: #network_interface_id)
-
#interface_type ⇒ String
The type of interface.
-
#ipv_6_addresses ⇒ Array<Types::NetworkInterfaceIpv6Address>
The IPv6 addresses associated with the network interface.
-
#mac_address ⇒ String
The MAC address.
-
#owner_id ⇒ String
The AWS account ID of the owner of the network interface.
-
#private_dns_name ⇒ String
The private DNS name.
-
#private_ip_address ⇒ String
The IPv4 address of the network interface within the subnet.
-
#private_ip_addresses ⇒ Array<Types::NetworkInterfacePrivateIpAddress>
The private IPv4 addresses associated with the network interface.
-
#requester_id ⇒ String
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
-
#requester_managed ⇒ Boolean
Indicates whether the network interface is being managed by AWS.
-
#source_dest_check ⇒ Boolean
Indicates whether traffic to or from the instance is validated.
-
#status ⇒ String
The status of the network interface.
-
#subnet_id ⇒ String
The ID of the subnet.
-
#tag_set ⇒ Array<Types::Tag>
Any tags assigned to the network interface.
-
#vpc_id ⇒ String
The ID of the VPC.
Actions collapse
- #assign_private_ip_addresses(options = {}) ⇒ EmptyStructure
- #attach(options = {}) ⇒ Types::AttachNetworkInterfaceResult
- #create_tags(options = {}) ⇒ Tag::Collection
- #delete(options = {}) ⇒ EmptyStructure
- #describe_attribute(options = {}) ⇒ Types::DescribeNetworkInterfaceAttributeResult
- #detach(options = {}) ⇒ EmptyStructure
- #modify_attribute(options = {}) ⇒ EmptyStructure
- #reset_attribute(options = {}) ⇒ EmptyStructure
- #unassign_private_ip_addresses(options = {}) ⇒ EmptyStructure
Associations collapse
- #association ⇒ NetworkInterfaceAssociation?
- #identifiers ⇒ Object deprecated private Deprecated.
- #subnet ⇒ Subnet?
- #vpc ⇒ Vpc?
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::NetworkInterface
Returns the data for this NetworkInterface.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ NetworkInterface
constructor
A new instance of NetworkInterface.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current NetworkInterface.
Constructor Details
#initialize(id, options = {}) ⇒ NetworkInterface #initialize(options = {}) ⇒ NetworkInterface
Returns a new instance of NetworkInterface.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#assign_private_ip_addresses(options = {}) ⇒ EmptyStructure
204 205 206 207 208 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 204 def assign_private_ip_addresses( = {}) = .merge(network_interface_id: @id) resp = @client.assign_private_ip_addresses() resp.data end |
#association ⇒ NetworkInterfaceAssociation?
420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 420 def association if data.association.association_id NetworkInterfaceAssociation.new( id: data.association.association_id, data: data.association, client: @client ) else nil end end |
#attach(options = {}) ⇒ Types::AttachNetworkInterfaceResult
228 229 230 231 232 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 228 def attach( = {}) = .merge(network_interface_id: @id) resp = @client.attach_network_interface() resp.data end |
#attachment ⇒ Types::NetworkInterfaceAttachment
The network interface attachment.
36 37 38 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 36 def data. end |
#availability_zone ⇒ String
The Availability Zone.
42 43 44 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 42 def availability_zone data.availability_zone end |
#client ⇒ Client
146 147 148 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 146 def client @client end |
#create_tags(options = {}) ⇒ Tag::Collection
256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 256 def ( = {}) batch = [] = Aws::Util.deep_merge(, resources: [@id]) resp = @client.() [:tags].each do |t| batch << Tag.new( resource_id: @id, key: t[:key], value: t[:value], client: @client ) end Tag::Collection.new([batch], size: batch.size) end |
#data ⇒ Types::NetworkInterface
Returns the data for this Aws::EC2::NetworkInterface. Calls Client#describe_network_interfaces if #data_loaded? is ‘false`.
166 167 168 169 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 166 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
174 175 176 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 174 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
283 284 285 286 287 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 283 def delete( = {}) = .merge(network_interface_id: @id) resp = @client.delete_network_interface() resp.data end |
#describe_attribute(options = {}) ⇒ Types::DescribeNetworkInterfaceAttributeResult
304 305 306 307 308 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 304 def describe_attribute( = {}) = .merge(network_interface_id: @id) resp = @client.describe_network_interface_attribute() resp.data end |
#description ⇒ String
A description.
48 49 50 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 48 def description data.description end |
#detach(options = {}) ⇒ EmptyStructure
325 326 327 328 329 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 325 def detach( = {}) = .merge(attachment_id: data..) resp = @client.detach_network_interface() resp.data end |
#groups ⇒ Array<Types::GroupIdentifier>
Any security groups for the network interface.
54 55 56 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 54 def groups data.groups end |
#id ⇒ String Also known as: network_interface_id
29 30 31 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 29 def id @id end |
#identifiers ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
458 459 460 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 458 def identifiers { id: @id } end |
#interface_type ⇒ String
The type of interface.
60 61 62 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 60 def interface_type data.interface_type end |
#ipv_6_addresses ⇒ Array<Types::NetworkInterfaceIpv6Address>
The IPv6 addresses associated with the network interface.
66 67 68 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 66 def ipv_6_addresses data.ipv_6_addresses end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::NetworkInterface. Returns ‘self` making it possible to chain methods.
network_interface.reload.data
156 157 158 159 160 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 156 def load resp = @client.describe_network_interfaces(network_interface_ids: [@id]) @data = resp.network_interfaces[0] self end |
#mac_address ⇒ String
The MAC address.
72 73 74 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 72 def mac_address data.mac_address end |
#modify_attribute(options = {}) ⇒ EmptyStructure
373 374 375 376 377 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 373 def modify_attribute( = {}) = .merge(network_interface_id: @id) resp = @client.modify_network_interface_attribute() resp.data end |
#owner_id ⇒ String
The AWS account ID of the owner of the network interface.
78 79 80 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 78 def owner_id data.owner_id end |
#private_dns_name ⇒ String
The private DNS name.
84 85 86 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 84 def private_dns_name data.private_dns_name end |
#private_ip_address ⇒ String
The IPv4 address of the network interface within the subnet.
90 91 92 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 90 def private_ip_address data.private_ip_address end |
#private_ip_addresses ⇒ Array<Types::NetworkInterfacePrivateIpAddress>
The private IPv4 addresses associated with the network interface.
96 97 98 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 96 def private_ip_addresses data.private_ip_addresses end |
#requester_id ⇒ String
The ID of the entity that launched the instance on your behalf (for example, AWS Management Console or Auto Scaling).
103 104 105 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 103 def requester_id data.requester_id end |
#requester_managed ⇒ Boolean
Indicates whether the network interface is being managed by AWS.
109 110 111 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 109 def requester_managed data.requester_managed end |
#reset_attribute(options = {}) ⇒ EmptyStructure
394 395 396 397 398 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 394 def reset_attribute( = {}) = .merge(network_interface_id: @id) resp = @client.reset_network_interface_attribute() resp.data end |
#source_dest_check ⇒ Boolean
Indicates whether traffic to or from the instance is validated.
115 116 117 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 115 def source_dest_check data.source_dest_check end |
#status ⇒ String
The status of the network interface.
121 122 123 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 121 def status data.status end |
#subnet ⇒ Subnet?
433 434 435 436 437 438 439 440 441 442 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 433 def subnet if data.subnet_id Subnet.new( id: data.subnet_id, client: @client ) else nil end end |
#subnet_id ⇒ String
The ID of the subnet.
127 128 129 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 127 def subnet_id data.subnet_id end |
#tag_set ⇒ Array<Types::Tag>
Any tags assigned to the network interface.
133 134 135 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 133 def tag_set data.tag_set end |
#unassign_private_ip_addresses(options = {}) ⇒ EmptyStructure
411 412 413 414 415 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 411 def unassign_private_ip_addresses( = {}) = .merge(network_interface_id: @id) resp = @client.unassign_private_ip_addresses() resp.data end |
#vpc ⇒ Vpc?
445 446 447 448 449 450 451 452 453 454 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 445 def vpc if data.vpc_id Vpc.new( id: data.vpc_id, client: @client ) else nil end end |
#vpc_id ⇒ String
The ID of the VPC.
139 140 141 |
# File 'lib/aws-sdk-ec2/network_interface.rb', line 139 def vpc_id data.vpc_id end |