2013-03-25 21:47:45 +01:00
|
|
|
module Fog
|
|
|
|
module Compute
|
2014-02-19 12:30:59 +00:00
|
|
|
class DigitalOcean
|
2013-03-25 21:47:45 +01:00
|
|
|
class Real
|
|
|
|
#
|
|
|
|
# Delete a SSH public key from your account
|
|
|
|
#
|
2014-06-19 07:29:43 -07:00
|
|
|
# @see https://developers.digitalocean.com/ssh-keys
|
2013-03-25 21:47:45 +01:00
|
|
|
#
|
|
|
|
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
|