Sha256: e243f09523fff91618969e45120c6140cdb190336263715ec48150aa278e0ce3

Contents?: true

Size: 1.72 KB

Versions: 29

Compression:

Stored size: 1.72 KB

Contents

module Fog
  module Compute
    class HPV2
      class Real
        # Get details for image by id
        #
        # ==== Parameters
        # * 'image_id'<~String> - UUId of image to get details for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'image'<~Hash>:
        #     * 'id'<~String> - UUId of the image
        #     * 'name'<~String> - Name of the image
        #     * 'links'<~Array> - array of image links
        #     * 'server'<~Hash>
        #       * 'id'<~String> - UUId of server from which this snapshot image was created
        #       * 'links'<~Array> - array of server links
        #     * 'updated'<~String> - Last update timestamp for image
        #     * 'created'<~String> - Creation timestamp for image
        #     * 'minDisk'<~String> - Min. amount of diskspace for the image
        #     * 'minRam'<~String> - Min. amount of ram for the image
        #     * 'progress'<~Integer> - Progress through current status
        #     * 'metadata'<~Hash> - metadata for the image
        #     * 'status'<~String> - Status of image
        def get_image_details(image_id)
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => "images/#{image_id}"
          )
        end
      end

      class Mock
        def get_image_details(image_id)
          response = Excon::Response.new
          if image = list_images_detail.body['images'].find {|_| _['id'] == image_id}
            response.status = [200, 203][rand(1)]
            response.body = { 'image' => image }
            response
          else
            raise Fog::Compute::HPV2::NotFound
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
fog-1.37.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.36.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.35.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.34.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.33.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.32.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.31.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.30.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.29.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.28.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.27.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.26.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.25.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute_v2/get_image_details.rb
fog-1.24.0 lib/fog/hp/requests/compute_v2/get_image_details.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute_v2/get_image_details.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute_v2/get_image_details.rb