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
2014-06-19 07:29:43 -07:00

33 lines
785 B
Ruby

module Fog
module Compute
class DigitalOcean
class Real
#
# Delete a SSH public key from your account
#
# @see https://developers.digitalocean.com/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