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

Function GetTaskJob

cli/cluster/get.go:97–110  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, apiName string, jobID string)

Source from the content-addressed store, hash-verified

95}
96
97func GetTaskJob(operatorConfig OperatorConfig, apiName string, jobID string) (schema.TaskJobResponse, error) {
98 endpoint := path.Join("/tasks", apiName)
99 httpRes, err := HTTPGet(operatorConfig, endpoint, map[string]string{"jobID": jobID})
100 if err != nil {
101 return schema.TaskJobResponse{}, err
102 }
103
104 var jobRes schema.TaskJobResponse
105 if err = json.Unmarshal(httpRes, &jobRes); err != nil {
106 return schema.TaskJobResponse{}, errors.Wrap(err, endpoint, string(httpRes))
107 }
108
109 return jobRes, nil
110}

Callers 1

getTaskJobFunction · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected