Sha256: 707154150fa725485defb21a5479f094b569313b59f603ad51f537ebb9a0bc83

Contents?: true

Size: 763 Bytes

Versions: 158

Compression:

Stored size: 763 Bytes

Contents

module Kontena::Cli::Master
  class AuditLogCommand < Kontena::Command
    include Kontena::Cli::Common

    option ["-l", "--lines"], "LINES", "Number of lines"

    requires_current_master
    requires_current_master_token

    def execute
      audit_logs = client.get("audit_logs", {limit: lines})
      puts '%-30.30s %-10s %-15s %-25s %-15s %-25s %-15s %-15s' % ['Time', 'Grid', 'Resource Type', 'Resource Name', 'Event Name', 'User', 'Source IP', 'User-Agent']
      audit_logs['logs'].each do |log|
        puts '%-30.30s %-10s %-15s %-25s %-15s %-25s %-15s %-15s' % [ log['time'], log['grid'], log['resource_type'], log['resource_name'], log['event_name'], log['user_identity']['email'], log['source_ip'], log['user_agent']]
      end
    end
  end
end

Version data entries

158 entries across 158 versions & 2 rubygems

Version Path
kontena-cli-1.4.1.rc1 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.3.5 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/master/audit_log_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/master/audit_log_command.rb