Sha256: 89ac46e99b51a28e296aab2adca7ed1e4c4805d7070f1c7d5beb5cfc46533c4d

Contents?: true

Size: 421 Bytes

Versions: 12

Compression:

Stored size: 421 Bytes

Contents

require_relative '../../common'

module Kontena::Cli::Master::User
  class ListCommand < Kontena::Command
    include Kontena::Cli::Common

    def execute
      require_api_url
      token = require_token
      response = client(token).get('users')

      response['users'].each do |user|
        roles = user['roles'].map{|r| r['name']}
        puts "#{user['email']} - #{roles.join(', ')}"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kontena-cli-1.3.0.pre1 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.2 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.2.rc2 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.2.rc1 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.1 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.1.rc1 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0.rc3 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0.rc2 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0.rc1 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0.pre3 lib/kontena/cli/master/user/list_command.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/master/user/list_command.rb