Class: Fog::Rackspace::Servers::Images
- Inherits:
-
Collection
- Object
- Array
- Collection
- Fog::Rackspace::Servers::Images
- Defined in:
- lib/fog/rackspace/models/servers/images.rb
Instance Method Summary collapse
Methods inherited from Collection
#_dump, _load, aliases, attribute, attributes, #attributes, #connection, #connection=, #create, #initialize, #inspect, #merge_attributes, model, #model, #new, #reload
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Method Details
#all ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fog/rackspace/models/servers/images.rb', line 23 def all data = connection.list_images_detail.body servers = Fog::Rackspace::Servers::Images.new({ :connection => connection }) for image in data['images'] servers << Fog::Rackspace::Servers::Image.new({ :collection => images, :connection => connection }.merge!(image)) end if server images = images.select {|image| image.server_id == server.id} end images end |
#get(image_id) ⇒ Object
40 41 42 43 44 |
# File 'lib/fog/rackspace/models/servers/images.rb', line 40 def get(image_id) connection.get_image_details(image_id) rescue Excon::Errors::NotFound nil end |