app: add export route
Currently, the export route only creates the snapshot (the other side of in-place import). In the future, the export route can export to a custom backup config (like import).
This commit is contained in:
@@ -8,6 +8,7 @@ exports = module.exports = {
|
||||
uninstall,
|
||||
restore,
|
||||
importApp,
|
||||
exportApp,
|
||||
backup,
|
||||
update,
|
||||
getLogs,
|
||||
@@ -443,6 +444,17 @@ function importApp(req, res, next) {
|
||||
});
|
||||
}
|
||||
|
||||
function exportApp(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
apps.exportApp(req.resource, {}, auditSource.fromRequest(req), function (error, result) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, { taskId: result.taskId }));
|
||||
});
|
||||
}
|
||||
|
||||
function clone(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
Reference in New Issue
Block a user