Sha256: 1f9abcf4db19b80da65a0f2d2324006281ce0569351fb8280c0f6a8ef464845a

Contents?: true

Size: 532 Bytes

Versions: 23

Compression:

Stored size: 532 Bytes

Contents

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

        model Fog::Vsphere::Compute::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 } ||
            raise(Fog::Vsphere::Compute::NotFound, "no such host #{name}")
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
fog-vsphere-3.7.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.8 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.7 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.6 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.5 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.4 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.3 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.2 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.5.3 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.6.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.5.2 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.5.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.5.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.4.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.3.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.3.0 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.2.5 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.2.2 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.2.1 lib/fog/vsphere/models/compute/hosts.rb
fog-vsphere-3.2.0 lib/fog/vsphere/models/compute/hosts.rb