Class: Fog::Compute::RackspaceV2::Images

Inherits:
Fog::Collection show all
Defined in:
lib/fog/rackspace/models/compute_v2/images.rb

Instance Attribute Summary

Attributes inherited from Fog::Collection

#service

Instance Method Summary collapse

Methods inherited from Fog::Collection

#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Method Details

#allFog::Compute::RackspaceV2::Images

Note:

Fog’s current implementation only returns 1000 images.

Note:

Fog does not retrieve all image details. Please use get to retrieve all details for a specific image.

Returns list of images



20
21
22
23
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 20

def all
  data = service.list_images.body['images']
  load(data)
end

#get(image_id) ⇒ Fog::Compute::RackspaceV2:Image

Retrieve image



33
34
35
36
37
38
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 33

def get(image_id)
  data = service.get_image(image_id).body['image']
  new(data)
rescue Fog::Compute::RackspaceV2::NotFound
  nil
end