class Fog::AWS::Compute::DhcpOption

Public Class Methods

new(attributes={}) click to toggle source
Calls superclass method
# File lib/fog/aws/models/compute/dhcp_option.rb, line 9
def initialize(attributes={})
  super
end

Public Instance Methods

associate(vpc_id) click to toggle source

Associates an existing dhcp configration set with a VPC

dhcp_option.attach(dopt-id, vpc-id)

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/dhcp_option.rb, line 21
def associate(vpc_id)
  requires :id
  service.associate_dhcp_options(id, vpc_id)
  reload
end
destroy() click to toggle source

Removes an existing dhcp configuration set

dhcp_option.destroy

Returns

True or false depending on the result

# File lib/fog/aws/models/compute/dhcp_option.rb, line 36
def destroy
  requires :id
  service.delete_dhcp_options(id)
  true
end
save() click to toggle source

Create a dhcp configuration set

>> g = AWS.dhcp_options.new()
>> g.save

Returns:

requestId and a dhcpOptions object

# File lib/fog/aws/models/compute/dhcp_option.rb, line 52
def save
  requires :dhcp_configuration_set
  data = service.create_dhcp_options(dhcp_configuration_set).body['dhcpOptionsSet'].first
  new_attributes = data.reject {|key,value| key == 'requestId'}
  merge_attributes(new_attributes)
  true

  true
end