Class: Nexpose::SiteScanHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/site.rb

Overview

Description

Object that represents the scan history of a site.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, id) ⇒ SiteScanHistory

Returns a new instance of SiteScanHistory.



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/nexpose/site.rb', line 502

def initialize(connection, id)
  @site_id = id
  @error = false
  @connection = connection
  @scan_summaries = []

  @request_xml = '<SiteScanHistoryRequest' + ' session-id="' + @connection.session_id + '" site-id="' + "#{@site_id}" + '"/>'
  r = @connection.execute(@request_xml)
  @response = r

  if r and r.success
    r.res.elements.each('//ScanSummary') do |summary|
      scan_id=summary.attributes['scan-id'].to_i
      engine_id=summary.attributes['engine-id'].to_i
      name=summary.attributes['name'].to_s
      start_time=summary.attributes['startTime'].to_s
      end_time=summary.attributes['endTime'].to_s
      status=summary.attributes['status'].to_s
      scan_summary = ScanSummary.new(scan_id, engine_id, name, start_time, end_time, status)
      scan_summaries << scan_summary
    end
  end
end

Instance Attribute Details

#connectionObject (readonly)

The NSC Connection associated with this object



496
497
498
# File 'lib/nexpose/site.rb', line 496

def connection
  @connection
end

#errorObject (readonly)

true if an error condition exists; false otherwise



488
489
490
# File 'lib/nexpose/site.rb', line 488

def error
  @error
end

#error_msgObject (readonly)

Error message string



490
491
492
# File 'lib/nexpose/site.rb', line 490

def error_msg
  @error_msg
end

#request_xmlObject (readonly)

The last XML request sent by this object



492
493
494
# File 'lib/nexpose/site.rb', line 492

def request_xml
  @request_xml
end

#responseObject (readonly)

The last response received by this object



494
495
496
# File 'lib/nexpose/site.rb', line 494

def response
  @response
end

#scan_summariesObject (readonly)

//Array containing (ScanSummary*)



500
501
502
# File 'lib/nexpose/site.rb', line 500

def scan_summaries
  @scan_summaries
end

#site_idObject (readonly)

The Site ID



498
499
500
# File 'lib/nexpose/site.rb', line 498

def site_id
  @site_id
end