Sha256: c8f78132b2bd81578448f0458ae51424f5ca54d5cce34b0b269ff56524d1ee89

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 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__delete]
        ##
        def delete_ssh_key(ssh_key_id)
          
          params = {
            'method' => :delete,
            'endpoint' => "/ssh_keys/#{ssh_key_id}"
          }

          request(params)

        end

      end # Real

      
      class Mock

        def delete_ssh_key(ssh_key_id)
          
          # Search for ssh key to delete
          if ssh_key = self.data[:ssh_keys].find {
            |hash| hash['id'] == ssh_key_id
          }
            self.data[:ssh_keys].delete(ssh_key)
          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 = []
          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/delete_ssh_key.rb