(operatorConfig OperatorConfig, kind userconfig.Kind, apiName string, jobID string)
| 75 | } |
| 76 | |
| 77 | func StopJob(operatorConfig OperatorConfig, kind userconfig.Kind, apiName string, jobID string) (schema.DeleteResponse, error) { |
| 78 | params := map[string]string{ |
| 79 | "apiName": apiName, |
| 80 | "jobID": jobID, |
| 81 | } |
| 82 | |
| 83 | var endpointComponent string |
| 84 | if kind == userconfig.BatchAPIKind { |
| 85 | endpointComponent = "batch" |
| 86 | } else { |
| 87 | endpointComponent = "tasks" |
| 88 | } |
| 89 | |
| 90 | httpRes, err := HTTPDelete(operatorConfig, path.Join("/"+endpointComponent, apiName), params) |
| 91 | if err != nil { |
| 92 | return schema.DeleteResponse{}, err |
| 93 | } |
| 94 | |
| 95 | var deleteRes schema.DeleteResponse |
| 96 | err = json.Unmarshal(httpRes, &deleteRes) |
| 97 | if err != nil { |
| 98 | return schema.DeleteResponse{}, errors.Wrap(err, string(httpRes)) |
| 99 | } |
| 100 | |
| 101 | return deleteRes, nil |
| 102 | } |
no test coverage detected