lib/dsc/anti_malware_event_command.rb
# `list` Implementation.
# List all entries of the `transport_class` type according to given filter parameters.
# @param options [Hash<Symbol => Object>] Merged global/local options from GLI
# @option options [String] :fields The fields to display.
# @option options [String] :time_filter Timeframe to request.
# @param args [Array<String>] Arguments from GLI
# @return [void]
`list` Implementation.
List all entries of the `transport_class` type according to given filter parameters.
` list ` Implementation . List all entries of the ` transport_class ` type according to given filter parameters .
def list_command(options, args)
      fields = parse_fields(options[:fields])
      time_filter = parse_time_filter(options[:time_filter])
      parse_time_format(options[:time_format])
      output do |output|
        authenticate do |manager|
          progressBar = ProgressBar.new("anti_malware_event", 100) if @show_progress_bar
          manager.hosts() 
          progressBar.set(10) if @show_progress_bar
          hostFilter = DeepSecurity::HostFilter.all_hosts
          eventIdFilter = DeepSecurity::IDFilter.greater_than(0)
          anti_malware_events = manager.anti_malware_events_by_time_host_event(time_filter, hostFilter, eventIdFilter)
          progressBar.set(25) if @show_progress_bar
          csv = CSV.new(output)
          csv << fields
          anti_malware_events.each do |anti_malware_event|
            progressBar.inc(75/anti_malware_events.size) if @show_progress_bar
            csv << fields.map do |attribute|
              begin
                to_display_string(anti_malware_event.instance_eval(attribute))
              rescue => e
                "ERROR (#{e.message}"
              end
            end
          end
          progressBar.finish if @show_progress_bar
        end
      end
    end
def list_command ( options , args ) fields = parse_fields ( options [ :fields ] ) time_filter = parse_time_filter ( options [ :time_filter ] ) parse_time_format ( options [ :time_format ] ) output do | output | authenticate do | manager | progressBar = ProgressBar . new ( "anti_malware_event" , 100 ) if @show_progress_bar manager . hosts ( ) progressBar . set ( 10 ) if @show_progress_bar hostFilter = DeepSecurity :: HostFilter . all_hosts eventIdFilter = DeepSecurity :: IDFilter . greater_than ( 0 ) anti_malware_events = manager . anti_malware_events_by_time_host_event ( time_filter , hostFilter , eventIdFilter ) progressBar . set ( 25 ) if @show_progress_bar csv = CSV . new ( output ) csv << fields anti_malware_events . each do | anti_malware_event | progressBar . inc ( 75 / anti_malware_events . size ) if @show_progress_bar csv << fields . map do | attribute | begin to_display_string ( anti_malware_event . instance_eval ( attribute ) ) rescue => e "ERROR (#{e.message}" end end end progressBar . finish if @show_progress_bar end end end
`list` Implementation.
` list ` Implementation .
# Make sure that hosts are cached
None
void
options
:time_filter Timeframe to request.
: time_filter Timeframe to request .
args
Arguments from GLI
Arguments from GLI