Remove cloudron side migrate api

This is some old api when we had a migrate view in the webadmin
This is entirely handled on the appstore for now.
This commit is contained in:
Johannes Zellner
2016-01-29 14:17:31 +01:00
parent 307262244a
commit 2888a85081
4 changed files with 3 additions and 236 deletions

View File

@@ -10,7 +10,6 @@ exports = module.exports = {
getProgress: getProgress,
getConfig: getConfig,
update: update,
migrate: migrate,
feedback: feedback
};
@@ -129,20 +128,6 @@ function update(req, res, next) {
});
}
function migrate(req, res, next) {
if (typeof req.body.size !== 'string') return next(new HttpError(400, 'size must be string'));
if (typeof req.body.region !== 'string') return next(new HttpError(400, 'region must be string'));
debug('Migration requested', req.body.size, req.body.region);
cloudron.migrate(req.body.size, req.body.region, function (error) {
if (error && error.reason === CloudronError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202, {}));
});
}
function feedback(req, res, next) {
assert.strictEqual(typeof req.user, 'object');