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
nsidc-fog-1.24.1 lib/fog/vsphere/requests/compute/get_server_type.rb
fog-1.24.0 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.11 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.10 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.9 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.8 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.7 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.6 lib/fog/vsphere/requests/compute/get_server_type.rb
fog-1.23.0 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.4 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.3 lib/fog/vsphere/requests/compute/get_server_type.rb
ns-fog-1.22.2 lib/fog/vsphere/requests/compute/get_server_type.rb
fog-1.22.1 lib/fog/vsphere/requests/compute/get_server_type.rb
fog-1.22.0 lib/fog/vsphere/requests/compute/get_server_type.rb
fog-1.21.0 lib/fog/vsphere/requests/compute/get_server_type.rb