Skip to content

list_model_invocation_jobs

list_model_invocation_jobs(
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    submit_time_after: Optional[Timestamp] = None,
    submit_time_before: Optional[Timestamp] = None,
    status_equals: Optional[ModelInvocationJobStatus] = None,
    name_contains: Optional[ModelInvocationJobName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    sort_by: Optional[SortJobsBy] = None,
    sort_order: Optional[SortOrder] = None,
) -> ListModelInvocationJobsResponse

Lists all batch inference jobs in the account. For more information, see View details about a batch inference job.

Parameters:

  • submit_time_after (Optional[Timestamp], default: None ) –

    Specify a time to filter for batch inference jobs that were submitted after the time you specify.

  • submit_time_before (Optional[Timestamp], default: None ) –

    Specify a time to filter for batch inference jobs that were submitted before the time you specify.

  • status_equals (Optional[ModelInvocationJobStatus], default: None ) –

    Specify a status to filter for batch inference jobs whose statuses match the string you specify.

    The following statuses are possible:

    • Submitted – This job has been submitted to a queue for validation.

    • Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following:

      • Your IAM service role has access to the Amazon S3 buckets containing your files.

      • Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model.

      • Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock.

    • Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn.

    • Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request.

    • InProgress – This job has begun. You can start viewing the results in the output S3 location.

    • Completed – This job has successfully completed. View the output files in the output S3 location.

    • PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location.

    • Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center.

    • Stopped – This job was stopped by a user.

    • Stopping – This job is being stopped by a user.

  • name_contains (Optional[ModelInvocationJobName], default: None ) –

    Specify a string to filter for batch inference jobs whose names contain the string.

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

    The maximum number of results to return. If there are more results than the number that you specify, a nextToken value is returned. Use the nextToken in a request to return the next batch of results.

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

    If there were more results than the value you specified in the maxResults field in a previous ListModelInvocationJobs request, the response would have returned a nextToken value. To see the next batch of results, send the nextToken value in another request.

  • sort_by (Optional[SortJobsBy], default: None ) –

    An attribute by which to sort the results.

  • sort_order (Optional[SortOrder], default: None ) –

    Specifies whether to sort the results by ascending or descending order.

Raises:

Source code in docs_src/capo_bedrock/_services/bedrock.py
def list_model_invocation_jobs(
    self,
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    submit_time_after: Optional["capo_bedrock.types.timestamp.Timestamp"] = None,
    submit_time_before: Optional["capo_bedrock.types.timestamp.Timestamp"] = None,
    status_equals: Optional[
        "capo_bedrock.types.model_invocation_job_status.ModelInvocationJobStatus"
    ] = None,
    name_contains: Optional[
        "capo_bedrock.types.model_invocation_job_name.ModelInvocationJobName"
    ] = None,
    max_results: Optional["capo_bedrock.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_bedrock.types.pagination_token.PaginationToken"
    ] = None,
    sort_by: Optional["capo_bedrock.types.sort_jobs_by.SortJobsBy"] = None,
    sort_order: Optional["capo_bedrock.types.sort_order.SortOrder"] = None,
) -> "capo_bedrock.types.list_model_invocation_jobs_response.ListModelInvocationJobsResponse":
    """<p>Lists all batch inference jobs in the account. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-view.html">View details about a batch inference job</a>.</p>

    Args:
        submit_time_after: <p>Specify a time to filter for batch inference jobs that were submitted after the time you specify.</p>
        submit_time_before: <p>Specify a time to filter for batch inference jobs that were submitted before the time you specify.</p>
        status_equals: <p>Specify a status to filter for batch inference jobs whose statuses match the string you specify.</p> <p>The following statuses are possible:</p> <ul> <li> <p>Submitted – This job has been submitted to a queue for validation.</p> </li> <li> <p>Validating – This job is being validated for the requirements described in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html">Format and upload your batch inference data</a>. The criteria include the following:</p> <ul> <li> <p>Your IAM service role has access to the Amazon S3 buckets containing your files.</p> </li> <li> <p>Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the <code>modelInput</code> value matches the request body for the model.</p> </li> <li> <p>Your files fulfill the requirements for file size and number of records. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html">Quotas for Amazon Bedrock</a>.</p> </li> </ul> </li> <li> <p>Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn.</p> </li> <li> <p>Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request.</p> </li> <li> <p>InProgress – This job has begun. You can start viewing the results in the output S3 location.</p> </li> <li> <p>Completed – This job has successfully completed. View the output files in the output S3 location.</p> </li> <li> <p>PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location.</p> </li> <li> <p>Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the <a href="https://console.aws.amazon.com/support/home/">Amazon Web Services Support Center</a>.</p> </li> <li> <p>Stopped – This job was stopped by a user.</p> </li> <li> <p>Stopping – This job is being stopped by a user.</p> </li> </ul>
        name_contains: <p>Specify a string to filter for batch inference jobs whose names contain the string.</p>
        max_results: <p>The maximum number of results to return. If there are more results than the number that you specify, a <code>nextToken</code> value is returned. Use the <code>nextToken</code> in a request to return the next batch of results.</p>
        next_token: <p>If there were more results than the value you specified in the <code>maxResults</code> field in a previous <code>ListModelInvocationJobs</code> request, the response would have returned a <code>nextToken</code> value. To see the next batch of results, send the <code>nextToken</code> value in another request.</p>
        sort_by: <p>An attribute by which to sort the results.</p>
        sort_order: <p>Specifies whether to sort the results by ascending or descending order.</p>

    Raises:
        capo_bedrock.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because of missing access permissions.</p>
        capo_bedrock.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_bedrock.errors.throttling_exception.ThrottlingException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_bedrock.errors.validation_exception.ValidationException: <p>Input validation failed. Check your request parameters and retry the request.</p>
        capo_bedrock.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_bedrock.types.list_model_invocation_jobs_request.ListModelInvocationJobsRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_model_invocation_jobs_response.ListModelInvocationJobsResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_model_invocation_jobs

        output, http_response = (
            capo_bedrock._operations.amazon_bedrock_control_plane_service.list_model_invocation_jobs.list_model_invocation_jobs(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_bedrock.types.list_model_invocation_jobs_response.ListModelInvocationJobsResponse",
    ) -> dict[str, Any]:
        import capo_bedrock.types.list_model_invocation_jobs_response

        return (
            capo_bedrock.types.list_model_invocation_jobs_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListModelInvocationJobs", redact_output=_redact_output),
    )
    input_: capo_bedrock.types.list_model_invocation_jobs_request.ListModelInvocationJobsRequest = {}
    if submit_time_after is not None:
        input_["submit_time_after"] = submit_time_after
    if submit_time_before is not None:
        input_["submit_time_before"] = submit_time_before
    if status_equals is not None:
        input_["status_equals"] = status_equals
    if name_contains is not None:
        input_["name_contains"] = name_contains
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order

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