Class: Aws::EC2::DhcpOptions
- Inherits:
-
Object
- Object
- Aws::EC2::DhcpOptions
- Extended by:
- Deprecations
- Defined in:
- lib/aws-sdk-ec2/dhcp_options.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#dhcp_configurations ⇒ Array<Types::DhcpConfiguration>
One or more DHCP options in the set.
- #id ⇒ String (also: #dhcp_options_id)
-
#tags ⇒ Array<Types::Tag>
Any tags assigned to the DHCP options set.
Actions collapse
- #associate_with_vpc(options = {}) ⇒ EmptyStructure
- #create_tags(options = {}) ⇒ Tag::Collection
- #delete(options = {}) ⇒ EmptyStructure
- #identifiers ⇒ Object deprecated private Deprecated.
Instance Method Summary collapse
- #client ⇒ Client
-
#data ⇒ Types::DhcpOptions
Returns the data for this DhcpOptions.
-
#data_loaded? ⇒ Boolean
Returns ‘true` if this resource is loaded.
-
#initialize(*args) ⇒ DhcpOptions
constructor
A new instance of DhcpOptions.
-
#load ⇒ self
(also: #reload)
Loads, or reloads #data for the current DhcpOptions.
Constructor Details
#initialize(id, options = {}) ⇒ DhcpOptions #initialize(options = {}) ⇒ DhcpOptions
Returns a new instance of DhcpOptions.
19 20 21 22 23 24 |
# File 'lib/aws-sdk-ec2/dhcp_options.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
#associate_with_vpc(options = {}) ⇒ EmptyStructure
98 99 100 101 102 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 98 def associate_with_vpc( = {}) = .merge(dhcp_options_id: @id) resp = @client.() resp.data end |
#create_tags(options = {}) ⇒ Tag::Collection
126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 126 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::DhcpOptions
Returns the data for this Aws::EC2::DhcpOptions. Calls Client#describe_dhcp_options if #data_loaded? is ‘false`.
69 70 71 72 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 69 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
77 78 79 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 77 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
153 154 155 156 157 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 153 def delete( = {}) = .merge(dhcp_options_id: @id) resp = @client.() resp.data end |
#dhcp_configurations ⇒ Array<Types::DhcpConfiguration>
One or more DHCP options in the set.
36 37 38 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 36 def dhcp_configurations data.dhcp_configurations end |
#id ⇒ String Also known as: dhcp_options_id
29 30 31 |
# File 'lib/aws-sdk-ec2/dhcp_options.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.
Deprecated.
161 162 163 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 161 def identifiers { id: @id } end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::DhcpOptions. Returns ‘self` making it possible to chain methods.
.reload.data
59 60 61 62 63 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 59 def load resp = @client.(dhcp_options_ids: [@id]) @data = resp.[0] self end |
#tags ⇒ Array<Types::Tag>
Any tags assigned to the DHCP options set.
42 43 44 |
# File 'lib/aws-sdk-ec2/dhcp_options.rb', line 42 def data. end |