X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fapi%2Flogging.js;h=499a81421bb9321082fcb770d9de2ef250d2d4c8;hb=refs%2Fchanges%2F53%2F553%2F1;hp=00cd1d63ccfc6efb609929cbc1e7a7b1f6d36000;hpb=b771a7f18f2f2314798ba4b6baaaa807bbd2764e;p=osm%2FUI.git diff --git a/skyquake/plugins/logging/api/logging.js b/skyquake/plugins/logging/api/logging.js index 00cd1d63c..499a81421 100644 --- a/skyquake/plugins/logging/api/logging.js +++ b/skyquake/plugins/logging/api/logging.js @@ -322,6 +322,34 @@ Config.deleteDefaultSeverity = function(req) { } +// NOTE: In rel_4.3 we are going to affect syslog sink category by default + +Config.setDefaultSyslogSeverity = function(req) { + // TODO: verify there is one key at root of data: 'default-severity' + // OR just filter on the request body + return handlePutRequest(req, APIVersion + '/api/config/logging/sink/syslog'); +} + +Config.deleteDefaultSyslogSeverity = function(req) { + // TODO: verify there is one key at root of data: 'default-severity' + // OR just filter on the request body + var Categories = req.params.nulledCategories.split(','); + var promises = []; + return new Promise(function(resolve, reject) { + promises.concat(Categories.map(function(categoryName) { + return handleDeleteRequest(req, APIVersion + '/api/config/logging/sink/syslog/filter/category/' + categoryName); + })); + return Promise.all(promises).then( + function(data) { + resolve({statusCode: 200, data: data[0]}); + }, + function(data) { + reject(data); + } + ) + }); +} + /* get body of forms