Sha256: 603d050de884cd9b2a5c60a184680576b1a13fc9710903f1b81d676936022e0f

Contents?: true

Size: 1.61 KB

Versions: 29

Compression:

Stored size: 1.61 KB

Contents

module Fog
  module Compute
    class HPV2
      class Real
        # List all images (IDs and names only)
        #
        # ==== Parameters
        # * options<~Hash>: filter options
        #   * 'name'<~String> - Filters by the name of the image
        #   * 'status'<~String> - Filters by the status of the image
        #   * 'server'<~String> - Filters by the UUId of the server
        #   * 'marker'<~String> - The ID of the last item in the previous list
        #   * 'limit'<~Integer> - Sets the page size
        #   * 'changes-since'<~DateTime> - Filters by the changes-since time. The list contains servers that have been deleted since the changes-since time.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'images'<~Array>:
        #     * 'id'<~String> - UUId of the image
        #     * 'name'<~String> - Name of the image
        #     * 'links'<~Array> - array of image links
        def list_images(options = {})
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'images',
            :query    => options
          )
        end
      end

      class Mock
        def list_images(options = {})
          response = Excon::Response.new
          data = list_images_detail.body['images']
          images = []
          for image in data
            images << image.reject { |key, _| !['id', 'name', 'links'].include?(key) }
          end
          response.status = [200, 203][rand(1)]
          response.body = { 'images' => images }
          response
        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/list_images.rb
fog-1.36.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.35.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute_v2/list_images.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.34.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.33.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.32.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.31.0 lib/fog/hp/requests/compute_v2/list_images.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.30.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.29.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.28.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.27.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.26.0 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.25.0 lib/fog/hp/requests/compute_v2/list_images.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute_v2/list_images.rb
fog-1.24.0 lib/fog/hp/requests/compute_v2/list_images.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute_v2/list_images.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute_v2/list_images.rb