AWS Thinkbox Discussion Forums

jabber notificaton

How could we implement custom job complete / failed notifications? Specifically would like to use jabber / xmpp

Assuming you have a way of mapping Deadline users -> Jabber users, and XMPP has some kind of python API or command line tool (I’m sure it does), it’d be pretty easy to write an Event Plugin to do this (docs here: thinkboxsoftware.com/deadlin … eventssdk/)

You’d basically have an event plugin that implements the Complete and Failed callbacks, that send out a Jabber message. To get the users to notify, you can pull the list of notifications targets from the Job (which you’re getting passed as an argument to your callback handlers). Using some quick pseudo-code, it’d look something like this:

def GetDeadlineEventListener():
    return JabberEventListener()

def CleanupDeadlineEventListener( eventListener ):
    eventListener.Cleanup()

class JabberEventListener (DeadlineEventListener):
    def __init__( self ):
        self.OnJobStartedCallback += self.OnJobFinished
        self.OnJobFailedCallback += self.OnJobFailed

    def Cleanup( self ):
        del self.OnJobStartedCallback
        del self.OnJobFailedCallback
    
    def OnJobFinised( self, job ):
        for user in job.JobNotificationTargets:
            #Send jabber message about success! :)
    
    def OnJobFailed( self, job ):
        for user in job.JobNotificationTargets:
            #Send jabber message about failure. :(

Thanks! This should work A-OK!

Privacy | Site terms | Cookie preferences