mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Adding ability to get gogrid default passwords that get generated for each new virtual server.
Also ability to list all default or stored root passwords on gogrid.
This commit is contained in:
parent
31fe9282a0
commit
8a400e2ef0
5 changed files with 80 additions and 2 deletions
|
@ -11,6 +11,8 @@ module Fog
|
|||
collection :images
|
||||
model :server
|
||||
collection :servers
|
||||
model :password
|
||||
collection :passwords
|
||||
|
||||
request_path 'fog/compute/requests/go_grid'
|
||||
request :common_lookup_list
|
||||
|
@ -23,6 +25,8 @@ module Fog
|
|||
request :grid_server_get
|
||||
request :grid_server_list
|
||||
request :grid_server_power
|
||||
request :support_password_get
|
||||
request :support_password_list
|
||||
|
||||
class Mock
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ module Fog
|
|||
|
||||
attribute :server_id
|
||||
attribute :applicationtype
|
||||
attribute :username # server.ram
|
||||
attribute :username
|
||||
attribute :password_id, :aliases => 'id'
|
||||
attribute :password
|
||||
attribute :server
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/go_grid/models/compute/password'
|
||||
require 'fog/compute/models/go_grid/password'
|
||||
|
||||
module Fog
|
||||
module GoGrid
|
||||
|
|
36
lib/fog/compute/requests/go_grid/support_password_get.rb
Normal file
36
lib/fog/compute/requests/go_grid/support_password_get.rb
Normal file
|
@ -0,0 +1,36 @@
|
|||
module Fog
|
||||
module GoGrid
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# Get one or more passwords by id
|
||||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash>:
|
||||
# * 'id'<~String> - id of the password to retrieve
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# TODO: docs
|
||||
def support_password_get(id, options={})
|
||||
request(
|
||||
:path => 'support/password/get',
|
||||
:query => {
|
||||
'id' => id
|
||||
}.merge!(options)
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def support_password_get(options={})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
38
lib/fog/compute/requests/go_grid/support_password_list.rb
Normal file
38
lib/fog/compute/requests/go_grid/support_password_list.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
module Fog
|
||||
module GoGrid
|
||||
class Compute
|
||||
class Real
|
||||
|
||||
# List passwords
|
||||
#
|
||||
# ==== Parameters
|
||||
# * options<~Hash>:
|
||||
# * 'datacenter'<~String> - datacenter to limit results to
|
||||
# * 'isSandbox'<~String> - If true only returns Image Sandbox servers, in ['false', 'true']
|
||||
# * 'num_items'<~Integer> - Number of items to return
|
||||
# * 'page'<~Integer> - Page index for paginated results
|
||||
# * 'server.type'<~String> - server type to limit results to
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Array>:
|
||||
# TODO: docs
|
||||
def support_password_list(options={})
|
||||
request(
|
||||
:path => 'support/password/list',
|
||||
:query => options
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def support_password_list(options={})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue