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

Added Update User command to IAM

This commit is contained in:
coliver 2011-02-23 22:58:07 +08:00 committed by Wesley Beary
parent 1d341d0b04
commit 6052d210af
4 changed files with 67 additions and 1 deletions

View file

@ -15,7 +15,7 @@ GEM
remote: http://rubygems.org/
specs:
builder (3.0.0)
excon (0.5.5)
excon (0.5.6)
formatador (0.0.16)
json (1.5.1)
mime-types (1.16)

View file

@ -28,6 +28,7 @@ module Fog
request :put_user_policy
request :remove_user_from_group
request :update_access_key
request :update_user
request :upload_signing_certificate
class Mock

View file

@ -0,0 +1,26 @@
module Fog
module Parsers
module AWS
module IAM
class UpdateUser < Fog::Parsers::Base
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,39 @@
module Fog
module AWS
class IAM
class Real
require 'fog/aws/parsers/iam/update_user'
# Update a user
#
# ==== Parameters
# * user_name<~String> - Required. Name of the User to update. If you're changing the name of the User, this is the original User name.
# * options<~Hash>:
# * new_path<~String> - New path for the User. Include this parameter only if you're changing the User's path.
# * new_user_name<~String> - New name for the User. Include this parameter only if you're changing the User's name.
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'RequestId'<~String> - Id of the request
# * 'User'<~Hash> - Changed user info
# * 'Arn'<~String> -
# * 'Path'<~String> -
# * 'UserId'<~String> -
# * 'UserName'<~String> -
#
# ==== See Also
# http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateUser.html
#
def update_user(user_name, options = {})
request({
'Action' => 'UpdateUser',
'UserName' => user_name,
:parser => Fog::Parsers::AWS::IAM::UpdateUser.new
}.merge!(options))
end
end
end
end
end