add volume remount

This commit is contained in:
Johannes Zellner
2021-10-11 15:51:16 +02:00
parent f01764617c
commit 9eed3af8b6
8 changed files with 70 additions and 0 deletions
+12
View File
@@ -5,6 +5,7 @@ exports = module.exports = {
get,
del,
list,
remount,
getStatus,
removePrivateFields,
@@ -109,6 +110,17 @@ async function add(volume, auditSource) {
return id;
}
async function remount(volume, auditSource) {
assert.strictEqual(typeof volume, 'object');
assert.strictEqual(typeof auditSource, 'object');
eventlog.add(eventlog.ACTION_VOLUME_REMOUNT, auditSource, { volume });
if (!mounts.isMountProvider(volume.mountType)) throw new BoxError(BoxError.NOT_SUPPORTED, 'Volume does not support remount');
mounts.remount(volume);
}
async function getStatus(volume) {
assert.strictEqual(typeof volume, 'object');