MCPcopy Index your code
hub / github.com/cortexlabs/cortex / StopJob

Function StopJob

cli/cluster/delete.go:77–102  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, kind userconfig.Kind, apiName string, jobID string)

Source from the content-addressed store, hash-verified

75}
76
77func 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}

Callers 1

delete.goFile · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPDeleteFunction · 0.85

Tested by

no test coverage detected