class Fog::AWS::IAM::Groups

Public Instance Methods

all(options = {}) click to toggle source
# File lib/fog/aws/models/iam/groups.rb, line 13
def all(options = {})
  data, records = if self.username
                    response = service.list_groups_for_user(self.username, options)
                    [response.body, response.body['GroupsForUser']]
                  else
                    response = service.list_groups(options)
                    [response.body, response.body['Groups']]
                  end

  merge_attributes(data)
  load(records)
end
get(identity) click to toggle source
# File lib/fog/aws/models/iam/groups.rb, line 26
def get(identity)
  data = service.get_group(identity)

  group = data.body['Group']
  users = data.body['Users'].map { |u| service.users.new(u) }

  new(group.merge(:users => users))
rescue Fog::AWS::IAM::NotFound
  nil
end