class Hawkular::Alerts::Trigger::Condition

Representing of one Condition

Attributes

alerter_id[RW]
condition_id[RW]
condition_set_index[R]
condition_set_size[R]
data2_id[RW]
data2_multiplier[RW]
data_id[RW]
expression[RW]
operator[RW]
threshold[RW]
trigger_id[R]
trigger_mode[RW]
type[RW]

Public Class Methods

new(cond_hash) click to toggle source
    # File lib/hawkular/alerts/alerts_api.rb
452 def initialize(cond_hash)
453   @condition_id = cond_hash['conditionId']
454   @type = cond_hash['type']
455   @operator = cond_hash['operator']
456   @threshold = cond_hash['threshold']
457   @type = cond_hash['type']
458   @trigger_mode = cond_hash['triggerMode']
459   @data_id = cond_hash['dataId']
460   @data2_id = cond_hash['data2Id']
461   @data2_multiplier = cond_hash['data2Multiplier']
462   @trigger_id = cond_hash['triggerId']
463   @alerter_id = cond_hash['alerterId']
464   @expression = cond_hash['expression']
465 end

Public Instance Methods

to_h() click to toggle source
    # File lib/hawkular/alerts/alerts_api.rb
467 def to_h
468   cond_hash = {}
469   cond_hash['conditionId'] = @condition_id
470   cond_hash['type'] = @type
471   cond_hash['operator'] = @operator
472   cond_hash['threshold'] = @threshold
473   cond_hash['type'] = @type
474   cond_hash['triggerMode'] = @trigger_mode
475   cond_hash['dataId'] = @data_id
476   cond_hash['data2Id'] = @data2_id
477   cond_hash['data2Multiplier'] = @data2_multiplier
478   cond_hash['triggerId'] = @trigger_id
479   cond_hash['alerterId'] = @alerter_id
480   cond_hash['expression'] = @expression
481   cond_hash
482 end