Class: OpscodeAcl::UserInviteAdd

Inherits:
Chef::Knife
  • Object
show all
Defined in:
lib/chef/knife/user_invite_add.rb

Instance Method Summary collapse

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/chef/knife/user_invite_add.rb', line 24

def run
  if name_args.length < 1
    show_usage
    ui.fatal("You must specify a username.")
    exit 1
  end

  users = name_args
  api_endpoint = "association_requests/"
  users.each do |u|
    body = { user: u }
    rest.post_rest(api_endpoint, body)
  end
end