Sha256: 193f57125c34d22aff9d10babe91cc6195167c3ed2d00e54b7973e70a705a659

Contents?: true

Size: 1.56 KB

Versions: 39

Compression:

Stored size: 1.56 KB

Contents

module Fog
  module Compute
    class AWS
      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

39 entries across 37 versions & 3 rubygems

Version Path
fog-aws-3.1.0 lib/fog/aws/models/compute/dhcp_option.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/dhcp_option.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/dhcp_option.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-3.0.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-2.0.1 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-2.0.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.4.1 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.4.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.3.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.2.1 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.2.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.1.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-1.0.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.13.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.12.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.11.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.10.0 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.9.4 lib/fog/aws/models/compute/dhcp_option.rb
fog-aws-0.9.3 lib/fog/aws/models/compute/dhcp_option.rb