Class: Fog::AWS::IAM::Roles
- Inherits:
-
Collection
- Object
- Collection
- Fog::AWS::IAM::Roles
- Defined in:
- lib/fog/aws/models/iam/roles.rb
Instance Method Summary collapse
- #all ⇒ Object
- #get(identity) ⇒ Object
-
#initialize(attributes = {}) ⇒ Roles
constructor
A new instance of Roles.
- #new(attributes = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Roles
Returns a new instance of Roles.
10 11 12 |
# File 'lib/fog/aws/models/iam/roles.rb', line 10 def initialize(attributes = {}) super end |
Instance Method Details
#all ⇒ Object
14 15 16 17 |
# File 'lib/fog/aws/models/iam/roles.rb', line 14 def all data = service.list_roles.body['Roles'] load(data) end |
#get(identity) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/models/iam/roles.rb', line 19 def get(identity) role = nil begin role = service.roles.new( service.get_role( identity ).data[:body]["Role"] ) rescue Excon::Errors::NotFound # ignore not found error end role end |
#new(attributes = {}) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/fog/aws/models/iam/roles.rb', line 28 def new(attributes = {}) if not attributes.key?(:assume_role_policy_document) attributes[:assume_role_policy_document] = Fog::AWS::IAM::EC2_ASSUME_ROLE_POLICY.to_s end super end |