Class: Fog::AWS::IAM::ManagedPolicies

Inherits:
PagedCollection show all
Defined in:
lib/fog/aws/models/iam/managed_policies.rb

Instance Method Summary collapse

Methods inherited from PagedCollection

#each, #each_entry, inherited

Instance Method Details

#all(options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/fog/aws/models/iam/managed_policies.rb', line 14

def all(options={})
  data = if self.username
           all_by_user(self.username, options)
         elsif self.group_name
           all_by_group(self.group_name, options)
         else
           all_policies(options)
         end

  load(data)
end

#get(identity) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/fog/aws/models/iam/managed_policies.rb', line 26

def get(identity)
  response = service.get_policy(identity)

  new(response.body['Policy'])
rescue Fog::AWS::IAM::NotFound
  nil
end