Add remount route for mountlike backup storages
This commit is contained in:
@@ -15,6 +15,8 @@ exports = module.exports = {
|
||||
remove,
|
||||
removeDir,
|
||||
|
||||
remount,
|
||||
|
||||
testConfig,
|
||||
removePrivateFields,
|
||||
injectPrivateFields
|
||||
@@ -35,6 +37,7 @@ const assert = require('assert'),
|
||||
df = require('@sindresorhus/df'),
|
||||
EventEmitter = require('events'),
|
||||
fs = require('fs'),
|
||||
mounts = require('../mounts.js'),
|
||||
path = require('path'),
|
||||
paths = require('../paths.js'),
|
||||
prettyBytes = require('pretty-bytes'),
|
||||
@@ -281,6 +284,14 @@ function validateBackupTarget(folder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
async function remount(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) throw new BoxError(BoxError.NOT_SUPPORTED);
|
||||
|
||||
await mounts.remount(mounts.mountObjectFromBackupConfig(apiConfig));
|
||||
}
|
||||
|
||||
function testConfig(apiConfig, callback) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
Reference in New Issue
Block a user