Sha256: 823b6b8573cfd8fdb2e05d3d3a8baab3f18283e8e169f4ca620cb7302628b3b6

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

module Fog
  module Compute
    class DigitalOcean
      class Real
        def list_ssh_keys(filters = {})
          request(
            :expects => [200],
            :method  => 'GET',
            :path    => "v2/account/keys",
            :query   => filters
          )
        end
      end

      # noinspection RubyStringKeysInHashInspection
      class Mock
        def list_ssh_keys(filters = {})
          response        = Excon::Response.new
          response.status = 200
          response.body   = {
            "ssh_keys" => data[:ssh_keys] ||
              [
                {
                  "id" => 512189,
                  "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"
                }
              ],
            "links" => {
            },
            "meta" => {
              "total" => data[:ssh_keys].count || 1
            }
          }
          response
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
fog-digitalocean-0.4.0 lib/fog/compute/digitalocean/requests/list_ssh_keys.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-digitalocean-0.3.0/lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
fog-digitalocean-0.3.0 lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
fog-digitalocean-0.2.0 lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
fog-digitalocean-0.1.0 lib/fog/digitalocean/requests/compute/list_ssh_keys.rb