Class: Kriterion::Report
- Inherits:
-
Object
- Object
- Kriterion::Report
- Defined in:
- lib/kriterion/report.rb
Instance Attribute Summary collapse
-
#cached_catalog_status ⇒ Object
readonly
Returns the value of attribute cached_catalog_status.
-
#catalog_uuid ⇒ Object
readonly
Returns the value of attribute catalog_uuid.
-
#code_id ⇒ Object
readonly
Returns the value of attribute code_id.
-
#configuration_version ⇒ Object
readonly
Returns the value of attribute configuration_version.
-
#corrective_change ⇒ Object
readonly
Returns the value of attribute corrective_change.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#logs ⇒ Object
readonly
Returns the value of attribute logs.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#noop ⇒ Object
readonly
Returns the value of attribute noop.
-
#noop_pending ⇒ Object
readonly
Returns the value of attribute noop_pending.
-
#puppet_version ⇒ Object
readonly
Returns the value of attribute puppet_version.
-
#report_format ⇒ Object
readonly
Returns the value of attribute report_format.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#transaction_completed ⇒ Object
readonly
Returns the value of attribute transaction_completed.
-
#transaction_uuid ⇒ Object
readonly
Returns the value of attribute transaction_uuid.
Instance Method Summary collapse
- #certname ⇒ Object
-
#initialize(data) ⇒ Report
constructor
A new instance of Report.
- #resource_statuses ⇒ Object
-
#resources_with_tags(tags) ⇒ Object
Returns resources that have given tags, expects an array of tags.
Constructor Details
#initialize(data) ⇒ Report
Returns a new instance of Report.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/kriterion/report.rb', line 24 def initialize(data) @host = data['host'] @time = data['time'] @configuration_version = data['configuration_version'] @transaction_uuid = data['transaction_uuid'] @report_format = data['report_format'] @puppet_version = data['puppet_version'] @status = data['status'] @transaction_completed = data['transaction_completed'] @noop = data['noop'] @noop_pending = data['noop_pending'] @environment = data['environment'] @logs = data['logs'] @metrics = data['metrics'] @resource_statuses = data['resource_statuses'] @corrective_change = data['corrective_change'] @catalog_uuid = data['catalog_uuid'] @code_id = data['code_id'] @cached_catalog_status = data['cached_catalog_status'] end |
Instance Attribute Details
#cached_catalog_status ⇒ Object (readonly)
Returns the value of attribute cached_catalog_status.
22 23 24 |
# File 'lib/kriterion/report.rb', line 22 def cached_catalog_status @cached_catalog_status end |
#catalog_uuid ⇒ Object (readonly)
Returns the value of attribute catalog_uuid.
20 21 22 |
# File 'lib/kriterion/report.rb', line 20 def catalog_uuid @catalog_uuid end |
#code_id ⇒ Object (readonly)
Returns the value of attribute code_id.
21 22 23 |
# File 'lib/kriterion/report.rb', line 21 def code_id @code_id end |
#configuration_version ⇒ Object (readonly)
Returns the value of attribute configuration_version.
8 9 10 |
# File 'lib/kriterion/report.rb', line 8 def configuration_version @configuration_version end |
#corrective_change ⇒ Object (readonly)
Returns the value of attribute corrective_change.
19 20 21 |
# File 'lib/kriterion/report.rb', line 19 def corrective_change @corrective_change end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
16 17 18 |
# File 'lib/kriterion/report.rb', line 16 def environment @environment end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
6 7 8 |
# File 'lib/kriterion/report.rb', line 6 def host @host end |
#logs ⇒ Object (readonly)
Returns the value of attribute logs.
17 18 19 |
# File 'lib/kriterion/report.rb', line 17 def logs @logs end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
18 19 20 |
# File 'lib/kriterion/report.rb', line 18 def metrics @metrics end |
#noop ⇒ Object (readonly)
Returns the value of attribute noop.
14 15 16 |
# File 'lib/kriterion/report.rb', line 14 def noop @noop end |
#noop_pending ⇒ Object (readonly)
Returns the value of attribute noop_pending.
15 16 17 |
# File 'lib/kriterion/report.rb', line 15 def noop_pending @noop_pending end |
#puppet_version ⇒ Object (readonly)
Returns the value of attribute puppet_version.
11 12 13 |
# File 'lib/kriterion/report.rb', line 11 def puppet_version @puppet_version end |
#report_format ⇒ Object (readonly)
Returns the value of attribute report_format.
10 11 12 |
# File 'lib/kriterion/report.rb', line 10 def report_format @report_format end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/kriterion/report.rb', line 12 def status @status end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
7 8 9 |
# File 'lib/kriterion/report.rb', line 7 def time @time end |
#transaction_completed ⇒ Object (readonly)
Returns the value of attribute transaction_completed.
13 14 15 |
# File 'lib/kriterion/report.rb', line 13 def transaction_completed @transaction_completed end |
#transaction_uuid ⇒ Object (readonly)
Returns the value of attribute transaction_uuid.
9 10 11 |
# File 'lib/kriterion/report.rb', line 9 def transaction_uuid @transaction_uuid end |
Instance Method Details
#certname ⇒ Object
56 57 58 |
# File 'lib/kriterion/report.rb', line 56 def certname host end |
#resource_statuses ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/kriterion/report.rb', line 45 def resource_statuses # If this is a hash then the objects haven't been initialised # We should initialise them now if @resource_statuses.is_a? Hash @resource_statuses = @resource_statuses.map do |_ref, params| Kriterion::Resource.new(params) end end @resource_statuses end |
#resources_with_tags(tags) ⇒ Object
Returns resources that have given tags, expects an array of tags
61 62 63 64 65 66 67 |
# File 'lib/kriterion/report.rb', line 61 def () resource_statuses.select do |resource| .any? do |tag| resource..include? tag end end end |