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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user