Class: Nexpose::SiloSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/silo.rb

Overview

Object that represents the summary of a Nexpose Site.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ SiloSummary

Returns a new instance of SiloSummary.



333
334
335
# File 'lib/nexpose/silo.rb', line 333

def initialize(&block)
  instance_eval &block if block_given?
end

Instance Attribute Details

#assetsObject (readonly)

The asset count for this silo



323
324
325
# File 'lib/nexpose/silo.rb', line 323

def assets
  @assets
end

#descriptionObject (readonly)

A description of the silo.



319
320
321
# File 'lib/nexpose/silo.rb', line 319

def description
  @description
end

#idObject (readonly)

The silo ID.



315
316
317
# File 'lib/nexpose/silo.rb', line 315

def id
  @id
end

#max_assetsObject (readonly)

The asset count limit for this silo.



325
326
327
# File 'lib/nexpose/silo.rb', line 325

def max_assets
  @max_assets
end

#max_hosted_assetsObject (readonly)

The hosted asset count limit for this silo.



327
328
329
# File 'lib/nexpose/silo.rb', line 327

def max_hosted_assets
  @max_hosted_assets
end

#max_usersObject (readonly)

The user count limit for this silo.



331
332
333
# File 'lib/nexpose/silo.rb', line 331

def max_users
  @max_users
end

#nameObject (readonly)

The silo name.



317
318
319
# File 'lib/nexpose/silo.rb', line 317

def name
  @name
end

#profile_idObject (readonly)

The ID of the silo profile being used for this silo.



321
322
323
# File 'lib/nexpose/silo.rb', line 321

def profile_id
  @profile_id
end

#usersObject (readonly)

The user count for this silo



329
330
331
# File 'lib/nexpose/silo.rb', line 329

def users
  @users
end

Class Method Details

.parse(xml) ⇒ Object



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/nexpose/silo.rb', line 337

def self.parse(xml)
  new do
    @id = xml.attributes['id']
    @name = xml.attributes['name']
    @description = xml.attributes['description']
    @profile_id = xml.attributes['silo-profile-id']
    xml.elements.each('LicenseSummary') do |license|
      @assets = license.attributes['assets']
      @max_assets = license.attributes['max-assets']
      @max_hosted_assets = license.attributes['max-hosted-assets']
      @users = license.attributes['users']
      @max_users = license.attributes['max-users']
    end
  end
end