Sha256: b2e169d4b8e2f1ada6220d74eda351162e9a95ca89379b0860aa2d44025e7f8a
Contents?: true
Size: 1007 Bytes
Versions: 11
Compression:
Stored size: 1007 Bytes
Contents
unless Fog.mocking? module Fog module Rackspace class Servers # List all images (IDs and names only) # # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: # * 'id'<~Integer> - Id of the image # * 'name'<~String> - Name of the image def list_images request( :expects => [200, 203], :method => 'GET', :path => 'images.json' ) end end end end else module Fog module Rackspace class Servers def list_images response = Excon::Response.new data = list_images_detail.body['images'] images = [] for image in data images << image.reject { |key, value| !['id', 'name'].include?(key) } end response.status = [200, 203][rand(1)] response.body = { 'images' => images } response end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems