operator: add a limits route to determine max app resource limits
This commit is contained in:
@@ -48,6 +48,8 @@ exports = module.exports = {
|
||||
uploadFile,
|
||||
downloadFile,
|
||||
|
||||
getLimits,
|
||||
|
||||
load
|
||||
};
|
||||
|
||||
@@ -837,3 +839,12 @@ async function getTask(req, res, next) {
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
}
|
||||
|
||||
async function getLimits(req, res, next) {
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
const [error, limits] = await safe(apps.getLimits(req.app));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { limits }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user