-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add methods to retrieve paused scans #196
Add methods to retrieve paused scans #196
Conversation
@site_id = json['Site ID'] | ||
@status = CompletedScan._parse_status(json['Status Code']) | ||
@start_time = Time.at(json['Started'].to_i / 1000) | ||
@end_time = Time.at(json['Progress'].to_i / 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use Time.at
without zone. Use one of Time.zone.at
, Time.at.current
, Time.at.in_time_zone
, Time.at.utc
, Time.at.getlocal
, Time.at.iso8601
, Time.at.jisx0301
, Time.at.rfc3339
, Time.at.to_i
, Time.at.to_f
instead.
8e5edff
to
3bf1ed4
Compare
Two separate methods for site scans and all scans using two different data table endpoints. Added new class ActiveScan based on CompletedScan to handle parsing the data differently.
Forgot to map the global paused scans to ActiveScan objects. Cleaned up doc a bit. Make site_id not default to nil since it is required for the method.
end | ||
else | ||
uri = '/data/site/scans/dyntable.xml?printDocType=0&tableID=siteScansTable&activeOnly=true' | ||
data = DataTable._get_dyn_table(self, uri).select { |scan| (scan['Status'].include? 'Paused')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing inside }.
Add methods to retrieve paused scans
Two separate methods for site scans and all scans using two different data table endpoints. This may or may not allow for some more efficiency when checking specific sites.
Added new class ActiveScan based on CompletedScan to handle parsing the data differently.
Testing required:
A pre-built gem can be downloaded at http://gavinws.com/nexpose-2.3.0.pre.gem otherwise set your gemfile to use my fork and branch.
Resolves #193