Add repair route

this is specifically for the case where some task failed and user
wants to get it back.
This commit is contained in:
Girish Ramakrishnan
2019-09-19 17:04:11 -07:00
parent 2942da78de
commit 9a22ba3af7
5 changed files with 39 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ exports = module.exports = {
getLogs: getLogs,
getLogStream: getLogStream,
listBackups: listBackups,
repairApp: repairApp,
setAccessRestriction: setAccessRestriction,
setLabel: setLabel,
@@ -361,6 +362,19 @@ function setDataDir(req, res, next) {
});
}
function repairApp(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.id, 'string');
debug('Repair app id:%s', req.params.id);
apps.repair(req.params.id, {}, auditSource.fromRequest(req), function (error, result) {
if (error) return next(toHttpError(error));
next(new HttpSuccess(202, { taskId: result.taskId }));
});
}
function restoreApp(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.id, 'string');