Sha256: 900d55c678d7f62d9f3714d8270066018b054a918b1a79fff7fc5cd6f8fce475

Contents?: true

Size: 990 Bytes

Versions: 29

Compression:

Stored size: 990 Bytes

Contents

module Fog
  module Compute
    class HPV2
      class Real
        # List all key pairs
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'keypairs'<~Array>:
        #     * 'keypair'<~Hash>:
        #       * 'public_key'<~String> - Public portion of the key
        #       * 'name'<~String> - Name of the key
        #       * 'fingerprint'<~String> - Fingerprint of the key
        def list_key_pairs
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'os-keypairs'
          )
        end
      end

      class Mock
        def list_key_pairs
          response = Excon::Response.new

          key_pairs = []
          key_pairs = self.data[:key_pairs].values unless self.data[:key_pairs].nil?

          response.status = [200, 203][rand(1)]
          response.body = { 'keypairs' => key_pairs }
          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_key_pairs.rb
fog-1.36.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.35.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.34.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.33.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.32.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.31.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.30.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.29.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.28.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.27.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.26.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.25.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
fog-1.24.0 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute_v2/list_key_pairs.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute_v2/list_key_pairs.rb