Permalink
Browse files

[aws|iam] added update group requests and parsers

  • Loading branch information...
1 parent 10f084e commit 6689c6e0a5fe20e4b4396f1f4919d9528cfb1e22 bdorry committed with Wesley Beary Feb 24, 2011
Showing with 67 additions and 0 deletions.
  1. +1 −0 lib/fog/aws/iam.rb
  2. +27 −0 lib/fog/aws/parsers/iam/update_group.rb
  3. +39 −0 lib/fog/aws/requests/iam/update_group.rb
View
@@ -29,6 +29,7 @@ class IAM < Fog::Service
request :put_user_policy
request :remove_user_from_group
request :update_access_key
+ request :update_group
request :update_user
request :upload_signing_certificate
@@ -0,0 +1,27 @@
+module Fog
+ module Parsers
+ module AWS
+ module IAM
+
+ class UpdateGroup < Fog::Parsers::Base
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateGroup.html
+
+ def reset
+ @response = { 'Group' => {} }
+ end
+
+ def end_element(name)
+ case name
+ when 'Arn', 'GroupId', 'GroupName', 'Path'
+ @response['Group'][name] = @value
+ when 'RequestId'
+ @response[name] = @value
+ end
+ end
+
+ end
+
+ end
+ end
+ end
+end
@@ -0,0 +1,39 @@
+module Fog
+ module AWS
+ class IAM
+ class Real
+
+ require 'fog/aws/parsers/iam/update_group'
+
+ # Update a Group
+ #
+ # ==== Parameters
+ # * group_name<~String> - Required. Name of the Group to update. If you're changing the name of the Group, this is the original Group name.
+ # * options<~Hash>:
+ # * new_path<~String> - New path for the Group. Include this parameter only if you're changing the Group's path.
+ # * new_group_name<~String> - New name for the Group. Include this parameter only if you're changing the Group's name.
+ # ==== Returns
+ # * response<~Excon::Response>:
+ # * body<~Hash>:
+ # * 'RequestId'<~String> - Id of the request
+ # * 'Group'<~Hash> - Changed Group info
+ # * 'Arn'<~String> -
+ # * 'Path'<~String> -
+ # * 'GroupId'<~String> -
+ # * 'GroupName'<~String> -
+ #
+ # ==== See Also
+ # http://docs.amazonwebservices.com/IAM/latest/APIReference/index.html?API_UpdateGroup.html
+ #
+ def update_group(group_name, options = {})
+ request({
+ 'Action' => 'UpdateGroup',
+ 'GroupName' => group_name,
+ :parser => Fog::Parsers::AWS::IAM::UpdateGroup.new
+ }.merge!(options))
+ end
+
+ end
+ end
+ end
+end

0 comments on commit 6689c6e

Please sign in to comment.