Skip to content

stop_project_version

stop_project_version(
    project_version_arn: ProjectVersionArn,
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> StopProjectVersionResponse

This operation applies only to Amazon Rekognition Custom Labels.

Stops a running model. The operation might take a while to complete. To check the current status, call DescribeProjectVersions. Only applies to Custom Labels projects.

This operation requires permissions to perform the rekognition:StopProjectVersion action.

Parameters:

  • project_version_arn (ProjectVersionArn) –

    The Amazon Resource Name (ARN) of the model version that you want to stop.

    This operation requires permissions to perform the rekognition:StopProjectVersion action.

Raises:

Examples:

To stop an Amazon Rekognition Custom Labels model. Stops a version of an Amazon Rekognition Custom Labels model.

>>> client.stop_project_version(project_version_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958')
Source code in docs_src/capo_rekognition/_services/rekognition.py
def stop_project_version(
    self,
    project_version_arn: "capo_rekognition.types.project_version_arn.ProjectVersionArn",
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> "capo_rekognition.types.stop_project_version_response.StopProjectVersionResponse":
    """<note> <p>This operation applies only to Amazon Rekognition Custom Labels.</p> </note> <p>Stops a running model. The operation might take a while to complete. To check the current status, call <a>DescribeProjectVersions</a>. Only applies to Custom Labels projects.</p> <p>This operation requires permissions to perform the <code>rekognition:StopProjectVersion</code> action.</p>

    Args:
        project_version_arn: <p>The Amazon Resource Name (ARN) of the model version that you want to stop.</p> <p>This operation requires permissions to perform the <code>rekognition:StopProjectVersion</code> action.</p>

    Raises:
        capo_rekognition.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform the action.</p>
        capo_rekognition.errors.internal_server_error.InternalServerError: <p>Amazon Rekognition experienced a service issue. Try your call again.</p>
        capo_rekognition.errors.invalid_parameter_exception.InvalidParameterException: <p>Input parameter violated a constraint. Validate your parameter before calling the API operation again.</p>
        capo_rekognition.errors.provisioned_throughput_exceeded_exception.ProvisionedThroughputExceededException: <p>The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.</p>
        capo_rekognition.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is already being used.</p>
        capo_rekognition.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request cannot be found.</p>
        capo_rekognition.errors.throttling_exception.ThrottlingException: <p>Amazon Rekognition is temporarily unable to process the request. Try your call again.</p>
        capo_rekognition.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To stop an Amazon Rekognition Custom Labels model.
        Stops a version of an Amazon Rekognition Custom Labels model.

        >>> client.stop_project_version(project_version_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-project/version/1/1690556751958')
    """

    def _handler(
        req: "OperationRequest[capo_rekognition.types.stop_project_version_request.StopProjectVersionRequest]",
    ) -> OperationResponse[
        "capo_rekognition.types.stop_project_version_response.StopProjectVersionResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.stop_project_version

        output, http_response = (
            capo_rekognition._operations.rekognition_service.stop_project_version.stop_project_version(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopProjectVersion")
    )
    input_: capo_rekognition.types.stop_project_version_request.StopProjectVersionRequest = {
        "project_version_arn": project_version_arn
    }

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