eventlog: add service rebuild/restart/configure events
This commit is contained in:
@@ -11,6 +11,7 @@ exports = module.exports = {
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
auditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
@@ -44,7 +45,7 @@ async function configure(req, res, next) {
|
||||
memoryLimit: req.body.memoryLimit
|
||||
};
|
||||
|
||||
const [error] = await safe(services.configureService(req.params.service, data));
|
||||
const [error] = await safe(services.configureService(req.params.service, data, auditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
@@ -114,7 +115,7 @@ async function getLogStream(req, res, next) {
|
||||
async function restart(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.service, 'string');
|
||||
|
||||
const [error] = await safe(services.restartService(req.params.service));
|
||||
const [error] = await safe(services.restartService(req.params.service, auditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
@@ -123,7 +124,7 @@ async function restart(req, res, next) {
|
||||
async function rebuild(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.service, 'string');
|
||||
|
||||
const [error] = await safe(services.rebuildService(req.params.service));
|
||||
const [error] = await safe(services.rebuildService(req.params.service, auditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
|
||||
Reference in New Issue
Block a user