Skip to content

list_trained_model_versions

list_trained_model_versions(
    membership_identifier: UUID,
    trained_model_arn: TrainedModelArn,
    *,
    config_overrides: Optional[CleanRoomsMLClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    status: Optional[TrainedModelStatus] = None,
) -> ListTrainedModelVersionsResponse

Returns a list of trained model versions for a specified trained model. This operation allows you to view all versions of a trained model, including information about their status and creation details. You can use this to track the evolution of your trained models and select specific versions for inference or further training.

Parameters:

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

    The pagination token from a previous ListTrainedModelVersions request. Use this token to retrieve the next page of results.

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

    The maximum number of trained model versions to return in a single page. The default value is 10, and the maximum value is 100.

  • membership_identifier (UUID) –

    The membership identifier for the collaboration that contains the trained model.

  • trained_model_arn (TrainedModelArn) –

    The Amazon Resource Name (ARN) of the trained model for which to list versions.

  • status (Optional[TrainedModelStatus], default: None ) –

    Filter the results to only include trained model versions with the specified status. Valid values include CREATE_PENDING, CREATE_IN_PROGRESS, ACTIVE, CREATE_FAILED, and others.

Raises:

Source code in docs_src/capo_cleanroomsml/_services/clean_rooms_ml.py
def list_trained_model_versions(
    self,
    membership_identifier: "capo_cleanroomsml.types.uuid.UUID",
    trained_model_arn: "capo_cleanroomsml.types.trained_model_arn.TrainedModelArn",
    *,
    config_overrides: Optional[CleanRoomsMLClientConfig] = None,
    next_token: Optional["capo_cleanroomsml.types.next_token.NextToken"] = None,
    max_results: Optional["capo_cleanroomsml.types.max_results.MaxResults"] = None,
    status: Optional[
        "capo_cleanroomsml.types.trained_model_status.TrainedModelStatus"
    ] = None,
) -> "capo_cleanroomsml.types.list_trained_model_versions_response.ListTrainedModelVersionsResponse":
    """<p>Returns a list of trained model versions for a specified trained model. This operation allows you to view all versions of a trained model, including information about their status and creation details. You can use this to track the evolution of your trained models and select specific versions for inference or further training.</p>

    Args:
        next_token: <p>The pagination token from a previous <code>ListTrainedModelVersions</code> request. Use this token to retrieve the next page of results.</p>
        max_results: <p>The maximum number of trained model versions to return in a single page. The default value is 10, and the maximum value is 100.</p>
        membership_identifier: <p>The membership identifier for the collaboration that contains the trained model.</p>
        trained_model_arn: <p>The Amazon Resource Name (ARN) of the trained model for which to list versions.</p>
        status: <p>Filter the results to only include trained model versions with the specified status. Valid values include <code>CREATE_PENDING</code>, <code>CREATE_IN_PROGRESS</code>, <code>ACTIVE</code>, <code>CREATE_FAILED</code>, and others.</p>

    Raises:
        capo_cleanroomsml.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_cleanroomsml.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource you are requesting does not exist.</p>
        capo_cleanroomsml.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_cleanroomsml.errors.validation_exception.ValidationException: <p>The request parameters for this request are incorrect.</p>
        capo_cleanroomsml.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cleanroomsml.types.list_trained_model_versions_request.ListTrainedModelVersionsRequest]",
    ) -> OperationResponse[
        "capo_cleanroomsml.types.list_trained_model_versions_response.ListTrainedModelVersionsResponse"
    ]:
        import capo_cleanroomsml._operations.aws_stark_control_service.list_trained_model_versions

        output, http_response = (
            capo_cleanroomsml._operations.aws_stark_control_service.list_trained_model_versions.list_trained_model_versions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListTrainedModelVersions")
    )
    input_: capo_cleanroomsml.types.list_trained_model_versions_request.ListTrainedModelVersionsRequest = {
        "membership_identifier": membership_identifier,
        "trained_model_arn": trained_model_arn,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if status is not None:
        input_["status"] = status

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