Raising events from custom code

From Salt documentation, we can use this code to raise custom events. Will this work in AutoPi?

import salt.client

caller = salt.client.Caller()

ret = caller.cmd('event.send',
                 'myco/event/success'
                 { 'success': True,
                   'message': "It works!" })

if not ret:
    # the event could not be sent, process the error here
    ...

Hi James.

You can see how to raise custom events in this guide.

Best
Nikola

OK. Will test it out

This topic was automatically closed 33 days after the last reply. New replies are no longer allowed.