2009-08-17 01:19:35 -04:00
|
|
|
unless Fog.mocking?
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class EC2
|
|
|
|
|
|
|
|
# Delete a key pair that you own
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * key_name<~String> - Name of the key pair.
|
|
|
|
#
|
|
|
|
# ==== Returns
|
2009-11-02 21:48:49 -05:00
|
|
|
# * response<~Excon::Response>:
|
2009-08-17 01:19:35 -04:00
|
|
|
# * body<~Hash>:
|
|
|
|
# * 'requestId'<~String> id of request
|
|
|
|
# * 'return'<~Boolean> - success?
|
|
|
|
def delete_key_pair(key_name)
|
|
|
|
request({
|
|
|
|
'Action' => 'DeleteKeyPair',
|
|
|
|
'KeyName' => key_name
|
|
|
|
}, Fog::Parsers::AWS::EC2::Basic.new)
|
|
|
|
end
|
|
|
|
|
2009-07-13 22:14:59 -04:00
|
|
|
end
|
2009-08-17 01:19:35 -04:00
|
|
|
end
|
|
|
|
end
|
2009-07-13 22:14:59 -04:00
|
|
|
|
2009-08-17 01:19:35 -04:00
|
|
|
else
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class EC2
|
|
|
|
|
|
|
|
def delete_key_pair(key_name)
|
|
|
|
response = Fog::Response.new
|
2009-08-20 22:25:52 -04:00
|
|
|
Fog::AWS::EC2.data[:key_pairs].delete(key_name)
|
2009-08-17 01:19:35 -04:00
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
|
|
|
'requestId' => Fog::AWS::Mock.request_id,
|
|
|
|
'return' => true
|
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-07-13 22:14:59 -04:00
|
|
|
end
|
|
|
|
end
|
2009-08-17 01:19:35 -04:00
|
|
|
|
2009-07-13 22:14:59 -04:00
|
|
|
end
|