X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Flogging%2Fapi%2Flogging.js;fp=skyquake%2Fplugins%2Flogging%2Fapi%2Flogging.js;h=a3bc182218bef640417b3850c0642acad82cb4f8;hp=00cd1d63ccfc6efb609929cbc1e7a7b1f6d36000;hb=27eea26c0b90dc1482aa785837b7c56da6090eaf;hpb=b771a7f18f2f2314798ba4b6baaaa807bbd2764e diff --git a/skyquake/plugins/logging/api/logging.js b/skyquake/plugins/logging/api/logging.js index 00cd1d63c..a3bc18221 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.body; + return new Promise(function(resolve, reject) { + var promises = Categories.map(function(categoryName) { + return handleDeleteRequest(req, APIVersion + '/api/config/logging/sink/syslog/filter/category/' + categoryName); + }); + return Promise.all(promises).then( + function(data) { + resolve(data[0]); + }, + function(data) { + reject(data); + } + ) + }) + +} + /* get body of forms