Delete snapshots

You can use the delete-snapshot command to delete a snapshot from the snapshot location where the snapshot is exported.

Command syntax

cdp opdb delete-snapshot --environment-name ENVIRONMENT_NAME --database-name DATABASE_NAME --snapshot-name SNAPSHOT_NAME

Parameters

--environment-name

The name of the CDP environment.

--database-name

The name of the operational database.

--snapshot-name

The snapshot name to be deleted.

cdp opdb delete-snapshot --environment-name odx-wgel6j --database-name test --snapshot-name s3
JSON output:
{
    "environmentName": "odx-wgel6j",
    "databaseName": "test",
    "status": "DELETING",
    "commandID": 1546336526,
    "snapshotName": "s3"
}

Once the snapshot is deleted, the status is displayed as DELETED.

cdp opdb list-snapshots --environment-name odx-wgel6j --database-name test --command-id 1546336526
JSON output:
{
    "environmentName": "odx-wgel6j",
    "databaseName": "test",
    "snapshots": [
        {
            "tableName": "table_6uf7xt",
            "snapshotName": "s3",
            "creationTime": 1662036921064,
            "status": "DELETED",
            "commandID": 1546336526,
            "snapshotLocation": "abfs://qedailynat-filesystem@qe.dfs.core.windows.net/hbase/"
        }
    ]
}