MCPcopy
hub / github.com/cortexlabs/cortex / StopBatchJob

Function StopBatchJob

pkg/operator/endpoints/stop_batch_job.go:30–52  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

28)
29
30func StopBatchJob(w http.ResponseWriter, r *http.Request) {
31 vars := mux.Vars(r)
32 apiName := vars["apiName"]
33 jobID, err := getRequiredQueryParam("jobID", r)
34 if err != nil {
35 respondError(w, r, err)
36 return
37 }
38
39 err = batchapi.StopJob(spec.JobKey{
40 APIName: apiName,
41 ID: jobID,
42 Kind: userconfig.BatchAPIKind,
43 })
44 if err != nil {
45 respondError(w, r, err)
46 return
47 }
48
49 respondJSON(w, r, schema.DeleteResponse{
50 Message: fmt.Sprintf("stopped job %s", jobID),
51 })
52}

Callers

nothing calls this directly

Calls 4

StopJobFunction · 0.92
getRequiredQueryParamFunction · 0.85
respondErrorFunction · 0.85
respondJSONFunction · 0.70

Tested by

no test coverage detected