Skip to content

list_model_copy_jobs

list_model_copy_jobs(
    *,
    config_overrides: Optional[BedrockClientConfig] = None,
    creation_time_after: Optional[Timestamp] = None,
    creation_time_before: Optional[Timestamp] = None,
    status_equals: Optional[ModelCopyJobStatus] = None,
    source_account_equals: Optional[AccountId] = None,
    source_model_arn_equals: Optional[ModelArn] = None,
    target_model_name_contains: Optional[CustomModelName] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
    sort_by: Optional[SortJobsBy] = None,
    sort_order: Optional[SortOrder] = None,
) -> ListModelCopyJobsResponse

Returns a list of model copy jobs that you have submitted. You can filter the jobs to return based on one or more criteria. For more information, see Copy models to be used in other regions in the Amazon Bedrock User Guide.

Parameters:

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

    Filters for model copy jobs created after the specified time.

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

    Filters for model copy jobs created before the specified time.

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

    Filters for model copy jobs whose status matches the value that you specify.

  • source_account_equals (Optional[AccountId], default: None ) –

    Filters for model copy jobs in which the account that the source model belongs to is equal to the value that you specify.

  • source_model_arn_equals (Optional[ModelArn], default: None ) –

    Filters for model copy jobs in which the Amazon Resource Name (ARN) of the source model to is equal to the value that you specify.

  • target_model_name_contains (Optional[CustomModelName], default: None ) –

    Filters for model copy jobs in which the name of the copied model contains the string that you specify.

  • 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 model copy 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/bedrock.py
def list_model_copy_jobs(
    self,
    *,
    config_overrides: Optional[BedrockClientConfig] = 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_copy_job_status.ModelCopyJobStatus"
    ] = None,
    source_account_equals: Optional[
        "capo_bedrock.types.account_id.AccountId"
    ] = None,
    source_model_arn_equals: Optional[
        "capo_bedrock.types.model_arn.ModelArn"
    ] = None,
    target_model_name_contains: Optional[
        "capo_bedrock.types.custom_model_name.CustomModelName"
    ] = 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_copy_jobs_response.ListModelCopyJobsResponse":
    """<p>Returns a list of model copy jobs that you have submitted. You can filter the jobs to return based on one or more criteria. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/copy-model.html">Copy models to be used in other regions</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>Filters for model copy jobs created after the specified time.</p>
        creation_time_before: <p>Filters for model copy jobs created before the specified time. </p>
        status_equals: <p>Filters for model copy jobs whose status matches the value that you specify.</p>
        source_account_equals: <p>Filters for model copy jobs in which the account that the source model belongs to is equal to the value that you specify.</p>
        source_model_arn_equals: <p>Filters for model copy jobs in which the Amazon Resource Name (ARN) of the source model to is equal to the value that you specify.</p>
        target_model_name_contains: <p>Filters for model copy jobs in which the name of the copied model contains the string that you specify.</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 model copy 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.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.</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_copy_jobs_request.ListModelCopyJobsRequest]",
    ) -> OperationResponse[
        "capo_bedrock.types.list_model_copy_jobs_response.ListModelCopyJobsResponse"
    ]:
        import capo_bedrock._operations.amazon_bedrock_control_plane_service.list_model_copy_jobs

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListModelCopyJobs")
    )
    input_: capo_bedrock.types.list_model_copy_jobs_request.ListModelCopyJobsRequest = {}
    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 source_account_equals is not None:
        input_["source_account_equals"] = source_account_equals
    if source_model_arn_equals is not None:
        input_["source_model_arn_equals"] = source_model_arn_equals
    if target_model_name_contains is not None:
        input_["target_model_name_contains"] = target_model_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