Sha256: c2a38b4d28f1cfafaff99dedfe35db92b61aa57a733956788d580d55ca160f1f

Contents?: true

Size: 928 Bytes

Versions: 4

Compression:

Stored size: 928 Bytes

Contents

module Fog
  module Compute
    class DigitalOceanV2
      class Real
        def get_ssh_key(key_id)
          request(
            :expects => [200],
            :method  => 'GET',
            :path    => "/v2/account/keys/#{key_id}"
          )
        end
      end

      # noinspection RubyStringKeysInHashInspection
      class Mock
        def get_ssh_key(_)
          response        = Excon::Response.new
          response.status = 200

          response.body = {
            'ssh_key' => {
              'id'          => 512190,
              'fingerprint' => '3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa',
              'public_key'  => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example',
              'name'        => 'My SSH Public Key'
            }
          }

          response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-1.38.0 lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb
fog-1.37.0 lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb
fog-1.36.0 lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb
fog-1.35.0 lib/fog/digitalocean/requests/compute_v2/get_ssh_key.rb