@@ -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
@@ -243,9 +246,6 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string, authAzcopyEnv []string)
243246 // Start Time: Wednesday, 09-Aug-23 09:09:03 UTC
244247 // Status: Cancelled
245248 // Command: copy https://{accountName}.file.core.windows.net/{srcBlobContainer}{SAStoken} https://{accountName}.file.core.windows.net/{dstBlobContainer}{SAStoken} --recursive --check-length=false
246- if ac .ExecCmd == nil {
247- ac .ExecCmd = & ExecCommand {}
248- }
249249 out , err := ac .ExecCmd .RunCommand (cmdStr , authAzcopyEnv )
250250 // if grep command returns nothing, the exec will return exit status 1 error, so filter this error
251251 if err != nil && err .Error () != "exit status 1" {
@@ -279,13 +279,8 @@ func (ac *Azcopy) GetAzcopyJob(dstBlobContainer string, authAzcopyEnv []string)
279279 return jobState , percent , nil
280280}
281281
282- // TestListJobs test azcopy jobs list command with authAzcopyEnv
283- func (ac * Azcopy ) TestListJobs (accountName , storageEndpointSuffix string , authAzcopyEnv []string ) (string , error ) {
284- cmdStr := fmt .Sprintf ("azcopy list %s" , fmt .Sprintf ("https://%s.blob.%s" , accountName , storageEndpointSuffix ))
285- if ac .ExecCmd == nil {
286- ac .ExecCmd = & ExecCommand {}
287- }
288- return ac .ExecCmd .RunCommand (cmdStr , authAzcopyEnv )
282+ func (ac * Azcopy ) CleanJobs () (string , error ) {
283+ return ac .ExecCmd .RunCommand ("azcopy jobs clean" , nil )
289284}
290285
291286// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist
0 commit comments