Skip to content

list_jobs async

list_jobs(
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    max_results: Optional[ListLimit] = None,
    next_token: Optional[String] = None,
) -> ListJobsResult

Returns an array of JobListEntry objects of the specified length. Each JobListEntry object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. Calling this API action in one of the US regions will return jobs from the list of all jobs associated with this account in all US regions.

Parameters:

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

    The number of JobListEntry objects to return.

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

    HTTP requests are stateless. To identify what object comes "next" in the list of JobListEntry objects, you have the option of specifying NextToken as the starting point for your returned list.

Raises:

  • InvalidNextTokenException –

    The NextToken string was altered unexpectedly, and the operation has stopped. Run the operation without changing the NextToken string, and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_snowball/_services/async_snowball.py
async def list_jobs(
    self,
    *,
    config_overrides: Optional[AsyncSnowballClientConfig] = None,
    max_results: Optional["capo_snowball.types.list_limit.ListLimit"] = None,
    next_token: Optional["capo_snowball.types.string.String"] = None,
) -> "capo_snowball.types.list_jobs_result.ListJobsResult":
    """<p>Returns an array of <code>JobListEntry</code> objects of the specified length. Each <code>JobListEntry</code> object contains a job's state, a job's ID, and a value that indicates whether the job is a job part, in the case of export jobs. Calling this API action in one of the US regions will return jobs from the list of all jobs associated with this account in all US regions.</p>

    Args:
        max_results: <p>The number of <code>JobListEntry</code> objects to return.</p>
        next_token: <p>HTTP requests are stateless. To identify what object comes "next" in the list of <code>JobListEntry</code> objects, you have the option of specifying <code>NextToken</code> as the starting point for your returned list.</p>

    Raises:
        capo_snowball.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> string was altered unexpectedly, and the operation has stopped. Run the operation without changing the <code>NextToken</code> string, and try again.</p>
        capo_snowball.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_snowball.types.list_jobs_request.ListJobsRequest]",
    ) -> AsyncOperationResponse[
        "capo_snowball.types.list_jobs_result.ListJobsResult"
    ]:
        import capo_snowball._operations.awsie_snowball_job_management_service.list_jobs

        (
            output,
            http_response,
        ) = await capo_snowball._operations.awsie_snowball_job_management_service.list_jobs.async_list_jobs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output