Skip to content

delete_analysis async

delete_analysis(
    aws_account_id: AwsAccountId,
    analysis_id: ShortRestrictiveResourceId,
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    recovery_window_in_days: Optional[RecoveryWindowInDays] = None,
    force_delete_without_recovery: Optional[Boolean] = None,
) -> DeleteAnalysisResponse

Deletes an analysis from Amazon Quick Sight. You can optionally include a recovery window during which you can restore the analysis. If you don't specify a recovery window value, the operation defaults to 30 days. Amazon Quick Sight attaches a DeletionTime stamp to the response that specifies the end of the recovery window. At the end of the recovery window, Amazon Quick Sight deletes the analysis permanently.

At any time before recovery window ends, you can use the RestoreAnalysis API operation to remove the DeletionTime stamp and cancel the deletion of the analysis. The analysis remains visible in the API until it's deleted, so you can describe it but you can't make a template from it.

An analysis that's scheduled for deletion isn't accessible in the Amazon Quick Sight console. To access it in the console, restore it. Deleting an analysis doesn't delete the dashboards that you publish from it.

Parameters:

  • aws_account_id (AwsAccountId) –

    The ID of the Amazon Web Services account where you want to delete an analysis.

  • analysis_id (ShortRestrictiveResourceId) –

    The ID of the analysis that you're deleting.

  • recovery_window_in_days (Optional[RecoveryWindowInDays], default: None ) –

    A value that specifies the number of days that Amazon Quick Sight waits before it deletes the analysis. You can't use this parameter with the ForceDeleteWithoutRecovery option in the same API call. The default value is 30.

  • force_delete_without_recovery (Optional[Boolean], default: None ) –

    This option defaults to the value NoForceDeleteWithoutRecovery. To immediately delete the analysis, add the ForceDeleteWithoutRecovery option. You can't restore an analysis after it's deleted.

Raises:

Source code in docs_src/capo_quicksight/_services/async_quick_sight.py
async def delete_analysis(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    analysis_id: "capo_quicksight.types.short_restrictive_resource_id.ShortRestrictiveResourceId",
    *,
    config_overrides: Optional[AsyncQuickSightClientConfig] = None,
    recovery_window_in_days: Optional[
        "capo_quicksight.types.recovery_window_in_days.RecoveryWindowInDays"
    ] = None,
    force_delete_without_recovery: Optional[
        "capo_quicksight.types.boolean.Boolean"
    ] = None,
) -> "capo_quicksight.types.delete_analysis_response.DeleteAnalysisResponse":
    """<p>Deletes an analysis from Amazon Quick Sight. You can optionally include a recovery window during which you can restore the analysis. If you don't specify a recovery window value, the operation defaults to 30 days. Amazon Quick Sight attaches a <code>DeletionTime</code> stamp to the response that specifies the end of the recovery window. At the end of the recovery window, Amazon Quick Sight deletes the analysis permanently.</p> <p>At any time before recovery window ends, you can use the <code>RestoreAnalysis</code> API operation to remove the <code>DeletionTime</code> stamp and cancel the deletion of the analysis. The analysis remains visible in the API until it's deleted, so you can describe it but you can't make a template from it.</p> <p>An analysis that's scheduled for deletion isn't accessible in the Amazon Quick Sight console. To access it in the console, restore it. Deleting an analysis doesn't delete the dashboards that you publish from it.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account where you want to delete an analysis.</p>
        analysis_id: <p>The ID of the analysis that you're deleting.</p>
        recovery_window_in_days: <p>A value that specifies the number of days that Amazon Quick Sight waits before it deletes the analysis. You can't use this parameter with the <code>ForceDeleteWithoutRecovery</code> option in the same API call. The default value is 30.</p>
        force_delete_without_recovery: <p>This option defaults to the value <code>NoForceDeleteWithoutRecovery</code>. To immediately delete the analysis, add the <code>ForceDeleteWithoutRecovery</code> option. You can't restore an analysis after it's deleted. </p>

    Raises:
        capo_quicksight.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.unsupported_user_edition_exception.UnsupportedUserEditionException: <p>This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_quicksight.types.delete_analysis_request.DeleteAnalysisRequest]",
    ) -> AsyncOperationResponse[
        "capo_quicksight.types.delete_analysis_response.DeleteAnalysisResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.delete_analysis

        (
            output,
            http_response,
        ) = await capo_quicksight._operations.quick_sight_20180401.delete_analysis.async_delete_analysis(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAnalysis")
    )
    input_: capo_quicksight.types.delete_analysis_request.DeleteAnalysisRequest = {
        "aws_account_id": aws_account_id,
        "analysis_id": analysis_id,
    }
    if recovery_window_in_days is not None:
        input_["recovery_window_in_days"] = recovery_window_in_days
    if force_delete_without_recovery is not None:
        input_["force_delete_without_recovery"] = force_delete_without_recovery

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