Last updated on
Apr 27, 2021
Description
This function deletes an existing backup of a table.
For more information, see DeleteBackup.
Category
History
ColdFusion (2021 release): Added this function.
Syntax
serviceHandle.deleteBackup(requestParameters)
serviceHandle.deleteBackup(requestParameters)
serviceHandle.deleteBackup(requestParameters)
Parameters
See request parameters of DeleteBackup.
Example
<cfscript>
cred = {
"credentialAlias" : "myalias",
"vendorName" : "AWS",
"region" : "us-east-2",
"secretAccessKey" : "xxxxx",
"accessKeyId" : "xxxx"
}
conf={
"serviceName"="DYNAMODB"
}
dynamo=getCloudService(cred, conf)
tableName="YearlyProductCatalog"
// list all backups
listBackupsStruct={
"BackupType": "ALL",
"Limit":20,
"TableName":"#tableName#"
}
backupList=dynamo.listBackups(listBackupsStruct)
// retrieve the first Backup ARN that we shall delete
backupArnToBeDeleted=backupList.BackupSummaries[1].BackupArn
deleteBackupStruct={
"BackupArn": "#backupArnToBeDeleted#"
}
try{
deleteBackupResponse=dynamo.DeleteBackup(deleteBackupStruct)
writeOutput("Backup deleted successfully")
writeDump(deleteBackupResponse)
}
catch(any e){
writeDump(e)
}
</cfscript>
<cfscript>
cred = {
"credentialAlias" : "myalias",
"vendorName" : "AWS",
"region" : "us-east-2",
"secretAccessKey" : "xxxxx",
"accessKeyId" : "xxxx"
}
conf={
"serviceName"="DYNAMODB"
}
dynamo=getCloudService(cred, conf)
tableName="YearlyProductCatalog"
// list all backups
listBackupsStruct={
"BackupType": "ALL",
"Limit":20,
"TableName":"#tableName#"
}
backupList=dynamo.listBackups(listBackupsStruct)
// retrieve the first Backup ARN that we shall delete
backupArnToBeDeleted=backupList.BackupSummaries[1].BackupArn
deleteBackupStruct={
"BackupArn": "#backupArnToBeDeleted#"
}
try{
deleteBackupResponse=dynamo.DeleteBackup(deleteBackupStruct)
writeOutput("Backup deleted successfully")
writeDump(deleteBackupResponse)
}
catch(any e){
writeDump(e)
}
</cfscript>
<cfscript> cred = { "credentialAlias" : "myalias", "vendorName" : "AWS", "region" : "us-east-2", "secretAccessKey" : "xxxxx", "accessKeyId" : "xxxx" } conf={ "serviceName"="DYNAMODB" } dynamo=getCloudService(cred, conf) tableName="YearlyProductCatalog" // list all backups listBackupsStruct={ "BackupType": "ALL", "Limit":20, "TableName":"#tableName#" } backupList=dynamo.listBackups(listBackupsStruct) // retrieve the first Backup ARN that we shall delete backupArnToBeDeleted=backupList.BackupSummaries[1].BackupArn deleteBackupStruct={ "BackupArn": "#backupArnToBeDeleted#" } try{ deleteBackupResponse=dynamo.DeleteBackup(deleteBackupStruct) writeOutput("Backup deleted successfully") writeDump(deleteBackupResponse) } catch(any e){ writeDump(e) } </cfscript>
Output