list-jobs
The list-jobs command lists batch jobs.
Usage notes
By default, an Alibaba Cloud account has the permissions to query the list of batch jobs. To perform this operation by using a RAM user or Security Token Service (STS), you must have the oss:ListJobs permission. For more information, see Grant a custom policy.
Command syntax
ossutil api list-jobs [flags]
|
Parameter |
Type |
Description |
|
--batch-job-statuses |
string |
The job status used to filter the results. Valid values: Active, Cancelled, Cancelling, Complete, Completing, Failed, Failing, New, Paused, Pausing, Preparing, Ready, and Suspended. You can specify multiple statuses separated by vertical bars (|), for example |
|
--max-keys |
int |
The maximum number of jobs to return. Valid values: 1 to 1000. Default value: 100. |
|
--continuation-token |
string |
The pagination token. Set the value to the NextToken value returned in the previous request. The value must be 1 to 1024 characters in length and can contain A-Z, a-z, 0-9, plus signs (+), colons (:), forward slashes (/), equal signs (=), question marks (?), number signs (#), hyphens (-), and underscores (_). |
-
This command requires ossutil 2.4.1 or later.
-
If a single request does not return all jobs, the response contains NextToken. You can use this value as the
--continuation-tokenvalue in the next request to continue listing jobs. -
For more information about the supported global command-line options, see Global command-line options.
Job statuses
The Status field in the command output indicates the current execution status of the job. Valid values:
|
Status |
Description |
|
New |
The job is created but has not started preparing. |
|
Preparing |
OSS is parsing the manifest file, verifying permissions, and initializing execution resources. |
|
Ready |
The job has finished preparing and is waiting to be scheduled. |
|
Suspended |
The job requires explicit confirmation before it continues, because ConfirmationRequired was set to true when the job was created. |
|
Active |
The job is processing objects in batches. You can view the real-time progress in ProgressSummary. |
|
Pausing |
OSS is pausing the job. |
|
Paused |
The job is paused. OSS automatically resumes the job. |
|
Completing |
All objects are processed. OSS is generating the execution report and releasing resources. |
|
Complete |
The job is complete. This is a final state. |
|
Cancelling |
OSS is canceling the job. |
|
Cancelled |
The job is canceled by the user. This is a final state. |
|
Failing |
The job encountered a critical error and OSS is terminating it. |
|
Failed |
The job is terminated because of a system error. For more information, see FailureReasons in the response. This is a final state. |
Usage examples
List all batch jobs.
ossutil api list-jobs
List all batch jobs and display the output in JSON format.
ossutil api list-jobs --output-format json
List up to 100 batch jobs.
ossutil api list-jobs --max-keys 100
List only the batch jobs whose status is Complete.
ossutil api list-jobs --batch-job-statuses Complete
List the batch jobs whose status is Active or Complete.
ossutil api list-jobs --batch-job-statuses "Active|Complete"
Continue listing batch jobs from the pagination token CgJiYw123.
ossutil api list-jobs --continuation-token CgJiYw123