list_jobs
¶
list_jobs(
account_id: string,
vault_name: string,
*,
config_overrides: Optional[GlacierClientConfig] = None,
limit: Optional[int] = None,
marker: Optional[string] = None,
statuscode: Optional[string] = None,
completed: Optional[string] = None,
) -> ListJobsOutput
This operation lists jobs for a vault, including jobs that are in-progress and jobs that have recently finished. The List Job operation returns a list of these jobs sorted by job initiation time.
Amazon Glacier retains recently completed jobs for a period before deleting them; however, it eventually removes completed jobs. The output of completed jobs can be retrieved. Retaining completed jobs for a period of time after they have completed enables you to get a job output in the event you miss the job completion notification or your first attempt to download it fails. For example, suppose you start an archive retrieval job to download an archive. After the job completes, you start to download the archive but encounter a network error. In this scenario, you can retry and download the archive while the job exists.
The List Jobs operation supports pagination. You should always check the response Marker field. If there are no more jobs to list, the Marker field is set to null. If there are more jobs to list, the Marker field is set to a non-null value, which you can use to continue the pagination of the list. To return a list of jobs that begins at a specific job, set the marker request parameter to the Marker value for that job that you obtained from a previous List Jobs request.
You can set a maximum limit for the number of jobs returned in the response by specifying the limit parameter in the request. The default limit is 50. The number of jobs returned might be fewer than the limit, but the number of returned jobs never exceeds the limit.
Additionally, you can filter the jobs list returned by specifying the optional statuscode parameter or completed parameter, or both. Using the statuscode parameter, you can specify to return only jobs that match either the InProgress, Succeeded, or Failed status. Using the completed parameter, you can specify to return only jobs that were completed (true) or jobs that were not completed (false).
For more information about using this operation, see the documentation for the underlying REST API List Jobs.
Parameters:
-
account_id(string) –The
AccountIdvalue is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID. -
vault_name(string) –The name of the vault.
-
limit(Optional[int], default:None) –The maximum number of jobs to be returned. The default limit is 50. The number of jobs returned might be fewer than the specified limit, but the number of returned jobs never exceeds the limit.
-
marker(Optional[string], default:None) –An opaque string used for pagination. This value specifies the job at which the listing of jobs should begin. Get the marker value from a previous List Jobs response. You only need to include the marker if you are continuing the pagination of results started in a previous List Jobs request.
-
statuscode(Optional[string], default:None) –The type of job status to return. You can specify the following values:
InProgress,Succeeded, orFailed. -
completed(Optional[string], default:None) –The state of the jobs to return. You can specify
trueorfalse.
Raises:
-
InvalidParameterValueException–Returned if a parameter of the request is incorrectly specified.
-
MissingParameterValueException–Returned if a required header or parameter is missing from the request.
-
NoLongerSupportedException–Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.
-
ResourceNotFoundException–Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.
-
ServiceUnavailableException–Returned if the service cannot complete the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list jobs for a vault The example lists jobs for the vault named my-vault.
Source code in docs_src/capo_glacier/_services/glacier.py
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 | |