@@ -45,10 +45,13 @@ const (
4545type AzcopyJobState string
4646
4747const (
48- AzcopyJobError AzcopyJobState = "Error"
49- AzcopyJobNotFound AzcopyJobState = "NotFound"
50- AzcopyJobRunning AzcopyJobState = "Running"
51- AzcopyJobCompleted AzcopyJobState = "Completed"
48+ AzcopyJobError AzcopyJobState = "Error"
49+ AzcopyJobNotFound AzcopyJobState = "NotFound"
50+ AzcopyJobRunning AzcopyJobState = "Running"
51+ AzcopyJobCompleted AzcopyJobState = "Completed"
52+ AzcopyJobCompletedWithErrors AzcopyJobState = "CompletedWithErrors"
53+ AzcopyJobCompletedWithSkipped AzcopyJobState = "CompletedWithSkipped"
54+ AzcopyJobCompletedWithErrorsAndSkipped AzcopyJobState = "CompletedWithErrorsAndSkipped"
5255)
5356
5457// RoundUpBytes rounds up the volume size in bytes up to multiplications of GiB
@@ -242,9 +245,6 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string, authAzcopyEnv []string)
242245 // Start Time: Wednesday, 09-Aug-23 09:09:03 UTC
243246 // Status: Cancelled
244247 // Command: copy https://{accountName}.file.core.windows.net/{srcBlobContainer}{SAStoken} https://{accountName}.file.core.windows.net/{dstBlobContainer}{SAStoken} --recursive --check-length=false
245- if ac .ExecCmd == nil {
246- ac .ExecCmd = & ExecCommand {}
247- }
248248 out , err := ac .ExecCmd .RunCommand (cmdStr , authAzcopyEnv )
249249 // if grep command returns nothing, the exec will return exit status 1 error, so filter this error
250250 if err != nil && err .Error () != "exit status 1" {
@@ -278,13 +278,8 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string, authAzcopyEnv []string)
278278 return jobState , percent , nil
279279}
280280
281- // TestListJobs test azcopy jobs list command with authAzcopyEnv
282- func (ac * Azcopy ) TestListJobs (accountName , storageEndpointSuffix string , authAzcopyEnv []string ) (string , error ) {
283- cmdStr := fmt .Sprintf ("azcopy list %s" , fmt .Sprintf ("https://%s.blob.%s" , accountName , storageEndpointSuffix ))
284- if ac .ExecCmd == nil {
285- ac .ExecCmd = & ExecCommand {}
286- }
287- return ac .ExecCmd .RunCommand (cmdStr , authAzcopyEnv )
281+ func (ac * Azcopy ) CleanJobs () (string , error ) {
282+ return ac .ExecCmd .RunCommand ("azcopy jobs clean" , nil )
288283}
289284
290285// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist
0 commit comments