Sha256: 6ad8771c373739a6ec5489db6c6588c333bbebf6be40903d584e34dc035bdee9

Contents?: true

Size: 1.65 KB

Versions: 11

Compression:

Stored size: 1.65 KB

Contents

module Fog
  module Compute
    class RackspaceV2
      class Real
        # Retrieves image detail
        # @param [String] image_id
        # @return [Excon::Response] response:
        #   * body [Hash]:
        #     * image [Hash]:
        #       * OS-DCF:diskConfig [String] - The disk configuration value.
        #       * created [String] - created timestamp
        #       * id [String] - id of image
        #       * metadata [Hash] - image metadata
        #       * minDisk [Fixnum]
        #       * minRam [Fixnum]
        #       * name [String] - name of image
        #       * progress [Fixnum] - progress complete. Value is from 0 to 100.
        #       * status [String] - status of current image
        #       * updated [String] - updated timestamp
        #       * links [Array] - links to flavor
        # @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
        # @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
        # @raise [Fog::Compute::RackspaceV2::InternalServerError] - HTTP 500
        # @raise [Fog::Compute::RackspaceV2::ServiceError]
        # @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/Get_Image_Details-d1e4848.html
        def get_image(image_id)
          request(
            :expects => [200, 203],
            :method => 'GET',
            :path => "images/#{image_id}"
          )
        end
      end

      class Mock
        def get_image(image_id)
          image = self.data[:images][image_id]
          if image.nil?
            raise Fog::Compute::RackspaceV2::NotFound
          else
            response(:body => {"image" => image})
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.11 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.10 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.9 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.8 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.7 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.6 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.4 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.3 lib/fog/rackspace/requests/compute_v2/get_image.rb
ns-fog-1.22.2 lib/fog/rackspace/requests/compute_v2/get_image.rb
fog-1.22.1 lib/fog/rackspace/requests/compute_v2/get_image.rb