- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
DeleteSnapshotCommand
Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup.
The DeleteSnapshot
operation returns instantly. The snapshot appears with the lifecycle status of DELETING
until the deletion is complete.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { FSxClient, DeleteSnapshotCommand } from "@aws-sdk/client-fsx"; // ES Modules import
// const { FSxClient, DeleteSnapshotCommand } = require("@aws-sdk/client-fsx"); // CommonJS import
const client = new FSxClient(config);
const input = { // DeleteSnapshotRequest
ClientRequestToken: "STRING_VALUE",
SnapshotId: "STRING_VALUE", // required
};
const command = new DeleteSnapshotCommand(input);
const response = await client.send(command);
// { // DeleteSnapshotResponse
// SnapshotId: "STRING_VALUE",
// Lifecycle: "PENDING" || "CREATING" || "DELETING" || "AVAILABLE",
// };
DeleteSnapshotCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
SnapshotId Required | string | undefined | The ID of the snapshot that you want to delete. |
ClientRequestToken | string | undefined | (Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK. |
DeleteSnapshotCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Lifecycle | SnapshotLifecycle | undefined | The lifecycle status of the snapshot. If the |
SnapshotId | string | undefined | The ID of the deleted snapshot. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BadRequest | client | A generic error indicating a failure with a client request. |
InternalServerError | server | A generic error indicating a server-side failure. |
SnapshotNotFound | client | No Amazon FSx snapshots were found based on the supplied parameters. |
FSxServiceException | Base exception class for all service exceptions from FSx service. |