Add route to list all blockdevices
This commit is contained in:
@@ -27,7 +27,8 @@ exports = module.exports = {
|
||||
syncExternalLdap,
|
||||
syncDnsRecords,
|
||||
getSystemGraphs,
|
||||
getPlatformStatus
|
||||
getPlatformStatus,
|
||||
getBlockDevices
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
@@ -365,3 +366,10 @@ async function getSystemGraphs(req, res, next) {
|
||||
async function getPlatformStatus(req, res, next) {
|
||||
next(new HttpSuccess(200, platform.getStatus()));
|
||||
}
|
||||
|
||||
async function getBlockDevices(req, res, next) {
|
||||
const [error, devices] = await safe(cloudron.getBlockDevices());
|
||||
if (error) return next(new HttpError(500, error));
|
||||
|
||||
next(new HttpSuccess(200, { devices }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user