Package com.qfs.snl.rs
Interface IAlertRestService
- All Known Implementing Classes:
AlertRestServiceController
@RequestMapping("/activeviam/sentinel/rest/v8/alerts")
public interface IAlertRestService
The alerts rest service.
- Author:
- ActiveViam
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Query parameter to restrict filtered alerts.static final String
The namespace of the service in the REST API.static final String
Query parameter to specify a "from" boundary for an update.static final String
Query parameter to specify a "to" boundary for an update. -
Method Summary
Modifier and TypeMethodDescriptiongetAlert
(long id) Gets an alert by id.Gets all alerts.startAlert
(AlertDto alert) Starts an alert.stopAlert
(long id) Stop an alert.updateAlert
(long id, AlertDto alert) Updates an alert.
-
Field Details
-
Method Details
-
getAlerts
@GetMapping List<AlertDto> getAlerts(@RequestParam(value="active",required=false) String active, @RequestParam(value="from",required=false) String from, @RequestParam(value="to",required=false) String to) throws ServiceException Gets all alerts.- Parameters:
active
- the status of the alert Use true to get active alerts only, false for stopped alerts. If not specified, no filter is applied.from
- optional 'from' time boundary, used to get changes on the point values since that date This accepts a timestamp in ms orTimePeriodDto.NOW
for the current server time.to
- optional 'to' time boundary, used to get changes on the point values until that date This accepts a timestamp in ms orTimePeriodDto.NOW
for the current server time.- Returns:
- Array of alerts
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
getAlert
Gets an alert by id.- Parameters:
id
- The alert id- Returns:
- The alert found
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
startAlert
Starts an alert.- Parameters:
alert
- definition of the alert to create- Returns:
- the started alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
updateAlert
@PutMapping("/{id:\\d+}") AlertDto updateAlert(@PathVariable("id") long id, @RequestBody AlertDto alert) throws ServiceException Updates an alert.So far, only attribute 'content' can be modified.
It is possible not to define the alert id in the DTO and it will be infered from the path.
- Parameters:
id
- id of the alert to udpatealert
- alert to update- Returns:
- the update alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-
stopAlert
@DeleteMapping("/{id:\\d+}") AlertDto stopAlert(@PathVariable("id") long id) throws ServiceException Stop an alert.- Parameters:
id
- of the alert- Returns:
- the stopped alert
- Throws:
ServiceException
- when an error occurs. It is dependent of the implementation to detail the possible causes of errors.
-