system: cpu route

This commit is contained in:
Girish Ramakrishnan
2023-12-04 00:23:25 +01:00
parent d45c433bc7
commit 8a20b603f5
5 changed files with 33 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ exports = module.exports = {
getLogStream,
getSystemGraphs,
getBlockDevices,
getCpus
};
const assert = require('assert'),
@@ -143,3 +144,10 @@ async function getBlockDevices(req, res, next) {
next(new HttpSuccess(200, { devices }));
}
async function getCpus(req, res, next) {
const [error, cpus] = await safe(system.getCpus());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, { cpus }));
}