Class: Nexpose::ReportSummary
- Inherits:
-
Object
- Object
- Nexpose::ReportSummary
- Defined in:
- lib/nexpose/report.rb
Overview
Summary of a single report.
Instance Attribute Summary collapse
-
#config_id ⇒ Object
readonly
The report definition (configuration) ID.
-
#generated_on ⇒ Object
readonly
The date and time the report was generated, in ISO 8601 format.
-
#id ⇒ Object
readonly
The ID of the generated report.
-
#status ⇒ Object
readonly
The current status of the report.
-
#uri ⇒ Object
readonly
The relative URI to use to access the report.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete(connection) ⇒ Object
Delete this report.
-
#initialize(id, config_id, status, generated_on, uri) ⇒ ReportSummary
constructor
A new instance of ReportSummary.
Constructor Details
#initialize(id, config_id, status, generated_on, uri) ⇒ ReportSummary
Returns a new instance of ReportSummary.
136 137 138 139 140 141 142 |
# File 'lib/nexpose/report.rb', line 136 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 |
Instance Attribute Details
#config_id ⇒ Object (readonly)
The report definition (configuration) ID.
127 128 129 |
# File 'lib/nexpose/report.rb', line 127 def config_id @config_id end |
#generated_on ⇒ Object (readonly)
The date and time the report was generated, in ISO 8601 format.
132 133 134 |
# File 'lib/nexpose/report.rb', line 132 def generated_on @generated_on end |
#id ⇒ Object (readonly)
The ID of the generated report.
125 126 127 |
# File 'lib/nexpose/report.rb', line 125 def id @id end |
#status ⇒ Object (readonly)
The current status of the report. One of: Started|Generated|Failed|Aborted|Unknown
130 131 132 |
# File 'lib/nexpose/report.rb', line 130 def status @status end |
#uri ⇒ Object (readonly)
The relative URI to use to access the report.
134 135 136 |
# File 'lib/nexpose/report.rb', line 134 def uri @uri end |
Class Method Details
.parse(xml) ⇒ Object
149 150 151 152 153 154 155 |
# File 'lib/nexpose/report.rb', line 149 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) ⇒ Object
157 158 159 160 161 162 163 164 165 |
# File 'lib/nexpose/report.rb', line 157 def self.parse_all(response) summaries = [] if response.success response.res.elements.each('//ReportSummary') do |summary| summaries << ReportSummary.parse(summary) end end summaries end |
Instance Method Details
#delete(connection) ⇒ Object
Delete this report.
145 146 147 |
# File 'lib/nexpose/report.rb', line 145 def delete(connection) connection.delete_report(@id) end |