Class: AWS::EC2::DHCPOptionsCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::DHCPOptionsCollection
- Includes:
- Core::Collection::Simple, TaggedCollection
- Defined in:
- lib/aws/ec2/dhcp_options_collection.rb
Instance Attribute Summary
Attributes included from Core::Model
Instance Method Summary collapse
Methods included from Core::Collection::Simple
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from Core::Model
#client, #config_prefix, #initialize, #inspect
Methods included from TaggedCollection
Methods included from FilteredCollection
#filter, #filtered_request, #initialize
Instance Method Details
#[](dhcp_options_id) ⇒ DHCPOptions
67 68 69 |
# File 'lib/aws/ec2/dhcp_options_collection.rb', line 67 def [] DHCPOptions.new(, :config => config) end |
#create(options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/aws/ec2/dhcp_options_collection.rb', line 44 def create = {} configurations = [] .each_pair do |opt,values| opt = opt.to_s.gsub(/_/, '-') values = values.is_a?(Array) ? values : [values] configurations << { :key => opt, :values => values.map(&:to_s) } end client_opts = {} client_opts[:dhcp_configurations] = configurations resp = client.(client_opts) DHCPOptions.new_from(:create_dhcp_options, resp., resp.., :config => config) end |