class Fog::OpenStack::Collection

Attributes

response[RW]

It's important to store the whole response, it contains e.g. important info about whether there is another page of data.

Public Instance Methods

all(options = {}) click to toggle source

Returns detailed list of records

# File lib/fog/openstack/models/collection.rb, line 23
def all(options = {})
  raise Fog::OpenStack::Errors::InterfaceNotImplemented.new('Method :all is not implemented')
end
destroy(uuid) click to toggle source

Destroys record given record's UUID

# File lib/fog/openstack/models/collection.rb, line 43
def destroy(uuid)
  raise Fog::OpenStack::Errors::InterfaceNotImplemented.new('Method :destroy is not implemented')
end
find_by_id(uuid) click to toggle source
# File lib/fog/openstack/models/collection.rb, line 38
def find_by_id(uuid)
  get(uuid)
end
get(uuid) click to toggle source

Gets record given record's UUID

# File lib/fog/openstack/models/collection.rb, line 34
def get(uuid)
  raise Fog::OpenStack::Errors::InterfaceNotImplemented.new('Method :get is not implemented')
end
load_response(response, index = nil) click to toggle source
# File lib/fog/openstack/models/collection.rb, line 10
def load_response(response, index = nil)
  # Delete it index if it's there, so we don't store response with data twice, but we store only metadata
  objects = index ? response.body.delete(index) : response.body

  clear && objects.each { |object| self << new(object) }
  self.response = response
  self
end
summary(options = {}) click to toggle source

Returns non detailed list of records, usually just subset of attributes, which makes this call more effective. Not all openstack services support non detailed list, so it delegates to :all by default.

# File lib/fog/openstack/models/collection.rb, line 29
def summary(options = {})
  all(options)
end