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

Function GetJobLogs

cli/cluster/logs.go:52–64  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, apiName string, jobID string)

Source from the content-addressed store, hash-verified

50}
51
52func GetJobLogs(operatorConfig OperatorConfig, apiName string, jobID string) (schema.LogResponse, error) {
53 httpRes, err := HTTPGet(operatorConfig, "/logs/"+apiName, map[string]string{"jobID": jobID})
54 if err != nil {
55 return schema.LogResponse{}, err
56 }
57
58 var logResponse schema.LogResponse
59 if err = json.Unmarshal(httpRes, &logResponse); err != nil {
60 return schema.LogResponse{}, errors.Wrap(err, "/logs/"+apiName, string(httpRes))
61 }
62
63 return logResponse, nil
64}
65
66func StreamLogs(operatorConfig OperatorConfig, apiName string) error {
67 return streamLogs(operatorConfig, "/streamlogs/"+apiName)

Callers 1

logs.goFile · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected