Sha256: 4e549a740518e56f6f0bd76c91a4054312d8f679bba8b7b8247f863ef9aebc89

Contents?: true

Size: 1.16 KB

Versions: 56

Compression:

Stored size: 1.16 KB

Contents

module Fog
  module Compute
    class Vsphere
      class Real
        def get_compute_resource(name, datacenter_name)
          compute_resource = get_raw_compute_resource(name, datacenter_name)
          raise(Fog::Compute::Vsphere::NotFound) unless compute_resource
          compute_resource_attributes(compute_resource, datacenter_name)
        end

        protected

        def get_raw_compute_resource(name, datacenter_name)
          find_raw_datacenter(datacenter_name).find_compute_resource(name)
        end
      end

      class Mock
        def get_compute_resource(name, datacenter_name)
          {
            :id=>"domain-s7", 
            :name=>"fake-host", 
            :totalCpu=>33504, 
            :totalMemory=>154604142592, 
            :numCpuCores=>12, 
            :numCpuThreads=>24, 
            :effectiveCpu=>32247, 
            :effectiveMemory=>135733, 
            :numHosts=>1, 
            :numEffectiveHosts=>1, 
            :overallStatus=>"gray", 
            :overallCpuUsage=>15682, 
            :overallMemoryUsage=>132755, 
            :effective=>true, 
            :isSingleHost=>true
          }
        end
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 3 rubygems

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