Class: Fog::Compute::Linode::Kernels

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/linode/models/compute/kernels.rb

Instance Method Summary collapse

Instance Method Details

#all(options = {}) ⇒ Object

Returns an Array of the available kernels.

The list of kernels can be filtered by support for KVM or Xen by specifying kvm: true or xen: true respectively as options.



14
15
16
17
18
19
# File 'lib/fog/linode/models/compute/kernels.rb', line 14

def all(options={})
  [[:kvm, :isKVM], [:xen, :isXen]].each do |type, param|
    options[param] = options[type] ? 1 : 0 if options.has_key?(type)
  end
  load kernels(options)
end

#get(id) ⇒ Object



21
22
23
# File 'lib/fog/linode/models/compute/kernels.rb', line 21

def get(id)
  new kernels.select {|kernel| kernel[:id] == id }.first
end