api

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Base API v1 Path
	ApiUrlPrefix = "/api/v1/"

	JobPath    = "job/"
	ApiJobPath = ApiUrlPrefix + JobPath
)

Variables

This section is empty.

Functions

func HandleAddJob

func HandleAddJob(cache job.JobCache, defaultOwner string) func(http.ResponseWriter, *http.Request)

HandleAddJob takes a job object and unmarshals it to a Job type, and then throws the job in the schedulers.

func HandleDeleteAllJobs

func HandleDeleteAllJobs(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleDeleteAllJobs is the handler for deleting all jobs DELETE /api/v1/job/all

func HandleDisableJobRequest

func HandleDisableJobRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleDisableJobRequest is the handler for mdisabling jobs /api/v1/job/disable/{id}

func HandleEnableJobRequest

func HandleEnableJobRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleEnableJobRequest is the handler for enable jobs /api/v1/job/enable/{id}

func HandleJobRequest

func HandleJobRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleJobRequest routes requests to /api/v1/job/{id} to either handleDeleteJob if its a DELETE or handleGetJob if its a GET request.

func HandleKalaStatsRequest

func HandleKalaStatsRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleKalaStatsRequest is the handler for getting system-level metrics /api/v1/stats

func HandleListJobStatsRequest

func HandleListJobStatsRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleListJobStatsRequest is the handler for getting job-specific stats /api/v1/job/stats/{id}

func HandleListJobsRequest

func HandleListJobsRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleListJobs responds with an array of all Jobs within the server, active or disabled.

func HandleStartJobRequest

func HandleStartJobRequest(cache job.JobCache) func(w http.ResponseWriter, r *http.Request)

HandleStartJobRequest is the handler for manually starting jobs /api/v1/job/start/{id}

func MakeServer

func MakeServer(listenAddr string, cache job.JobCache, defaultOwner string, profile bool) *http.Server

func SetupApiRoutes

func SetupApiRoutes(r *mux.Router, cache job.JobCache, defaultOwner string)

SetupApiRoutes is used within main to initialize all of the routes

Types

type AddJobResponse

type AddJobResponse struct {
	Id string `json:"id"`
}

type JobResponse

type JobResponse struct {
	Job *job.Job `json:"job"`
}

type KalaStatsResponse

type KalaStatsResponse struct {
	Stats *job.KalaStats
}

type ListJobStatsResponse

type ListJobStatsResponse struct {
	JobStats []*job.JobStat `json:"job_stats"`
}

type ListJobsResponse

type ListJobsResponse struct {
	Jobs map[string]*job.Job `json:"jobs"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL