lib/dsc/host_detail_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] :detail_level Query Level 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])
      detail_level = parse_detail_level(options[:detail_level])
      parse_time_format(options[:time_format])
      output do |output|
        authenticate do |manager|
          hostFilter = DeepSecurity::HostFilter.all_hosts
          progressBar = ProgressBar.new("host_status", 100) if @show_progress_bar
          hostDetails = manager.host_details(hostFilter, detail_level)
          progressBar.set(25) if @show_progress_bar
          csv = CSV.new(output)
          csv << fields
          hostDetails.each do |hostDetail|
            progressBar.inc(75/hostDetails.size) if @show_progress_bar
            csv << fields.map do |attribute|
              begin
                to_display_string(hostDetail.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 ] ) detail_level = parse_detail_level ( options [ :detail_level ] ) parse_time_format ( options [ :time_format ] ) output do | output | authenticate do | manager | hostFilter = DeepSecurity :: HostFilter . all_hosts progressBar = ProgressBar . new ( "host_status" , 100 ) if @show_progress_bar hostDetails = manager . host_details ( hostFilter , detail_level ) progressBar . set ( 25 ) if @show_progress_bar csv = CSV . new ( output ) csv << fields hostDetails . each do | hostDetail | progressBar . inc ( 75 / hostDetails . size ) if @show_progress_bar csv << fields . map do | attribute | begin to_display_string ( hostDetail . instance_eval ( attribute ) ) rescue => e "ERROR (#{e.message})" end end end progressBar . finish if @show_progress_bar end end end
`list` Implementation.
` list ` Implementation .
None
void
options
:detail_level Query Level to request.
: detail_level Query Level to request .
args
Arguments from GLI
Arguments from GLI