class Nexpose::ReportSummary

Summary of a single report.

Attributes

config_id[R]

The report definition (configuration) ID.

generated_on[R]

The date and time the report was generated, in ISO 8601 format.

id[R]

The ID of the generated report.

status[R]

The current status of the report. One of: Started|Generated|Failed|Aborted|Unknown

uri[R]

The relative URI to use to access the report.

Public Class Methods

new(id, config_id, status, generated_on, uri) click to toggle source
# File lib/nexpose/report.rb, line 140
def initialize(id, config_id, status, generated_on, uri)
  @id           = id
  @config_id    = config_id.to_i
  @status       = status
  @generated_on = generated_on
  @uri          = uri
end
parse(xml) click to toggle source
# File lib/nexpose/report.rb, line 153
def self.parse(xml)
  ReportSummary.new(xml.attributes['id'],
                    xml.attributes['cfg-id'],
                    xml.attributes['status'],
                    xml.attributes['generated-on'],
                    xml.attributes['report-URI'])
end
parse_all(response) click to toggle source
# File lib/nexpose/report.rb, line 161
def self.parse_all(response)
  summaries = []
  if response.success
    response.res.elements.each('//ReportSummary') do |summary|
      summaries << ReportSummary.parse(summary)
    end
  end
  summaries
end

Public Instance Methods

delete(connection) click to toggle source

Delete this report.

# File lib/nexpose/report.rb, line 149
def delete(connection)
  connection.delete_report(@id)
end