The synaps.cep.action_bolt Module

class ActionBolt

Bases: synaps.cep.storm.BasicBolt

BOLT_NAME = 'ActionBolt'
alarm_history_state_update(alarmkey, alarm, notification_message)

update alarm history based on notification message

notification_message = {
‘method’: “email”, ‘receivers’: email_receivers, ‘subject’: message[‘subject’], ‘body’: message[‘body’], ‘state’: “ok” | “failed”

}

do_instance_action(alarm_key, alarm, instance_actions)
get_action_type(action)
initialize(stormconf, context)
meter_email_actions(project_id, receivers)
meter_instance_actions(project_id, receivers)
meter_sms_actions(project_id, receivers)
process(tup)
process_action(tup)

message example

msg = {

‘state’: new_state[‘stateValue’], ‘subject’: “%s state has been changed from %s to %s” %

(alarm[‘alarm_name’], old_state[‘stateValue’],
new_state[‘stateValue’]),

‘body’: new_state[‘stateReason’]

}

process_email_action(alarm_key, alarm, message, actions)
process_instance_action(alarm_key, alarm, message, actions)
process_sms_action(alarm_key, alarm, message, actions)
send_email(message)
send_sms(message)

Previous topic

The synaps.auth.signer Module

Next topic

The synaps.cep.api_spout Module

This Page