Sha256: 5340eabc1236a9489af3e942c41b473243409049069c1d4a4abbae5119d3a470

Contents?: true

Size: 892 Bytes

Versions: 27

Compression:

Stored size: 892 Bytes

Contents

module Fog
  module Compute
    class DigitalOcean
      class Real
        #
        # This method shows a specific public SSH key in your account
        # that can be added to a droplet.
        #
        # @see https://developers.digitalocean.com/ssh-keys
        #
        def get_ssh_key(id)
          request(
            :expects  => [200],
            :method   => 'GET',
            :path     => "ssh_keys/#{id}"
          )
        end
      end

      class Mock
        def get_ssh_key(id)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            "status" => "OK",
            # key listing does not return ssh_pub_key
            # https://developers.digitalocean.com/ssh-keys
            "ssh_key"  => self.data[:ssh_keys].find { |k| k['id'] == id }
          }
          response
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

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