Sha256: ff4c49b9f29914402cb5c9f2e200e94cbabe59a2dfb795be80c04c3132023c1a

Contents?: true

Size: 1.56 KB

Versions: 29

Compression:

Stored size: 1.56 KB

Contents

module Fog
  module AWS
    class Compute
      class DhcpOption < Fog::Model
        identity  :id,                          :aliases => 'dhcpOptionsId'
        attribute :dhcp_configuration_set,      :aliases => 'dhcpConfigurationSet'
        attribute :tag_set,                     :aliases => 'tagSet'

        def initialize(attributes={})
          super
        end

        # Associates an existing dhcp configration set with a VPC
        #
        # dhcp_option.attach(dopt-id, vpc-id)
        #
        # ==== Returns
        #
        # True or false depending on the result
        #
        def associate(vpc_id)
          requires :id
          service.associate_dhcp_options(id, vpc_id)
          reload
        end

        # Removes an existing dhcp configuration set
        #
        # dhcp_option.destroy
        #
        # ==== Returns
        #
        # True or false depending on the result
        #

        def destroy
          requires :id
          service.delete_dhcp_options(id)
          true
        end

        # Create a dhcp configuration set
        #
        #  >> g = AWS.dhcp_options.new()
        #  >> g.save
        #
        # == Returns:
        #
        # requestId and a dhcpOptions object
        #

        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
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
fog-aws-3.22.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.21.1 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.21.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.20.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.19.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.18.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.17.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.16.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.15.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.14.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.13.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.12.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.11.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.10.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.9.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.8.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.7.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.6.7 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.6.6 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.6.5 lib/fog/aws/models/compute/dhcp_option.rb