1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/digitalocean/requests/compute/destroy_ssh_key.rb

37 lines
787 B
Ruby

module Fog
module Compute
class DigitalOcean
class Real
#
# Delete a SSH public key from your account
#
# @see https://www.digitalocean.com/api#ssh_keys
#
def destroy_ssh_key(id)
request(
:expects => [200],
:method => 'GET',
:path => "ssh_keys/#{id}/destroy"
)
end
end
class Mock
def destroy_ssh_key(id)
response = Excon::Response.new
response.status = 200
if self.data[:ssh_keys].reject! { |k| k['id'] == id }
response.body = { "status" => "OK" }
else
response.body = { "status" => "ERROR" }
end
response
end
end
end
end
end