(w http.ResponseWriter, r *http.Request)
| 28 | ) |
| 29 | |
| 30 | func StopTaskJob(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 = taskapi.StopJob(spec.JobKey{ |
| 40 | APIName: apiName, |
| 41 | ID: jobID, |
| 42 | Kind: userconfig.TaskAPIKind, |
| 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 | } |
nothing calls this directly
no test coverage detected