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

Function GetBatchJob

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

Source from the content-addressed store, hash-verified

80}
81
82func GetBatchJob(operatorConfig OperatorConfig, apiName string, jobID string) (schema.BatchJobResponse, error) {
83 endpoint := path.Join("/batch", apiName)
84 httpRes, err := HTTPGet(operatorConfig, endpoint, map[string]string{"jobID": jobID})
85 if err != nil {
86 return schema.BatchJobResponse{}, err
87 }
88
89 var jobRes schema.BatchJobResponse
90 if err = json.Unmarshal(httpRes, &jobRes); err != nil {
91 return schema.BatchJobResponse{}, errors.Wrap(err, endpoint, string(httpRes))
92 }
93
94 return jobRes, nil
95}
96
97func GetTaskJob(operatorConfig OperatorConfig, apiName string, jobID string) (schema.TaskJobResponse, error) {
98 endpoint := path.Join("/tasks", apiName)

Callers 1

getBatchJobFunction · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected