Method: CIMI::Model::VolumeConfiguration.find

Defined in:
lib/cimi/models/volume_configuration.rb

.find(id, context) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/cimi/models/volume_configuration.rb', line 57

def self.find(id, context)
  if id==:all
    if context.driver.respond_to? :volume_configurations
      context.driver.volume_configurations(context.credentials, {:env=>context})
    else
      current_db.volume_configurations.map { |t| from_db(t, context) }
    end
  else
    if context.driver.respond_to? :volume_configuration
      context.driver.volume_configuration(context.credentials, id, :env=>context)
    else
      config = current_db.volume_configurations_dataset.first(:id => id)
      raise CIMI::Model::NotFound unless config
      from_db(config, context)
    end
  end
end