Enable delete_key_pair request method and implement it, along with mocking support.

This commit is contained in:
Rupak Ganguly 2011-11-23 15:11:51 -05:00
parent f15faa6b17
commit 91f5ac41de
2 changed files with 36 additions and 1 deletions

View File

@ -20,9 +20,10 @@ module Fog
request :change_password_server
#request :confirm_resized_server
request :create_image
request :create_server
request :create_key_pair
request :create_server
request :delete_image
request :delete_key_pair
request :delete_server
request :get_flavor_details
request :get_image_details

View File

@ -0,0 +1,34 @@
module Fog
module Compute
class HP
class Real
# Delete a keypair
#
# ==== Parameters
# * key_name<~String> - Name of the keypair to delete
#
def delete_key_pair(key_name)
request(
:expects => 202,
:method => 'DELETE',
:path => "os-keypairs/#{key_name}"
)
end
end
class Mock
def delete_key_pair(key_name)
response = Excon::Response.new
self.data[:key_pairs].delete(key_name)
response.status = 202
response.body = "202 Accepted\n\nThe request is accepted for processing.\n\n "
response
end
end
end
end
end