Sha256: 511637795774c6cb6a8f5794270214c2e0e76acc3091988d1d84613cde50819f

Contents?: true

Size: 582 Bytes

Versions: 25

Compression:

Stored size: 582 Bytes

Contents

require_relative '../../common'

module Kontena::Cli::Master::Users
  class InviteCommand < Clamp::Command
    include Kontena::Cli::Common

    parameter "EMAIL ...", "List of emails"

    def execute
      require_api_url
      token = require_token
      email_list.each do |email|
        begin
          data = { email: email }
          response = client(token).post('users', data)
          puts "Invited #{email} (no email gets sent)"
        rescue
          puts "Failed to invite #{email}".colorize(:red)
          puts exc.message
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.4 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.3 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.2 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.1 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.0 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.7 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.6 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.5 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.4 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.3 lib/kontena/cli/master/users/invite_command.rb
kontena-cli-0.14.2 lib/kontena/cli/master/users/invite_command.rb