Skip to content

delete_project

delete_project(
    project_arn: ProjectArn,
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> DeleteProjectResponse

Deletes a Amazon Rekognition project. To delete a project you must first delete all models or adapters associated with the project. To delete a model or adapter, see DeleteProjectVersion.

DeleteProject is an asynchronous operation. To check if the project is deleted, call DescribeProjects. The project is deleted when the project no longer appears in the response. Be aware that deleting a given project will also delete any ProjectPolicies associated with that project.

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

Parameters:

  • project_arn (ProjectArn) –

    The Amazon Resource Name (ARN) of the project that you want to delete.

Raises:

Examples:

To delete an Amazon Rekognition Custom Labels project Deletes an Amazon Rekognition Custom Labels projects.

>>> client.delete_project(project_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690405809285')
Source code in docs_src/capo_rekognition/_services/rekognition.py
def delete_project(
    self,
    project_arn: "capo_rekognition.types.project_arn.ProjectArn",
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> "capo_rekognition.types.delete_project_response.DeleteProjectResponse":
    """<p>Deletes a Amazon Rekognition project. To delete a project you must first delete all models or adapters associated with the project. To delete a model or adapter, see <a>DeleteProjectVersion</a>.</p> <p> <code>DeleteProject</code> is an asynchronous operation. To check if the project is deleted, call <a>DescribeProjects</a>. The project is deleted when the project no longer appears in the response. Be aware that deleting a given project will also delete any <code>ProjectPolicies</code> associated with that project.</p> <p>This operation requires permissions to perform the <code>rekognition:DeleteProject</code> action. </p>

    Args:
        project_arn: <p>The Amazon Resource Name (ARN) of the project that you want to delete.</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 delete an Amazon Rekognition Custom Labels project
        Deletes an Amazon Rekognition Custom Labels projects.

        >>> client.delete_project(project_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-project/1690405809285')
    """

    def _handler(
        req: "OperationRequest[capo_rekognition.types.delete_project_request.DeleteProjectRequest]",
    ) -> OperationResponse[
        "capo_rekognition.types.delete_project_response.DeleteProjectResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.delete_project

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteProject")
    )
    input_: capo_rekognition.types.delete_project_request.DeleteProjectRequest = {
        "project_arn": project_arn
    }

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