class Awscli::Iam::Group
Public Class Methods
new(connection)
click to toggle source
# File lib/awscli/iam.rb, line 233 def initialize(connection) @conn = connection end
Public Instance Methods
create(groupname, path)
click to toggle source
# File lib/awscli/iam.rb, line 244 def create(groupname, path) @conn.create_group(groupname, path ||= '/') puts "Created group: #{groupname}" rescue Fog::AWS::IAM::ValidationError puts "ValidationError: #{$!}" rescue Fog::AWS::IAM::EntityAlreadyExists puts "[Error] Group Exists: #{$!}" end
delete(groupname)
click to toggle source
# File lib/awscli/iam.rb, line 253 def delete(groupname) @conn.delete_group(groupname) puts "Create group: #{groupname}" rescue Fog::AWS::IAM::NotFound puts "[Error]: #{$!}" end
list(path)
click to toggle source
# File lib/awscli/iam.rb, line 237 def list(path) groups = @conn.list_groups('PathPrefix' => path).body['Groups'] Formatador.display_table(groups) rescue Fog::AWS::IAM::ValidationError puts "ValidationError: #{$!}" end