forked from lei.chen/myxce
21 lines
847 B
Go
21 lines
847 B
Go
package backend
|
|
|
|
import "apiserver/models"
|
|
|
|
// NotificationHandler defines callbacks for backend push events.
|
|
// When the backend creates/updates/deletes objects, these callbacks
|
|
// are invoked to update the API server's in-memory stores.
|
|
type NotificationHandler interface {
|
|
OnJobCreated(job *models.JobInfo)
|
|
OnJobUpdated(job *models.JobInfo)
|
|
OnJobDeleted(jobid uint64)
|
|
// OnJobFinished is called when the controller reports job completion or
|
|
// dispatch failure. exitCode==0 → DONE, non-zero → EXIT.
|
|
OnJobFinished(jobid uint64, exitCode int)
|
|
OnQueueUpdated(queue *models.QueueInfo)
|
|
OnHostUpdated(host *models.HostInfo)
|
|
OnHostConfigUpdated(host *models.HostInfo)
|
|
OnClusterUpdated(cluster *models.ClusterInfo)
|
|
OnResourceUpdated(res *models.ResourceDefinitionInfo)
|
|
OnResourceLocationUpdated(res *models.ResourceDistributionInfo)
|
|
}
|