Skip to content

list_model_import_jobs async

list_model_import_jobs(
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    creation_time_after: Optional[Timestamp] = None,
    creation_time_before: Optional[Timestamp] = None,
    status_equals: Optional[ModelImportJobStatus] = None,
    name_contains: Optional[JobName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    sort_by: Optional[SortJobsBy] = None,
    sort_order: Optional[SortOrder] = None,
) -> ListModelImportJobsResponse

Returns a list of import jobs you've submitted. You can filter the results to return based on one or more criteria. For more information, see Import a customized model in the Amazon Bedrock User Guide.

Parameters:

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

    Return import jobs that were created after the specified time.

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

    Return import jobs that were created before the specified time.

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

    Return imported jobs with the specified status.

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

    Return imported jobs only if the job name contains these characters.

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

    The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.

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

    If the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

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

    The field to sort by in the returned list of imported jobs.

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

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

Raises:

Source code in docs_src/capo_bedrock/_services/async_bedrock.py
async def list_model_import_jobs(
    self,
    *,
    config_overrides: Optional[AsyncBedrockClientConfig] = None,
    creation_time_after: Optional["capo_bedrock.types.timestamp.Timestamp"] = None,
    creation_time_before: Optional["capo_bedrock.types.timestamp.Timestamp"] = None,
    status_equals: Optional[
        "capo_bedrock.types.model_import_job_status.ModelImportJobStatus"
    ] = None,
    name_contains: Optional["capo_bedrock.types.job_name.JobName"] = 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_import_jobs_response.ListModelImportJobsResponse"
):
    """<p>Returns a list of import jobs you've submitted. You can filter the results to return based on one or more criteria. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">Import a customized model</a> in the <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon Bedrock User Guide</a>.</p>

    Args:
        creation_time_after: <p>Return import jobs that were created after the specified time.</p>
        creation_time_before: <p>Return import jobs that were created before the specified time.</p>
        status_equals: <p>Return imported jobs with the specified status.</p>
        name_contains: <p>Return imported jobs only if the job name contains these characters.</p>
        max_results: <p>The maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the <code>nextToken</code> field when making another request to return the next batch of results.</p>
        next_token: <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, enter the token returned in the <code>nextToken</code> field in the response in this field to return the next batch of results.</p>
        sort_by: <p>The field to sort by in the returned list of imported jobs.</p>
        sort_order: <p>Specifies whether to sort the results in 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock.types.list_model_import_jobs_request.ListModelImportJobsRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock.types.list_model_import_jobs_response.ListModelImportJobsResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_model_import_jobs

        (
            output,
            http_response,
        ) = await capo_bedrock._operations.amazon_bedrock_control_plane_service.list_model_import_jobs.async_list_model_import_jobs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListModelImportJobs")
    )
    input_: capo_bedrock.types.list_model_import_jobs_request.ListModelImportJobsRequest = {}
    if creation_time_after is not None:
        input_["creation_time_after"] = creation_time_after
    if creation_time_before is not None:
        input_["creation_time_before"] = creation_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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output