Class: Nexpose::DiscoveredAsset
- Inherits:
-
Object
- Object
- Nexpose::DiscoveredAsset
- Defined in:
- lib/nexpose/discovery.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#datacenter ⇒ Object
Returns the value of attribute datacenter.
-
#host ⇒ Object
Returns the value of attribute host.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#name ⇒ Object
Returns the value of attribute name.
-
#os ⇒ Object
Returns the value of attribute os.
-
#pool ⇒ Object
Returns the value of attribute pool.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ DiscoveredAsset
constructor
A new instance of DiscoveredAsset.
- #on? ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ DiscoveredAsset
Returns a new instance of DiscoveredAsset.
308 309 310 |
# File 'lib/nexpose/discovery.rb', line 308 def initialize(&block) instance_eval &block if block_given? end |
Instance Attribute Details
#cluster ⇒ Object
Returns the value of attribute cluster.
303 304 305 |
# File 'lib/nexpose/discovery.rb', line 303 def cluster @cluster end |
#datacenter ⇒ Object
Returns the value of attribute datacenter.
302 303 304 |
# File 'lib/nexpose/discovery.rb', line 302 def datacenter @datacenter end |
#host ⇒ Object
Returns the value of attribute host.
301 302 303 |
# File 'lib/nexpose/discovery.rb', line 301 def host @host end |
#ip ⇒ Object
Returns the value of attribute ip.
300 301 302 |
# File 'lib/nexpose/discovery.rb', line 300 def ip @ip end |
#name ⇒ Object
Returns the value of attribute name.
299 300 301 |
# File 'lib/nexpose/discovery.rb', line 299 def name @name end |
#os ⇒ Object
Returns the value of attribute os.
305 306 307 |
# File 'lib/nexpose/discovery.rb', line 305 def os @os end |
#pool ⇒ Object
Returns the value of attribute pool.
304 305 306 |
# File 'lib/nexpose/discovery.rb', line 304 def pool @pool end |
#status ⇒ Object
Returns the value of attribute status.
306 307 308 |
# File 'lib/nexpose/discovery.rb', line 306 def status @status end |
Class Method Details
.parse(json) ⇒ Object
316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/nexpose/discovery.rb', line 316 def self.parse(json) new do |asset| asset.ip = json['IPAddress'] asset.os = json['OSName'] asset.name = json['assetDiscoveryName'] asset.cluster = json['cluster'] asset.datacenter = json['datacenter'] asset.host = json['host'] asset.status = json['powerStatus'] asset.pool = json['resourcePool'] end end |
Instance Method Details
#on? ⇒ Boolean
312 313 314 |
# File 'lib/nexpose/discovery.rb', line 312 def on? @status == 'On' end |