operator: add a limits route to determine max app resource limits

This commit is contained in:
Girish Ramakrishnan
2021-09-21 22:29:19 -07:00
parent 214540ebfa
commit 629908eb4c
3 changed files with 22 additions and 0 deletions

View File

@@ -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 }));
}