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

Function BatchJobLogURL

pkg/operator/operator/workload_logging.go:136–164  ·  view source on GitHub ↗
(apiName string, jobStatus status.BatchJobStatus)

Source from the content-addressed store, hash-verified

134}
135
136func BatchJobLogURL(apiName string, jobStatus status.BatchJobStatus) (string, error) {
137 partition := "aws.amazon"
138 region := config.ClusterConfig.Region
139 if awslib.PartitionFromRegion(region) == "aws-us-gov" {
140 partition = "amazonaws-us-gov"
141 }
142 logGroup := config.ClusterConfig.ClusterName
143
144 if jobStatus.EndTime != nil {
145 endTime := *jobStatus.EndTime
146 endTime = endTime.Add(60 * time.Second)
147 return completedBatchJobLogsURL(completedJobLogURLTemplateArgs{
148 Partition: partition,
149 Region: region,
150 StartTime: timeString(jobStatus.StartTime),
151 EndTime: timeString(endTime),
152 LogGroup: logGroup,
153 APIName: apiName,
154 JobID: jobStatus.ID,
155 })
156 }
157 return inProgressBatchJobLogsURL(inProgressJobLogURLTemplateArgs{
158 Partition: partition,
159 Region: region,
160 LogGroup: logGroup,
161 APIName: apiName,
162 JobID: jobStatus.ID,
163 })
164}
165
166func TaskJobLogURL(apiName string, jobStatus status.TaskJobStatus) (string, error) {
167 partition := "aws.amazon"

Callers 1

GetJobLogURLFunction · 0.92

Calls 4

completedBatchJobLogsURLFunction · 0.85
timeStringFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected