mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Added url reference for update_user parser. Added get_group to IAM. Note: The excon response is not properly adding the Arn to the Users because both the group and user have an element named 'arn'. I'm not sure how to handle this.
This commit is contained in:
parent
6052d210af
commit
1dd105325c
4 changed files with 82 additions and 1 deletions
|
@ -17,6 +17,7 @@ module Fog
|
|||
request :delete_user
|
||||
request :delete_user_policy
|
||||
request :get_user
|
||||
request :get_group
|
||||
request :list_access_keys
|
||||
request :list_groups
|
||||
request :list_groups_for_user
|
||||
|
|
35
lib/fog/aws/parsers/iam/get_group.rb
Normal file
35
lib/fog/aws/parsers/iam/get_group.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module IAM
|
||||
|
||||
class GetGroup < Fog::Parsers::Base
|
||||
# http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_GetGroup.html
|
||||
|
||||
def reset
|
||||
@user = {}
|
||||
@response = { 'Group' => {}, 'Users' => [] }
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'GroupName', 'GroupId', 'Arn'
|
||||
@response['Group'][name] = @value
|
||||
when 'UserId', 'UserName', 'Path', 'Arn'
|
||||
@user[name] = @value
|
||||
when 'member'
|
||||
@response['Users'] << @user
|
||||
@user = {}
|
||||
when 'IsTruncated'
|
||||
response[name] = (@value == 'true')
|
||||
when 'Marker', 'RequestId'
|
||||
@response[name] = @value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -4,7 +4,8 @@ module Fog
|
|||
module IAM
|
||||
|
||||
class UpdateUser < Fog::Parsers::Base
|
||||
|
||||
# http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateUser.html
|
||||
|
||||
def reset
|
||||
@response = { 'User' => {} }
|
||||
end
|
||||
|
|
44
lib/fog/aws/requests/iam/get_group.rb
Normal file
44
lib/fog/aws/requests/iam/get_group.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class IAM
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/iam/get_group'
|
||||
|
||||
# Get Group
|
||||
#
|
||||
# ==== Parameters
|
||||
# * 'GroupName'<~String>: Name of the Group
|
||||
# * options<~Hash>:
|
||||
# * 'Marker'<~String>: Use this only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.
|
||||
# * 'MaxItems'<~String>: Use this only when paginating results to indicate the maximum number of User names you want in the response. If there are additional User names beyond the maximum you specify, the IsTruncated response element is true.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'Group'<~Hash> - Group
|
||||
# * 'Path'<~String>
|
||||
# * 'GroupName'<~String>
|
||||
# * 'Arn'<~String>
|
||||
# * 'Users'<~Hash>? - List of users belonging to the group.
|
||||
# * 'User'<~Hash> - User
|
||||
# * Arn<~String> -
|
||||
# * UserId<~String> -
|
||||
# * UserName<~String> -
|
||||
# * Path<~String> -
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_GetGroup.html
|
||||
#
|
||||
def get_group(group_name, options = {})
|
||||
request({
|
||||
'Action' => 'GetGroup',
|
||||
'GroupName' => group_name,
|
||||
:parser => Fog::Parsers::AWS::IAM::GetGroup.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue