mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|cloudstack] added user management support
This commit is contained in:
parent
5485747ba4
commit
85af6fd026
7 changed files with 109 additions and 1 deletions
|
@ -9,6 +9,13 @@ module Fog
|
|||
|
||||
request_path 'fog/compute/requests/cloudstack'
|
||||
|
||||
request :create_user
|
||||
|
||||
request :delete_user
|
||||
|
||||
request :disable_user
|
||||
request :enable_user
|
||||
|
||||
request :list_accounts
|
||||
request :list_alerts
|
||||
request :list_async_jobs
|
||||
|
@ -39,6 +46,7 @@ module Fog
|
|||
request :list_volumes
|
||||
request :list_zones
|
||||
|
||||
request :update_user
|
||||
|
||||
class Mock
|
||||
|
||||
|
|
20
lib/fog/compute/requests/cloudstack/create_user.rb
Normal file
20
lib/fog/compute/requests/cloudstack/create_user.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a user for an account that already exists
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/createUser.html]
|
||||
def create_user(options={})
|
||||
options.merge!(
|
||||
'command' => 'createUser'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/fog/compute/requests/cloudstack/delete_user.rb
Normal file
20
lib/fog/compute/requests/cloudstack/delete_user.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a user for an account that already exists
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/deleteUser.html]
|
||||
def delete_user(options={})
|
||||
options.merge!(
|
||||
'command' => 'deleteUser'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/fog/compute/requests/cloudstack/disable_user.rb
Normal file
20
lib/fog/compute/requests/cloudstack/disable_user.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a user for an account that already exists
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/disableUser.html]
|
||||
def disable_user(options={})
|
||||
options.merge!(
|
||||
'command' => 'disableUser'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/fog/compute/requests/cloudstack/enable_user.rb
Normal file
20
lib/fog/compute/requests/cloudstack/enable_user.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a user for an account that already exists
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/disableUser.html]
|
||||
def enable_user(options={})
|
||||
options.merge!(
|
||||
'command' => 'enableUser'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/fog/compute/requests/cloudstack/update_user.rb
Normal file
20
lib/fog/compute/requests/cloudstack/update_user.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Cloudstack
|
||||
class Real
|
||||
|
||||
# Creates a user for an account that already exists
|
||||
#
|
||||
# {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/updateUser.html]
|
||||
def update_user(options={})
|
||||
options.merge!(
|
||||
'command' => 'updateUser'
|
||||
)
|
||||
|
||||
request(options)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -14,7 +14,7 @@ module Fog
|
|||
end
|
||||
|
||||
def self.signed_params(key,params)
|
||||
query = params.to_a.sort.collect{|c| "#{c[0]}=#{escape(c[1])}"}.join('&').downcase
|
||||
query = params.to_a.sort.collect{|c| "#{c[0]}=#{escape(c[1].to_s)}"}.join('&').downcase
|
||||
|
||||
signed_string = Base64.encode64(OpenSSL::HMAC.digest(DIGEST,key,query)).strip
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue