Class: Aws::EC2::ClassicAddress
- Inherits:
-
Object
- Object
- Aws::EC2::ClassicAddress
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-ec2/classic_address.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#allocation_id ⇒ String
The ID representing the allocation of the address for use with EC2-VPC.
-
#association_id ⇒ String
The ID representing the association of the address with an instance in a VPC.
-
#domain ⇒ String
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (‘standard`) or instances in a VPC (`vpc`).
-
#instance_id ⇒ String
The ID of the instance that the address is associated with (if any).
-
#network_interface_id ⇒ String
The ID of the network interface.
-
#network_interface_owner_id ⇒ String
The ID of the AWS account that owns the network interface.
-
#private_ip_address ⇒ String
The private IP address associated with the Elastic IP address.
- #public_ip ⇒ String
Actions collapse
- #associate(options = {}) ⇒ Types::AssociateAddressResult
- #disassociate(options = {}) ⇒ EmptyStructure
- #identifiers ⇒ Object deprecated private Deprecated.
- #release(options = {}) ⇒ EmptyStructure
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::Address
Returns the data for this ClassicAddress.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ ClassicAddress
constructor
A new instance of ClassicAddress.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current ClassicAddress.
Constructor Details
#initialize(public_ip, options = {}) ⇒ ClassicAddress #initialize(options = {}) ⇒ ClassicAddress
Returns a new instance of ClassicAddress.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 19 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @public_ip = extract_public_ip(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() end |
Instance Method Details
#allocation_id ⇒ String
The ID representing the allocation of the address for use with EC2-VPC.
42 43 44 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 42 def allocation_id data.allocation_id end |
#associate(options = {}) ⇒ Types::AssociateAddressResult
155 156 157 158 159 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 155 def associate( = {}) = .merge(public_ip: @public_ip) resp = @client.associate_address() resp.data end |
#association_id ⇒ String
The ID representing the association of the address with an instance in a VPC.
49 50 51 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 49 def association_id data.association_id end |
#client ⇒ Client
81 82 83 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 81 def client @client end |
#data ⇒ Types::Address
Returns the data for this Aws::EC2::ClassicAddress. Calls Aws::EC2::Client#describe_addresses if #data_loaded? is ‘false`.
101 102 103 104 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 101 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
109 110 111 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 109 def data_loaded? !!@data end |
#disassociate(options = {}) ⇒ EmptyStructure
176 177 178 179 180 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 176 def disassociate( = {}) = .merge(public_ip: data.public_ip) resp = @client.disassociate_address() resp.data end |
#domain ⇒ String
Indicates whether this Elastic IP address is for use with instances in EC2-Classic (‘standard`) or instances in a VPC (`vpc`).
56 57 58 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 56 def domain data.domain 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.
205 206 207 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 205 def identifiers { public_ip: @public_ip } end |
#instance_id ⇒ String
The ID of the instance that the address is associated with (if any).
35 36 37 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 35 def instance_id data.instance_id end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::ClassicAddress. Returns ‘self` making it possible to chain methods.
classic_address.reload.data
91 92 93 94 95 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 91 def load resp = @client.describe_addresses(public_ips: [@public_ip]) @data = resp.addresses[0] self end |
#network_interface_id ⇒ String
The ID of the network interface.
62 63 64 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 62 def network_interface_id data.network_interface_id end |
#network_interface_owner_id ⇒ String
The ID of the AWS account that owns the network interface.
68 69 70 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 68 def network_interface_owner_id data.network_interface_owner_id end |
#private_ip_address ⇒ String
The private IP address associated with the Elastic IP address.
74 75 76 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 74 def private_ip_address data.private_ip_address end |
#public_ip ⇒ String
29 30 31 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 29 def public_ip @public_ip end |
#release(options = {}) ⇒ EmptyStructure
197 198 199 200 201 |
# File 'lib/aws-sdk-ec2/classic_address.rb', line 197 def release( = {}) = .merge(public_ip: data.public_ip) resp = @client.release_address() resp.data end |