Documentation
¶
Overview ¶
Package jobsadmin provides admin/super-admin read-only views over the background jobs queue, including a system-wide view across all orgs (and system jobs where organization_uid IS NULL) and retry-chain traversal.
Index ¶
- Variables
- type Handler
- func (h *Handler) GetOrgJob(writer http.ResponseWriter, req *http.Request) error
- func (h *Handler) GetOrgJobChain(writer http.ResponseWriter, req *http.Request) error
- func (h *Handler) GetSystemJob(writer http.ResponseWriter, req *http.Request) error
- func (h *Handler) GetSystemJobChain(writer http.ResponseWriter, req *http.Request) error
- func (h *Handler) ListOrgJobs(writer http.ResponseWriter, req *http.Request) error
- func (h *Handler) ListSystemJobs(writer http.ResponseWriter, req *http.Request) error
- type ListOptions
- type Service
Constants ¶
This section is empty.
Variables ¶
var ErrJobNotFound = errors.New("job not found")
ErrJobNotFound is returned when a job cannot be found.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
base.HandlerBase
// contains filtered or unexported fields
}
Handler exposes admin/super-admin read-only background-job endpoints.
func NewHandler ¶
NewHandler creates a new jobsadmin handler.
func (*Handler) GetOrgJob ¶
GetOrgJob returns a single org job, admin-gated. GET /api/v1/orgs/:org/jobs/:uid/detail.
func (*Handler) GetOrgJobChain ¶
GetOrgJobChain returns the retry chain for an org job, admin-gated. GET /api/v1/orgs/:org/jobs/:uid/chain.
func (*Handler) GetSystemJob ¶
GetSystemJob returns a single job across all orgs (super-admin). GET /api/v1/system/jobs/:uid.
func (*Handler) GetSystemJobChain ¶
GetSystemJobChain returns the retry chain for a job across all orgs. GET /api/v1/system/jobs/:uid/chain.
func (*Handler) ListOrgJobs ¶
ListOrgJobs lists jobs for the org, admin-gated. GET /api/v1/orgs/:org/jobs/admin.
func (*Handler) ListSystemJobs ¶
ListSystemJobs lists jobs across all orgs incl. system jobs (super-admin). GET /api/v1/system/jobs.
type ListOptions ¶
ListOptions holds filtering and pagination options.
type Service ¶
type Service interface {
// ListJobs lists background jobs. When orgUID is empty, all orgs are
// returned (system mode, including organization_uid IS NULL system jobs).
ListJobs(ctx context.Context, orgUID string, opts ListOptions) ([]*models.Job, error)
// GetJob returns a single job. When orgUID is non-empty the job must
// belong to that org or ErrJobNotFound is returned.
GetJob(ctx context.Context, orgUID, uid string) (*models.Job, error)
// RetryChain returns the ordered chain of jobs linked via previous_job_uid,
// from the earliest ancestor to the latest descendant, that the given job
// belongs to. The result always includes the job itself.
RetryChain(ctx context.Context, orgUID, uid string) ([]*models.Job, error)
}
Service provides admin read-only job queries.