Skip to content

list_model_versions async

list_model_versions(
    model_name: ModelName,
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    status: Optional[ModelVersionStatus] = None,
    source_type: Optional[ModelVersionSourceType] = None,
    created_at_end_time: Optional[Timestamp] = None,
    created_at_start_time: Optional[Timestamp] = None,
    max_model_version: Optional[ModelVersion] = None,
    min_model_version: Optional[ModelVersion] = None,
) -> ListModelVersionsResponse

Generates a list of all model versions for a given model, including the model version, model version ARN, and status. To list a subset of versions, use the MaxModelVersion and MinModelVersion fields.

Parameters:

  • model_name (ModelName) –

    Then name of the machine learning model for which the model versions are to be listed.

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

    If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the NextToken field in the request to list the next page of results.

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

    Specifies the maximum number of machine learning model versions to list.

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

    Filter the results based on the current status of the model version.

  • source_type (Optional[ModelVersionSourceType], default: None ) –

    Filter the results based on the way the model version was generated.

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

    Filter results to return all the model versions created before this time.

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

    Filter results to return all the model versions created after this time.

  • max_model_version (Optional[ModelVersion], default: None ) –

    Specifies the highest version of the model to return in the list.

  • min_model_version (Optional[ModelVersion], default: None ) –

    Specifies the lowest version of the model to return in the list.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have access to the resource.

  • InternalServerException –

    Processing of the request has failed because of an unknown error, exception or failure.

  • ResourceNotFoundException –

    The resource requested could not be found. Verify the resource ID and retry your request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized.

  • UnknownServiceError –

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

Source code in docs_src/capo_lookoutequipment/_services/async_lookout_equipment.py
async def list_model_versions(
    self,
    model_name: "capo_lookoutequipment.types.model_name.ModelName",
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    next_token: Optional["capo_lookoutequipment.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_lookoutequipment.types.max_results.MaxResults"
    ] = None,
    status: Optional[
        "capo_lookoutequipment.types.model_version_status.ModelVersionStatus"
    ] = None,
    source_type: Optional[
        "capo_lookoutequipment.types.model_version_source_type.ModelVersionSourceType"
    ] = None,
    created_at_end_time: Optional[
        "capo_lookoutequipment.types.timestamp.Timestamp"
    ] = None,
    created_at_start_time: Optional[
        "capo_lookoutequipment.types.timestamp.Timestamp"
    ] = None,
    max_model_version: Optional[
        "capo_lookoutequipment.types.model_version.ModelVersion"
    ] = None,
    min_model_version: Optional[
        "capo_lookoutequipment.types.model_version.ModelVersion"
    ] = None,
) -> "capo_lookoutequipment.types.list_model_versions_response.ListModelVersionsResponse":
    """<p>Generates a list of all model versions for a given model, including the model version, model version ARN, and status. To list a subset of versions, use the <code>MaxModelVersion</code> and <code>MinModelVersion</code> fields.</p>

    Args:
        model_name: <p>Then name of the machine learning model for which the model versions are to be listed.</p>
        next_token: <p>If the total number of results exceeds the limit that the response can display, the response returns an opaque pagination token indicating where to continue the listing of machine learning model versions. Use this token in the <code>NextToken</code> field in the request to list the next page of results.</p>
        max_results: <p>Specifies the maximum number of machine learning model versions to list.</p>
        status: <p>Filter the results based on the current status of the model version.</p>
        source_type: <p>Filter the results based on the way the model version was generated.</p>
        created_at_end_time: <p>Filter results to return all the model versions created before this time.</p>
        created_at_start_time: <p>Filter results to return all the model versions created after this time.</p>
        max_model_version: <p>Specifies the highest version of the model to return in the list.</p>
        min_model_version: <p>Specifies the lowest version of the model to return in the list.</p>

    Raises:
        capo_lookoutequipment.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have access to the resource. </p>
        capo_lookoutequipment.errors.internal_server_exception.InternalServerException: <p> Processing of the request has failed because of an unknown error, exception or failure. </p>
        capo_lookoutequipment.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource requested could not be found. Verify the resource ID and retry your request. </p>
        capo_lookoutequipment.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_lookoutequipment.errors.validation_exception.ValidationException: <p> The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized. </p>
        capo_lookoutequipment.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lookoutequipment.types.list_model_versions_request.ListModelVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lookoutequipment.types.list_model_versions_response.ListModelVersionsResponse"
    ]:
        import capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.list_model_versions

        (
            output,
            http_response,
        ) = await capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.list_model_versions.async_list_model_versions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListModelVersions")
    )
    input_: capo_lookoutequipment.types.list_model_versions_request.ListModelVersionsRequest = {
        "model_name": model_name
    }
    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
    if source_type is not None:
        input_["source_type"] = source_type
    if created_at_end_time is not None:
        input_["created_at_end_time"] = created_at_end_time
    if created_at_start_time is not None:
        input_["created_at_start_time"] = created_at_start_time
    if max_model_version is not None:
        input_["max_model_version"] = max_model_version
    if min_model_version is not None:
        input_["min_model_version"] = min_model_version

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