Skip to content
Snippets Groups Projects
Commit cb1b8d59 authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Updates documentation

parent 4ec26212
No related branches found
No related tags found
No related merge requests found
......@@ -179,6 +179,56 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port
}
```
* **DELETE** ***/alerts***
This API method can be used to send an alert specification document, which is then used by the CLMC service to delete
alert tasks and deregister alert handlers in Kapacitor. Essentially, it is a clean-up endpoint for the alerts API.
For further information on the alert specification document, please check the [CLMC Alert Specification Documentation](AlertsSpecification.md).
* Request:
Expects a YAML-formatted file in the request referenced with ID ***alert-spec*** representing the TOSCA alert specification
document. The alert specification document is then parsed with the openstack TOSCA parser (https://github.com/openstack/tosca-parser/tree/master/toscaparser)
and validated against the CLMC alerts specification schema (again check [documentation](AlertsSpecification.md) for more info on this).
* Example for sending a request with curl:
`curl -X DELETE -F "alert-spec=@alert-specification.yaml" http://localhost:9080/alerts`
where **alert-specification.yaml** is the path to the alerts specification file.
* Response:
The response of this request is a JSON-formatted content, which contains two lists - one for the alerts that were found in the TOSCA specification
and then deleted from Kapacitor, and one for the respective alert handlers that were deleted from Kapacitor.
Returns a 400 Bad Request if the request does not contain a yaml file referenced with ID **alert-spec**.
Returns a 400 Bad Request if the alert specification file is not a valid YAML file.
Returns a 400 Bad Request if the alert specification file cannot be parsed with the TOSCA parser.
Returns a 400 Bad Request if the alert specification file fails validation against the CLMC alerts specification schema.
* Response Body Example:
```json
{
"deleted_alerts": [{"policy": "scale_nginx_policy", "trigger": "high_requests"},
{"policy": "scale_nginx_policy", "trigger": "increase_in_active_requests"},
{"policy": "scale_nginx_policy", "trigger": "increase_in_running_processes"},
{"policy": "deadman_policy", "trigger": "no_measurements"}],
"deleted_handlers": [{"policy": "scale_nginx_policy", "trigger": "increase_in_active_requests", "handler": "flame_sfemc"},
{"policy": "scale_nginx_policy", "trigger": "increase_in_running_processes", "handler": "flame_sfemc"},
{"policy": "deadman_policy", "trigger": "no_measurements", "handler": "flame_sfemc"},
{"policy": "scale_nginx_policy", "trigger": "high_requests", "handler": "http://172.40.231.200:9999/"},
{"policy": "scale_nginx_policy", "trigger": "increase_in_active_requests", "handler": "http://172.40.231.200:9999/"},
{"policy": "scale_nginx_policy", "trigger": "increase_in_running_processes", "handler": "http://172.40.231.200:9999/"},
{"policy": "deadman_policy", "trigger": "no_measurements", "handler": "http://172.40.231.200:9999/"}]
}
```
## Graph API Endpoints
* **Assumptions**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment