Move backup config fetching into storage backend

This commit is contained in:
Johannes Zellner
2016-09-19 15:03:38 +02:00
parent 0bfc533e44
commit 4a9a6dc232
5 changed files with 86 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ exports = module.exports = {
getAppBackupDetails: getAppBackupDetails,
getRestoreUrl: getRestoreUrl,
getAppRestoreConfig: getAppRestoreConfig,
getLocalFilePath: getLocalFilePath,
copyObject: copyObject
@@ -53,6 +54,19 @@ function getRestoreUrl(apiConfig, filename, callback) {
callback(new Error('not implemented'));
}
function getAppRestoreConfig(apiConfig, backupId, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof backupId, 'string');
assert.strictEqual(typeof callback, 'function');
// var configFilename = backupId.replace(/\.tar\.gz$/, '.json');
// Result: {} <- Backup config object from .json file
// The resulting url must work with curl as it is passed into start.sh and restoreapp.sh
callback(new Error('not implemented'));
}
function getLocalFilePath(apiConfig, filename, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof filename, 'string');