return swap information

This commit is contained in:
Girish Ramakrishnan
2019-11-21 12:55:17 -08:00
parent 8a3d212bd4
commit 42fe84152a
3 changed files with 27 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ exports = module.exports = {
isRebootRequired: isRebootRequired,
getConfig: getConfig,
getDisks: getDisks,
getMemory: getMemory,
getUpdateInfo: getUpdateInfo,
update: update,
checkForUpdates: checkForUpdates,
@@ -62,6 +63,14 @@ function getDisks(req, res, next) {
});
}
function getMemory(req, res, next) {
disks.getMemory(function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, result));
});
}
function update(req, res, next) {
if ('skipBackup' in req.body && typeof req.body.skipBackup !== 'boolean') return next(new HttpError(400, 'skipBackup must be a boolean'));