Sha256: e867247520cf828efdb37b0018461e93e123e2793c918cbc385ce47fb779e361

Contents?: true

Size: 514 Bytes

Versions: 9

Compression:

Stored size: 514 Bytes

Contents

require_relative '../../common'

module Kontena::Cli::Master::Users
  class RemoveCommand < 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
          client(token).delete("users/#{email}")
        rescue => exc
          STDERR.puts "Failed to remove user #{email}".colorize(:red)
          STDERR.puts exc.message
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kontena-cli-0.13.4 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.13.3 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.13.2 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.13.1 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.13.0.1 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.13.0 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.12.3 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.12.2 lib/kontena/cli/master/users/remove_command.rb
kontena-cli-0.12.1 lib/kontena/cli/master/users/remove_command.rb