| 50 | } |
| 51 | |
| 52 | func 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 | |
| 66 | func StreamLogs(operatorConfig OperatorConfig, apiName string) error { |
| 67 | return streamLogs(operatorConfig, "/streamlogs/"+apiName) |