class Nexpose::CompletedAsset
Summary object of a completed asset for a scan.
Attributes
duration[R]
Time it took to scan the asset, in milliseconds.
host_name[R]
Host name of the asset, if discovered.
id[R]
Unique identifier of an asset.
ip[R]
IP address of the asset.
os[R]
Operating system fingerprint of the asset.
status[R]
Status of the asset on scan completion. One of :completed, :error, or :stopped.
vulns[R]
Number of vulnerabilities discovered on the asset.
Public Class Methods
new(&block)
click to toggle source
Internal constructor to be called by parse_json.
# File lib/nexpose/device.rb, line 207 def initialize(&block) instance_eval(&block) if block_given? end
parse_json(json)
click to toggle source
Internal method for converting a JSON representation into a CompletedScan
object.
# File lib/nexpose/device.rb, line 223 def self.parse_json(json) new do @id = json['assetID'].to_i @ip = json['ipAddress'] @host_name = json['hostName'] @os = json['operatingSystem'] @vulns = json['vulnerabilityCount'] @status = json['scanStatusTranslation'].downcase.to_sym @duration = json['duration'] end end
Public Instance Methods
ip_address()
click to toggle source
Convenience method for assessing “ip” as “ip_address”.
# File lib/nexpose/device.rb, line 212 def ip_address ip end
operating_system()
click to toggle source
Convenience method for assessing “os” as “operating_system”.
# File lib/nexpose/device.rb, line 217 def operating_system os end