2010-03-16 18:46:21 -04:00
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
module EC2
|
|
|
|
class Real
|
2009-08-17 01:19:35 -04:00
|
|
|
|
|
|
|
# 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)
|
2010-03-16 01:15:33 -04:00
|
|
|
request(
|
|
|
|
'Action' => 'DeleteKeyPair',
|
|
|
|
'KeyName' => key_name,
|
|
|
|
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
|
|
|
)
|
2009-08-17 01:19:35 -04:00
|
|
|
end
|
|
|
|
|
2009-07-13 22:14:59 -04:00
|
|
|
end
|
|
|
|
|
2010-03-16 18:46:21 -04:00
|
|
|
class Mock
|
2009-08-17 01:19:35 -04:00
|
|
|
|
|
|
|
def delete_key_pair(key_name)
|
2009-11-20 14:08:08 -05:00
|
|
|
response = Excon::Response.new
|
2010-03-16 18:46:21 -04:00
|
|
|
@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
|
|
|
|
end
|