Sha256: 1f7c4e8fab1d82348d2c10869ffe11df7801a6a34cb9b9ead1d7de9906087abc

Contents?: true

Size: 629 Bytes

Versions: 22

Compression:

Stored size: 629 Bytes

Contents

require_relative '../../common'

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

    parameter "EMAIL ...", "List of emails"
    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    def execute
      require_api_url
      token = require_token
      confirm unless forced?

      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

22 entries across 22 versions & 1 rubygems

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