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:
parent
1d341d0b04
commit
6052d210af
4 changed files with 67 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
26
lib/fog/aws/parsers/iam/update_user.rb
Normal file
26
lib/fog/aws/parsers/iam/update_user.rb
Normal 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
|
39
lib/fog/aws/requests/iam/update_user.rb
Normal file
39
lib/fog/aws/requests/iam/update_user.rb
Normal 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
|
Loading…
Add table
Reference in a new issue