DeleteAnalysisCommand

Deletes an analysis from Amazon QuickSight. 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 QuickSight attaches a DeletionTime stamp to the response that specifies the end of the recovery window. At the end of the recovery window, Amazon QuickSight 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 QuickSight console. To access it in the console, restore it. Deleting an analysis doesn't delete the dashboards that you publish from it.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QuickSightClient, DeleteAnalysisCommand } from "@aws-sdk/client-quicksight"; // ES Modules import
// const { QuickSightClient, DeleteAnalysisCommand } = require("@aws-sdk/client-quicksight"); // CommonJS import
const client = new QuickSightClient(config);
const input = { // DeleteAnalysisRequest
  AwsAccountId: "STRING_VALUE", // required
  AnalysisId: "STRING_VALUE", // required
  RecoveryWindowInDays: Number("long"),
  ForceDeleteWithoutRecovery: true || false,
};
const command = new DeleteAnalysisCommand(input);
const response = await client.send(command);
// { // DeleteAnalysisResponse
//   Status: Number("int"),
//   Arn: "STRING_VALUE",
//   AnalysisId: "STRING_VALUE",
//   DeletionTime: new Date("TIMESTAMP"),
//   RequestId: "STRING_VALUE",
// };

DeleteAnalysisCommand Input

See DeleteAnalysisCommandInput for more details

Parameter
Type
Description
AnalysisId
Required
string | undefined

The ID of the analysis that you're deleting.

AwsAccountId
Required
string | undefined

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

ForceDeleteWithoutRecovery
boolean | undefined

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.

RecoveryWindowInDays
number | undefined

A value that specifies the number of days that Amazon QuickSight 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.

DeleteAnalysisCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AnalysisId
string | undefined

The ID of the deleted analysis.

Arn
string | undefined

The Amazon Resource Name (ARN) of the deleted analysis.

DeletionTime
Date | undefined

The date and time that the analysis is scheduled to be deleted.

RequestId
string | undefined

The Amazon Web Services request ID for this operation.

Status
number | undefined

The HTTP status of the request.

Throws

Name
Fault
Details
ConflictException
client

Updating or deleting a resource can cause an inconsistent state.

InternalFailureException
server

An internal failure occurred.

InvalidParameterValueException
client

One or more parameters has a value that isn't valid.

ResourceNotFoundException
client

One or more resources can't be found.

ThrottlingException
client

Access is throttled.

UnsupportedUserEditionException
client

This error indicates that you are calling an operation on an Amazon QuickSight subscription where the edition doesn't include support for that operation. Amazon Amazon QuickSight currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.

QuickSightServiceException
Base exception class for all service exceptions from QuickSight service.