class Nexpose::AdHocSchedule
Configuration structure for ad-hoc schedules
Attributes
max_duration[RW]
The amount of time, in minutes, to allow execution before stopping.
scan_template_id[RW]
The template to use to scan the assets
start[RW]
Start time in ISO8601
format
Public Class Methods
new(start, scan_template_id, max_duration = nil)
click to toggle source
# File lib/nexpose/common.rb, line 110 def initialize(start, scan_template_id, max_duration = nil) @start = start @scan_template_id = scan_template_id @max_duration = max_duration if max_duration end
Public Instance Methods
as_xml()
click to toggle source
# File lib/nexpose/common.rb, line 116 def as_xml xml = REXML::Element.new('AdHocSchedule') xml.attributes['start'] = @start xml.attributes['maxDuration'] = @max_duration if @max_duration xml.attributes['template'] = @scan_template_id xml end
from_hash(hash)
click to toggle source
# File lib/nexpose/common.rb, line 124 def from_hash(hash) schedule = AdHocSchedule.new(hash[:start], hash[:scan_template_id]) schedule.max_duration = hash[:max_duration] if hash[:max_duration] schedule end
to_xml()
click to toggle source
# File lib/nexpose/common.rb, line 130 def to_xml as_xml.to_s end