mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[digitalocean|compute] added some more request
- create_ssh_key - list_ssh_keys
This commit is contained in:
parent
fee3049bfb
commit
ab04e13314
3 changed files with 53 additions and 0 deletions
|
@ -33,6 +33,8 @@ module Fog
|
|||
request :power_off_server
|
||||
request :power_on_server
|
||||
request :shutdown_server
|
||||
request :list_ssh_keys
|
||||
request :create_ssh_key
|
||||
|
||||
# request :digitalocean_resize
|
||||
|
||||
|
|
26
lib/fog/digitalocean/requests/compute/create_ssh_key.rb
Normal file
26
lib/fog/digitalocean/requests/compute/create_ssh_key.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class DigitalOcean
|
||||
class Real
|
||||
|
||||
def create_ssh_key( name, pub_key )
|
||||
request(
|
||||
:expects => [200],
|
||||
:method => 'GET',
|
||||
:path => 'droplets/new',
|
||||
:query => { 'name' => name, 'ssh_pub_key' => pub_key }
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def create_ssh_key( name, pub_key )
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
25
lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
Normal file
25
lib/fog/digitalocean/requests/compute/list_ssh_keys.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class DigitalOcean
|
||||
class Real
|
||||
|
||||
def list_ssh_keys(options = {})
|
||||
request(
|
||||
:expects => [200],
|
||||
:method => 'GET',
|
||||
:path => 'ssh_keys'
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def list_ssh_keys
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue