mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Enable delete_key_pair request method and implement it, along with mocking support.
This commit is contained in:
parent
f15faa6b17
commit
91f5ac41de
2 changed files with 36 additions and 1 deletions
|
@ -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
|
||||
|
|
34
lib/fog/hp/requests/compute/delete_key_pair.rb
Normal file
34
lib/fog/hp/requests/compute/delete_key_pair.rb
Normal 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
|
Loading…
Reference in a new issue