Skip to content

delete_solution

delete_solution(
    solution_arn: Arn, *, config_overrides: Optional[PersonalizeClientConfig] = None
) -> None

Deletes all versions of a solution and the Solution object itself. Before deleting a solution, you must delete all campaigns based on the solution. To determine what campaigns are using the solution, call ListCampaigns and supply the Amazon Resource Name (ARN) of the solution. You can't delete a solution if an associated SolutionVersion is in the CREATE PENDING or IN PROGRESS state. For more information on solutions, see CreateSolution.

Parameters:

  • solution_arn (Arn) –

    The ARN of the solution to delete.

Raises:

Source code in docs_src/capo_personalize/_services/personalize.py
def delete_solution(
    self,
    solution_arn: "capo_personalize.types.arn.Arn",
    *,
    config_overrides: Optional[PersonalizeClientConfig] = None,
) -> None:
    """<p>Deletes all versions of a solution and the <code>Solution</code> object itself. Before deleting a solution, you must delete all campaigns based on the solution. To determine what campaigns are using the solution, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListCampaigns.html">ListCampaigns</a> and supply the Amazon Resource Name (ARN) of the solution. You can't delete a solution if an associated <code>SolutionVersion</code> is in the CREATE PENDING or IN PROGRESS state. For more information on solutions, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html">CreateSolution</a>.</p>

    Args:
        solution_arn: <p>The ARN of the solution to delete.</p>

    Raises:
        capo_personalize.errors.invalid_input_exception.InvalidInputException: <p>Provide a valid value for the field or parameter.</p>
        capo_personalize.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_personalize.errors.resource_not_found_exception.ResourceNotFoundException: <p>Could not find the specified resource.</p>
        capo_personalize.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_personalize.types.delete_solution_request.DeleteSolutionRequest]",
    ) -> OperationResponse[None]:
        import capo_personalize._operations.amazon_personalize.delete_solution

        output, http_response = (
            capo_personalize._operations.amazon_personalize.delete_solution.delete_solution(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSolution")
    )
    input_: capo_personalize.types.delete_solution_request.DeleteSolutionRequest = {
        "solution_arn": solution_arn
    }

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