Class: Nexpose::ReportConfigSummary

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

Overview

Data object for report configuration information. Not meant for use in creating new configurations.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_id, name, template_id, status, generated_on, uri, scope) ⇒ ReportConfigSummary

Returns a new instance of ReportConfigSummary.



103
104
105
106
107
108
109
110
111
# File 'lib/nexpose/report.rb', line 103

def initialize(config_id, name, template_id, status, generated_on, uri, scope)
  @config_id = config_id.to_i
  @name = name
  @template_id = template_id
  @status = status
  @generated_on = generated_on
  @uri = uri
  @scope = scope
end

Instance Attribute Details

#config_idObject (readonly)

The report definition (config) ID.



87
88
89
# File 'lib/nexpose/report.rb', line 87

def config_id
  @config_id
end

#generated_onObject (readonly)

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



96
97
98
# File 'lib/nexpose/report.rb', line 96

def generated_on
  @generated_on
end

#nameObject (readonly)

The report config name.



89
90
91
# File 'lib/nexpose/report.rb', line 89

def name
  @name
end

#scopeObject (readonly)

The visibility (scope) of the report definition. One of: (global|silo).



101
102
103
# File 'lib/nexpose/report.rb', line 101

def scope
  @scope
end

#statusObject (readonly)

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



94
95
96
# File 'lib/nexpose/report.rb', line 94

def status
  @status
end

#template_idObject (readonly)

The ID of the report template.



91
92
93
# File 'lib/nexpose/report.rb', line 91

def template_id
  @template_id
end

#uriObject (readonly)

The URL to use to access the report (not set for database exports).



98
99
100
# File 'lib/nexpose/report.rb', line 98

def uri
  @uri
end

Class Method Details

.parse(xml) ⇒ Object



113
114
115
116
117
118
119
120
121
# File 'lib/nexpose/report.rb', line 113

def self.parse(xml)
  ReportConfigSummary.new(xml.attributes['cfg-id'].to_i,
                          xml.attributes['name'],
                          xml.attributes['template-id'],
                          xml.attributes['status'],
                          xml.attributes['generated-on'],
                          xml.attributes['report-URI'],
                          xml.attributes['scope'])
end