Sha256: 5084af7a23d439176d65106eebda938f60f55730d13691b3bdf9d7553df31994

Contents?: true

Size: 965 Bytes

Versions: 75

Compression:

Stored size: 965 Bytes

Contents

module Fog
  module Compute
    class Vsphere
      class Real
        def get_server_type(id, datacenter, filter={})
          server_type=get_raw_server_type(id, datacenter)
          raise(Fog::Compute::Vsphere::NotFound) unless server_type
          server_type_attributes(server_type, datacenter)
        end

        protected

        def get_raw_server_type(id, datacenter, filter={})
           types=raw_server_types(datacenter)
           raise(Fog::Compute::Vsphere::NotFound) unless types
           types=types.select{ | servertype | servertype.id == id }.first
           raise(Fog::Compute::Vsphere::NotFound) unless types
           types
        end
      end
      class Mock
        def get_server_type(id)
          {:id=>"rhel6Guest",
            :name=>"rhel6Guest",
            :family=>"linuxGuest",
            :fullname=>"Red Hat Enterprise Linux 6 (32-Bit)",
            :datacenter=>"Solutions"}
        end
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 5 rubygems

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