Sha256: 8360b6b133b71fde86e6280590c401f3214fd6573162f0cd058b0de929a93359

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module Compute
    class OneAndOne

      class Real

        ##
        # Returns information about a ssh key
        # URL: [https://cloudpanel-api.1and1.com/documentation/v1/en/api/documentation.html#ssh_keys__ssh_key_id__get]
        ##
        def get_ssh_key(ssh_key_id)
          
          params = {
            'method' => :get,
            'endpoint' => "/ssh_keys/#{ssh_key_id}"
          }

          request(params)

        end

      end # Real

      
      class Mock

        def get_ssh_key(ssh_key_id)
          
          # Search for ssh key to return
          if ssh_key = self.data[:ssh_keys].find {
            |hash| hash['id'] == ssh_key_id
          }
          else
            raise Fog::Errors::NotFound.new('The requested resource could
              not be found.')
          end

          # Return Response Object to User
          response = Excon::Response.new
          response.status = 202
          response.body = ssh_key
          response

        end

      end # Mock

    end # OneAndOne
  end # Compute
end # Fog

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-oneandone-1.2 lib/oneandone/requests/compute/get_ssh_key.rb