Sha256: 1840ce8acf08f5ac9eac39b045ce80abd04964f5efda4d221c4095f9febb5c87

Contents?: true

Size: 536 Bytes

Versions: 33

Compression:

Stored size: 536 Bytes

Contents

module Fog
  module Compute
    class Vsphere
      class Hosts < Fog::Collection
        attribute :datacenter
        attribute :cluster

        model Fog::Compute::Vsphere::Host

        def all(filters = {})
          requires :datacenter, :cluster
          load service.list_hosts(:datacenter => datacenter, :cluster => cluster)
        end

        def get(name)
          all.find { |host| host.name == name } or
            raise Fog::Compute::Vsphere::NotFound, "no such host #{name}"
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
fog-vsphere-1.7.0.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-2.1.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-2.1.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-2.0.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-2.0.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.13.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.13.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.12.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.11.3 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.11.2 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.11.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.11.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.10.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.9.2 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.9.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.9.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.8.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.7.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.7.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-1.6.0 lib/fog/vsphere/models/compute/hosts.rb