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
+9
View File
@@ -6,6 +6,7 @@ exports = module.exports = {
del,
list,
load,
remount,
getStatus
};
@@ -66,6 +67,14 @@ async function list(req, res, next) {
next(new HttpSuccess(200, { volumes: allVolumes }));
}
async function remount(req, res, next) {
assert.strictEqual(typeof req.params.id, 'string');
const [error] = await safe(volumes.remount(req.volume, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202));
}
async function getStatus(req, res, next) {
assert.strictEqual(typeof req.params.id, 'string');