parameters: (self, event)
return_statement: return bareosdir.bRC_OK
docstring: This method is called for each of the above registered events
          Overload this method to implement your actions for the events,
          You may first call this method in your derived class to get the
          job attributes read and then only adjust where useful.
docstring_summary: This method is called for each of the above registered events
          Overload this method to implement your actions for the events,
          You may first call this method in your derived class to get the
          job attributes read and then only adjust where useful.
docstring_tokens: This method is called for each of the above registered events Overload this method to implement your actions for the events You may first call this method in your derived class to get the job attributes read and then only adjust where useful .
function: def handle_plugin_event(self, event):
          """
          This method is called for each of the above registered events
          Overload this method to implement your actions for the events,
          You may first call this method in your derived class to get the
          job attributes read and then only adjust where useful.
          """
          if event == bareosdir.bDirEventJobInit:
              self.jobInitTime = time.time()
              self.jobStatus = chr(bareosdir.GetValue(bareosdir.bDirVarJobStatus))
              bareosdir.DebugMessage(
                  100,
                  "bDirEventJobInit event triggered at Unix time %s\n"
                  % (self.jobInitTime),
              )
  
          elif event == bareosdir.bDirEventJobStart:
              self.jobStartTime = time.time()
              self.jobStatus = chr(bareosdir.GetValue(bareosdir.bDirVarJobStatus))
              bareosdir.DebugMessage(
                  100,
                  "bDirEventJobStart event triggered at Unix time %s\n"
                  % (self.jobStartTime),
              )
  
          elif event == bareosdir.bDirEventJobRun:
              # Now the jobs starts running, after eventually waiting some time,
              # e.g for other jobs to finish
              self.jobRunTime = time.time()
              bareosdir.DebugMessage(
                  100,
                  "bDirEventJobRun event triggered at Unix time %s\n" % (self.jobRunTime),
              )
  
          elif event == bareosdir.bDirEventJobEnd:
              self.jobEndTime = time.time()
              bareosdir.DebugMessage(
                  100,
                  "bDirEventJobEnd event triggered at Unix time %s\n" % (self.jobEndTime),
              )
              self.jobLevel = chr(bareosdir.GetValue(bareosdir.bDirVarLevel))
              self.jobStatus = chr(bareosdir.GetValue(bareosdir.bDirVarJobStatus))
              self.jobErrors = int(bareosdir.GetValue(bareosdir.bDirVarJobErrors))
              self.jobBytes = int(bareosdir.GetValue(bareosdir.bDirVarJobBytes))
              self.jobFiles = int(bareosdir.GetValue(bareosdir.bDirVarJobFiles))
              self.jobNumVols = int(bareosdir.GetValue(bareosdir.bDirVarNumVols))
              self.jobPool = bareosdir.GetValue(bareosdir.bDirVarPool)
              self.jobStorage = bareosdir.GetValue(bareosdir.bDirVarStorage)
              self.jobMediaType = bareosdir.GetValue(bareosdir.bDirVarMediaType)
  
              self.jobTotalTime = self.jobEndTime - self.jobInitTime
              self.jobRunningTime = self.jobEndTime - self.jobRunTime
              self.throughput = 0
              if self.jobRunningTime > 0:
                  self.throughput = self.jobBytes / self.jobRunningTime
  
          return bareosdir.bRC_OK
function_tokens: def handle_plugin_event ( self , event ) : if event == bareosdir . bDirEventJobInit : self . jobInitTime = time . time ( ) self . jobStatus = chr ( bareosdir . GetValue ( bareosdir . bDirVarJobStatus ) ) bareosdir . DebugMessage ( 100 , "bDirEventJobInit event triggered at Unix time %s\n" % ( self . jobInitTime ) , ) elif event == bareosdir . bDirEventJobStart : self . jobStartTime = time . time ( ) self . jobStatus = chr ( bareosdir . GetValue ( bareosdir . bDirVarJobStatus ) ) bareosdir . DebugMessage ( 100 , "bDirEventJobStart event triggered at Unix time %s\n" % ( self . jobStartTime ) , ) elif event == bareosdir . bDirEventJobRun : # Now the jobs starts running, after eventually waiting some time, # e.g for other jobs to finish self . jobRunTime = time . time ( ) bareosdir . DebugMessage ( 100 , "bDirEventJobRun event triggered at Unix time %s\n" % ( self . jobRunTime ) , ) elif event == bareosdir . bDirEventJobEnd : self . jobEndTime = time . time ( ) bareosdir . DebugMessage ( 100 , "bDirEventJobEnd event triggered at Unix time %s\n" % ( self . jobEndTime ) , ) self . jobLevel = chr ( bareosdir . GetValue ( bareosdir . bDirVarLevel ) ) self . jobStatus = chr ( bareosdir . GetValue ( bareosdir . bDirVarJobStatus ) ) self . jobErrors = int ( bareosdir . GetValue ( bareosdir . bDirVarJobErrors ) ) self . jobBytes = int ( bareosdir . GetValue ( bareosdir . bDirVarJobBytes ) ) self . jobFiles = int ( bareosdir . GetValue ( bareosdir . bDirVarJobFiles ) ) self . jobNumVols = int ( bareosdir . GetValue ( bareosdir . bDirVarNumVols ) ) self . jobPool = bareosdir . GetValue ( bareosdir . bDirVarPool ) self . jobStorage = bareosdir . GetValue ( bareosdir . bDirVarStorage ) self . jobMediaType = bareosdir . GetValue ( bareosdir . bDirVarMediaType ) self . jobTotalTime = self . jobEndTime - self . jobInitTime self . jobRunningTime = self . jobEndTime - self . jobRunTime self . throughput = 0 if self . jobRunningTime > 0 : self . throughput = self . jobBytes / self . jobRunningTime return bareosdir . bRC_OK