1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|iam] get_user implementation

This commit is contained in:
John E. Vincent 2010-12-22 03:08:44 +08:00 committed by Wesley Beary
parent 9d6d16b425
commit 6a9b4b0bc6
3 changed files with 72 additions and 0 deletions

View file

@ -15,6 +15,7 @@ module Fog
request :delete_group_policy
request :delete_user
request :delete_user_policy
request :get_user
request :list_access_keys
request :list_groups
request :list_group_policies

View file

@ -0,0 +1,27 @@
module Fog
module Parsers
module AWS
module IAM
class GetUser < Fog::Parsers::Base
# http://docs.amazonwebservices.com/IAM/latest/APIReference/API_GetUser.html
def reset
@response = { 'User' => {} }
end
def end_element(name)
case name
when 'Arn', 'UserId', 'UserName', 'Path'
@response['User'][name] = @value
when 'RequestId'
@response[name] = @value
end
end
end
end
end
end
end

View file

@ -0,0 +1,44 @@
module Fog
module AWS
class IAM
class Real
require 'fog/aws/parsers/iam/get_user'
# Get User
#
# ==== Parameters
# * options<~Hash>:
# * 'UserName'<~String>: Name of the User. Defaults to current user
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'User'<~Hash> - User
# * Arn<~String> -
# * UserId<~String> -
# * UserName<~String> -
# * Path<~String> -
#
# ==== See Also
# http://docs.amazonwebservices.com/IAM/latest/APIReference/API_Getuser.html
#
def get_user(options = {})
request({
'Action' => 'GetUser',
:parser => Fog::Parsers::AWS::IAM::GetUser.new
}.merge!(options))
end
end
class Mock
def get_user(options = {})
Fog::Mock.not_implemented
end
end
end
end
end