Last updated on
16 May 2021
Description
This function creates a backup from a table, which was previously created.
For more information, see RestoreTableFromBackup.
Category
History
ColdFusion (2021 release): Added this function.
Syntax
serviceHandle.restoreTableFromBackup(requestParameters)
Parameters
See request parameters of RestoreTableFromBackup.
Example
<cfscript> cred = { "credentialAlias" : "myalias", "vendorName" : "AWS", "region" : "us-east-2", "secretAccessKey" : "xxxxx", "accessKeyId" : "xxxx" } config = { "serviceName" = "DYNAMODB" } dynamo = getCloudService(cred, config) tableName="YearlyProductCatalog" // list all backups listBackupsStruct={ "BackupType": "ALL", "Limit":20, "TableName":"#tableName#" } backupResponse=dynamo.listBackups(listBackupsStruct) //writeDump(backupResponse.BackupSummaries[1].BackupArn) // restore table from backup myBackupArn=backupResponse.BackupSummaries[1].BackupArn myTargetTableName="myNewTargetTable" restoreTableFromBackupStruct = { "BackupArn": myBackupArn, "TargetTableName": "#myTargetTableName#" } restoreTableResponse=dynamo.restoreTableFromBackup(restoreTableFromBackupStruct) try{ if ( ((restoreTableResponse.TableDescription.RestoreSummary.RestoreInProgress==TRUE) OR (restoreTableResponse.TableDescription.RestoreSummary.RestoreInProgress=="YES")) AND (restoreTableResponse.TableDescription.TableStatus=="CREATING") ) { writeOutput("Successfully restored the table.") } else { writeOutput("Failed to restore the table.") } } catch (any e){ writeDump(e) } </cfscript>