Revert "add volume support"

This reverts commit b8bb69f730.

Revert this for now, we will try a simpler non-object volume first
This commit is contained in:
Girish Ramakrishnan
2020-04-27 22:55:43 -07:00
parent cc8509f8eb
commit 2cdf68379b
20 changed files with 38 additions and 864 deletions

View File

@@ -21,7 +21,6 @@ exports = module.exports = {
setIcon: setIcon,
setMemoryLimit: setMemoryLimit,
setCpuShares: setCpuShares,
setVolumes: setVolumes,
setAutomaticBackup: setAutomaticBackup,
setAutomaticUpdate: setAutomaticUpdate,
setReverseProxyConfig: setReverseProxyConfig,
@@ -239,24 +238,6 @@ function setCpuShares(req, res, next) {
});
}
function setVolumes(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.resource, 'object');
if (!Array.isArray(req.body.volumes)) return next(new HttpError(400, 'volumes should be an array'));
for (let v of req.body.volumes) {
if (!v || typeof v !== 'object') return next(new HttpError(400, 'volume must be a {id, readOnly}'));
if (typeof v.id !== 'string') return next(new HttpError(400, 'id must be a string'));
if (typeof v.readOnly !== 'boolean') return next(new HttpError(400, 'readOnly must be a boolean'));
}
apps.setVolumes(req.resource, req.body.volumes, auditSource.fromRequest(req), function (error, result) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, { taskId: result.taskId }));
});
}
function setAutomaticBackup(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.resource, 'object');