github.com/dkerwin/nomad@v0.3.3-0.20160525181927-74554135514b/nomad/system_endpoint.go (about) 1 package nomad 2 3 import ( 4 "github.com/hashicorp/nomad/nomad/structs" 5 ) 6 7 // System endpoint is used to call invoke system tasks. 8 type System struct { 9 srv *Server 10 } 11 12 // GarbageCollect is used to trigger the system to immediately garbage collect nodes, evals 13 // and jobs. 14 func (s *System) GarbageCollect(args *structs.GenericRequest, reply *structs.GenericResponse) error { 15 if done, err := s.srv.forward("System.GarbageCollect", args, args, reply); done { 16 return err 17 } 18 19 s.srv.evalBroker.Enqueue(s.srv.coreJobEval(structs.CoreJobForceGC)) 20 return nil 21 }