1
0
Fork 0
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:
bdorry 2011-08-02 14:46:21 -04:00
parent 5485747ba4
commit 85af6fd026
7 changed files with 109 additions and 1 deletions

View file

@ -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

View 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

View 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

View 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

View 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

View 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

View file

@ -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