Class: Nexpose::ScanFilter
- Inherits:
-
Object
- Object
- Nexpose::ScanFilter
- Defined in:
- lib/nexpose/scan.rb,
lib/nexpose/alert.rb
Overview
Scan filter for alerting. Set values to 1 to enable and 0 to disable.
Instance Attribute Summary collapse
-
#fail ⇒ Object
Scan events to alert on.
-
#pause ⇒ Object
Scan events to alert on.
-
#resume ⇒ Object
Scan events to alert on.
-
#scan_failed ⇒ Object
readonly
Returns the value of attribute scan_failed.
-
#scan_start ⇒ Object
readonly
Returns the value of attribute scan_start.
-
#scan_stop ⇒ Object
readonly
Returns the value of attribute scan_stop.
-
#start ⇒ Object
Scan events to alert on.
-
#stop ⇒ Object
Scan events to alert on.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) ⇒ ScanFilter
constructor
A new instance of ScanFilter.
- #to_xml ⇒ Object
Constructor Details
#initialize(start = 0, stop = 0, fail = 0, resume = 0, pause = 0) ⇒ ScanFilter
Returns a new instance of ScanFilter.
281 282 283 284 285 |
# File 'lib/nexpose/scan.rb', line 281 def initialize(scan_stop, scan_failed, scan_start) @scan_stop = scan_stop @scan_failed = scan_failed @scan_start = scan_start end |
Instance Attribute Details
#fail ⇒ Object
Scan events to alert on.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def fail @fail end |
#pause ⇒ Object
Scan events to alert on.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def pause @pause end |
#resume ⇒ Object
Scan events to alert on.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def resume @resume end |
#scan_failed ⇒ Object (readonly)
Returns the value of attribute scan_failed.
278 279 280 |
# File 'lib/nexpose/scan.rb', line 278 def scan_failed @scan_failed end |
#scan_start ⇒ Object (readonly)
Returns the value of attribute scan_start.
279 280 281 |
# File 'lib/nexpose/scan.rb', line 279 def scan_start @scan_start end |
#scan_stop ⇒ Object (readonly)
Returns the value of attribute scan_stop.
277 278 279 |
# File 'lib/nexpose/scan.rb', line 277 def scan_stop @scan_stop end |
#start ⇒ Object
Scan events to alert on.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def start @start end |
#stop ⇒ Object
Scan events to alert on.
73 74 75 |
# File 'lib/nexpose/alert.rb', line 73 def stop @stop end |
Class Method Details
.parse(xml) ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/nexpose/alert.rb', line 89 def self.parse(xml) new(xml.attributes['scanStart'].to_i, xml.attributes['scanStop'].to_i, xml.attributes['scanFailed'].to_i, xml.attributes['scanResumed'].to_i, xml.attributes['scanPaused'].to_i) end |
Instance Method Details
#to_xml ⇒ Object
79 80 81 82 83 84 85 86 87 |
# File 'lib/nexpose/alert.rb', line 79 def to_xml xml = '<scanFilter' xml << %Q( scanStart="#{@start}") xml << %Q( scanStop="#{@stop}") xml << %Q( scanFailed="#{@fail}") xml << %Q( scanResumed="#{@resume}") xml << %Q( scanPaused="#{@pause}") xml << '/>' end |