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

Function GetLogs

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

Source from the content-addressed store, hash-verified

36)
37
38func GetLogs(operatorConfig OperatorConfig, apiName string) (schema.LogResponse, error) {
39 httpRes, err := HTTPGet(operatorConfig, "/logs/"+apiName)
40 if err != nil {
41 return schema.LogResponse{}, err
42 }
43
44 var logResponse schema.LogResponse
45 if err = json.Unmarshal(httpRes, &logResponse); err != nil {
46 return schema.LogResponse{}, errors.Wrap(err, "/logs/"+apiName, string(httpRes))
47 }
48
49 return logResponse, nil
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})

Callers 1

logs.goFile · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected