Sha256: 981788b48936b1933d36de7f73f9c13e7165ae4d5d54dec907a92a4f9c6d5f47

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

require 'fog/core/model'

module Fog
  module VirtualBox
    class Compute

      class NATEngine < Fog::Model

        # identity :?

        attribute :alias_mode
        attribute :dns_pass_domain
        attribute :dns_proxy
        attribute :dns_use_host_resolver
        attribute :host_ip
        attribute :network
        attribute :redirects
        attribute :tftp_boot_file
        attribute :tftp_next_server
        attribute :tftp_prefix

        attr_accessor :machine, :network_adapter

        # def save
        #   unless identity
        #     requires :identity, :bus, :machine
        #     with_session do |session|
        #       self.raw = session.machine.add_storage_controller(identity, bus)
        #     end
        #     true
        #   else
        #     raise Fog::Errors::Error.new('Updating an existing storage_controller is not yet implemented. Contributions welcome!')
        #   end
        # end

        undef_method :redirects
        def redirects
          Fog::VirtualBox::Compute::NATRedirects.new(
            :connection => connection,
            :machine    => machine,
            :nat_engine => self
          )
        end

        private

        def raw
          @raw
        end
        
        def raw=(new_raw)
          @raw = new_raw
          raw_attributes = {}
          for key in [:alias_mode, :dns_pass_domain, :dns_proxy, :dns_use_host_resolver, :host_ip, :network, :redirects, :tftp_boot_file, :tftp_next_server, :tftp_prefix]
            raw_attributes[key] = @raw.send(key)
          end
          merge_attributes(raw_attributes)
        end

      end

    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/compute/models/virtual_box/nat_engine.rb
fog-0.8.1 lib/fog/compute/models/virtual_box/nat_engine.rb
fog-0.8.0 lib/fog/compute/models/virtual_box/nat_engine.rb
fog-0.7.2 lib/fog/compute/models/virtual_box/nat_engine.rb
fog-0.7.1 lib/fog/compute/models/virtual_box/nat_engine.rb
fog-0.7.0 lib/fog/compute/models/virtual_box/nat_engine.rb