Sha256: f3e4ad674909680041377ebc19651a9c10fb8395458169308d2f4bce1a9417de

Contents?: true

Size: 1.16 KB

Versions: 41

Compression:

Stored size: 1.16 KB

Contents

module VagrantPlugins
  module ProviderVirtualBox
    module Cap
      # Reads the forwarded ports that currently exist on the machine
      # itself. This raises an exception if the machine isn't running.
      #
      # This also may not match up with configured forwarded ports, because
      # Vagrant auto port collision fixing may have taken place.
      #
      # @return [Hash<Integer, Integer>] Host => Guest port mappings.
      def self.forwarded_ports(machine)
        return nil if machine.state.id != :running

        {}.tap do |result|
          machine.provider.driver.read_forwarded_ports.each do |_, _, h, g|
            result[h] = g
          end
        end
      end

      # Reads the network interface card MAC addresses and returns them.
      #
      # @return [Hash<String, String>] Adapter => MAC address
      def self.nic_mac_addresses(machine)
        machine.provider.driver.read_mac_addresses
      end

      # Returns a list of the snapshots that are taken on this machine.
      #
      # @return [Array<String>] Snapshot Name
      def self.snapshot_list(machine)
        machine.provider.driver.list_snapshots(machine.id)
      end
    end
  end
end

Version data entries

41 entries across 37 versions & 5 rubygems

Version Path
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/providers/virtualbox/cap.rb
vagrant-unbundled-2.0.0.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.9.8.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.9.7.1 plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/virtualbox/cap.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.9.5.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.9.1.1 plugins/providers/virtualbox/cap.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/cap.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/cap.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/cap.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.8.5.2 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.8.5.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.8.4.2 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.8.4.1 plugins/providers/virtualbox/cap.rb
vagrant-unbundled-1.8.1.2 plugins/providers/virtualbox/cap.rb