Skip to content

list_jobs

list_jobs(
    account_id: AccountId,
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    job_statuses: Optional[JobStatusList] = None,
    next_token: Optional[StringForNextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListJobsResult

Lists current S3 Batch Operations jobs as well as the jobs that have ended within the last 90 days for the Amazon Web Services account making the request. For more information, see S3 Batch Operations in the Amazon S3 User Guide.

Permissions

To use the ListJobs operation, you must have permission to perform the s3:ListJobs action.

Related actions include:

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID associated with the S3 Batch Operations job.

  • job_statuses (Optional[JobStatusList], default: None ) –

    The List Jobs request returns jobs that match the statuses listed in this element.

  • next_token (Optional[StringForNextToken], default: None ) –

    A pagination token to request the next page of results. Use the token that Amazon S3 returned in the NextToken element of the ListJobsResult from the previous List Jobs request.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of jobs that Amazon S3 will include in the List Jobs response. If there are more jobs than this number, the response will include a pagination token in the NextToken field to enable you to retrieve the next page of results.

Raises:

Source code in docs_src/capo_s3_control/_services/s3_control.py
def list_jobs(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
    job_statuses: Optional[
        "capo_s3_control.types.job_status_list.JobStatusList"
    ] = None,
    next_token: Optional[
        "capo_s3_control.types.string_for_next_token.StringForNextToken"
    ] = None,
    max_results: Optional["capo_s3_control.types.max_results.MaxResults"] = None,
) -> "capo_s3_control.types.list_jobs_result.ListJobsResult":
    """<p>Lists current S3 Batch Operations jobs as well as the jobs that have ended within the last 90 days for the Amazon Web Services account making the request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops.html">S3 Batch Operations</a> in the <i>Amazon S3 User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>To use the <code>ListJobs</code> operation, you must have permission to perform the <code>s3:ListJobs</code> action.</p> </dd> </dl> <p>Related actions include:</p> <p></p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> </p> </li> </ul>

    Args:
        account_id: <p>The Amazon Web Services account ID associated with the S3 Batch Operations job.</p>
        job_statuses: <p>The <code>List Jobs</code> request returns jobs that match the statuses listed in this element.</p>
        next_token: <p>A pagination token to request the next page of results. Use the token that Amazon S3 returned in the <code>NextToken</code> element of the <code>ListJobsResult</code> from the previous <code>List Jobs</code> request.</p>
        max_results: <p>The maximum number of jobs that Amazon S3 will include in the <code>List Jobs</code> response. If there are more jobs than this number, the response will include a pagination token in the <code>NextToken</code> field to enable you to retrieve the next page of results.</p>

    Raises:
        capo_s3_control.errors.internal_service_exception.InternalServiceException: <p></p>
        capo_s3_control.errors.invalid_next_token_exception.InvalidNextTokenException: <p></p>
        capo_s3_control.errors.invalid_request_exception.InvalidRequestException: <p></p>
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3_control.types.list_jobs_request.ListJobsRequest]",
    ) -> OperationResponse["capo_s3_control.types.list_jobs_result.ListJobsResult"]:
        import capo_s3_control._operations.awss3_control_service_v20180820.list_jobs

        output, http_response = (
            capo_s3_control._operations.awss3_control_service_v20180820.list_jobs.list_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListJobs")
    )
    input_: capo_s3_control.types.list_jobs_request.ListJobsRequest = {
        "account_id": account_id
    }
    if job_statuses is not None:
        input_["job_statuses"] = job_statuses
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output