Class: AWS::EC2::DHCPOptionsCollection
Instance Method Summary
collapse
#each, #each_batch, #enum, #first, #in_groups_of, #page
#tagged, #tagged_values
#filter, #initialize
Instance Method Details
#[](dhcp_options_id) ⇒ DHCPOptions
67
68
69
|
# File 'lib/aws/ec2/dhcp_options_collection.rb', line 67
def [] dhcp_options_id
DHCPOptions.new(dhcp_options_id, :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 options = {}
configurations = []
options.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.create_dhcp_options(client_opts)
DHCPOptions.new_from(:create_dhcp_options,
resp.dhcp_options,
resp.dhcp_options.dhcp_options_id,
:config => config)
end
|