Class: AwsCli::CLI::IAM::User

Inherits:
Thor
  • Object
show all
Defined in:
lib/awscli/cli/iam/user.rb

Instance Method Summary collapse

Instance Method Details

#addtogroupObject



80
81
82
83
# File 'lib/awscli/cli/iam/user.rb', line 80

def addtogroup
  create_iam_object
  @iam.add_user_to_group options[:user_name], options[:group_name]
end

#cakObject



44
45
46
47
# File 'lib/awscli/cli/iam/user.rb', line 44

def cak
  create_iam_object
  @iam.create_user_access_key options[:user_name]
end

#createObject



27
28
29
30
# File 'lib/awscli/cli/iam/user.rb', line 27

def create
  create_iam_object
  @iam.create options[:user_name], options[:path]
end

#dakObject



59
60
61
62
# File 'lib/awscli/cli/iam/user.rb', line 59

def dak
  create_iam_object
  @iam.delete_user_access_key options[:user_name], options[:access_key_id]
end

#deleteObject



34
35
36
37
# File 'lib/awscli/cli/iam/user.rb', line 34

def delete
  create_iam_object
  @iam.delete options[:user_name]
end

#lakObject



51
52
53
54
# File 'lib/awscli/cli/iam/user.rb', line 51

def lak
  create_iam_object
  @iam.list_user_access_keys options[:user_name]
end

#listObject

method_option :marker, :aliases => ‘-m’, :desc => ‘used to paginate subsequent requests’ method_option :maxitems, :alises => ‘-i’, :type => :numeric, :desc => ‘limit results to this number per page’



14
15
16
17
# File 'lib/awscli/cli/iam/user.rb', line 14

def list
  create_iam_object
  @iam.list options[:path]
end

#listgroupsObject



95
96
97
98
# File 'lib/awscli/cli/iam/user.rb', line 95

def listgroups
  create_iam_object
  @iam.list_groups_for_user options[:user_name]
end

#passwdObject



105
106
107
108
109
110
111
112
# File 'lib/awscli/cli/iam/user.rb', line 105

def passwd
  create_iam_object
  if options[:remove]
    @iam.remove_password options[:user_name]
  else
    @iam.assign_password options[:user_name], options[:password], options[:genereate]
  end
end

#removefromgroupObject



88
89
90
91
# File 'lib/awscli/cli/iam/user.rb', line 88

def removefromgroup
  create_iam_object
  @iam.remove_user_from_group options[:user_name], options[:group_name]
end

#updateObject



68
69
70
71
72
73
74
75
# File 'lib/awscli/cli/iam/user.rb', line 68

def update
  create_iam_object
  if !options[:new_user_name] and !options[:new_path]
    puts 'Should pass atleast one option to change, either --new-user-name (or) --new-path'
    exit
  end
  @iam.update_user options
end