Class: Hawkular::Alerts::Trigger::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/hawkular/alerts/alerts_api.rb

Overview

Representing of one Condition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cond_hash) ⇒ Condition

Returns a new instance of Condition.



452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/hawkular/alerts/alerts_api.rb', line 452

def initialize(cond_hash)
  @condition_id = cond_hash['conditionId']
  @type = cond_hash['type']
  @operator = cond_hash['operator']
  @threshold = cond_hash['threshold']
  @type = cond_hash['type']
  @trigger_mode = cond_hash['triggerMode']
  @data_id = cond_hash['dataId']
  @data2_id = cond_hash['data2Id']
  @data2_multiplier = cond_hash['data2Multiplier']
  @trigger_id = cond_hash['triggerId']
  @alerter_id = cond_hash['alerterId']
  @expression = cond_hash['expression']
end

Instance Attribute Details

#alerter_idObject

Returns the value of attribute alerter_id.



449
450
451
# File 'lib/hawkular/alerts/alerts_api.rb', line 449

def alerter_id
  @alerter_id
end

#condition_idObject

Returns the value of attribute condition_id.



447
448
449
# File 'lib/hawkular/alerts/alerts_api.rb', line 447

def condition_id
  @condition_id
end

#condition_set_indexObject (readonly)

Returns the value of attribute condition_set_index.



450
451
452
# File 'lib/hawkular/alerts/alerts_api.rb', line 450

def condition_set_index
  @condition_set_index
end

#condition_set_sizeObject (readonly)

Returns the value of attribute condition_set_size.



450
451
452
# File 'lib/hawkular/alerts/alerts_api.rb', line 450

def condition_set_size
  @condition_set_size
end

#data2_idObject

Returns the value of attribute data2_id.



448
449
450
# File 'lib/hawkular/alerts/alerts_api.rb', line 448

def data2_id
  @data2_id
end

#data2_multiplierObject

Returns the value of attribute data2_multiplier.



448
449
450
# File 'lib/hawkular/alerts/alerts_api.rb', line 448

def data2_multiplier
  @data2_multiplier
end

#data_idObject

Returns the value of attribute data_id.



448
449
450
# File 'lib/hawkular/alerts/alerts_api.rb', line 448

def data_id
  @data_id
end

#expressionObject

Returns the value of attribute expression.



449
450
451
# File 'lib/hawkular/alerts/alerts_api.rb', line 449

def expression
  @expression
end

#operatorObject

Returns the value of attribute operator.



447
448
449
# File 'lib/hawkular/alerts/alerts_api.rb', line 447

def operator
  @operator
end

#thresholdObject

Returns the value of attribute threshold.



447
448
449
# File 'lib/hawkular/alerts/alerts_api.rb', line 447

def threshold
  @threshold
end

#trigger_idObject (readonly)

Returns the value of attribute trigger_id.



450
451
452
# File 'lib/hawkular/alerts/alerts_api.rb', line 450

def trigger_id
  @trigger_id
end

#trigger_modeObject

Returns the value of attribute trigger_mode.



448
449
450
# File 'lib/hawkular/alerts/alerts_api.rb', line 448

def trigger_mode
  @trigger_mode
end

#typeObject

Returns the value of attribute type.



447
448
449
# File 'lib/hawkular/alerts/alerts_api.rb', line 447

def type
  @type
end

Instance Method Details

#to_hObject



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/hawkular/alerts/alerts_api.rb', line 467

def to_h
  cond_hash = {}
  cond_hash['conditionId'] = @condition_id
  cond_hash['type'] = @type
  cond_hash['operator'] = @operator
  cond_hash['threshold'] = @threshold
  cond_hash['type'] = @type
  cond_hash['triggerMode'] = @trigger_mode
  cond_hash['dataId'] = @data_id
  cond_hash['data2Id'] = @data2_id
  cond_hash['data2Multiplier'] = @data2_multiplier
  cond_hash['triggerId'] = @trigger_id
  cond_hash['alerterId'] = @alerter_id
  cond_hash['expression'] = @expression
  cond_hash
end