Whatever message this page gives is out now! Go check it out!
serviceHandle.restoreTableFromBackup(requestParameters)<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>