diff --git a/docs/clmc-service.md b/docs/clmc-service.md index 6d60e7c5878748c26589ed6db8a62e43af299d28..69b1ac091d307d9094d6015a61df33043ad833cb 100644 --- a/docs/clmc-service.md +++ b/docs/clmc-service.md @@ -62,41 +62,6 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port ## Alerts API Endpoints -* **GET** ***/alerts?sfc={service function chain id}&sfci={service function chain instance id}&policy={policy id}&trigger={trigger id}*** - - This API method can be used to retrieve the generated alert task and alert topic identifiers during the processing of an alerts specification document. - These identifiers can then be used to interact with the Kapacitor HTTP API for further configiuration or modification of alerts - https://docs.influxdata.com/kapacitor/v1.4/working/api/. - - * Request: - - Expects a URL query string with the request parameters - **sfc**, **sfci**, **policy** and **trigger**. The given parameters must match the values used in the alerts specification - document. Otherwise, a wrong ID will be returned. - - * Request URL Examples: - - **/alerts?sfc=MSDemo&sfci=MSDemo-premium&policy=requests_diff&trigger=low_requests** - - **/alerts?sfc=SimpleMediaService&sfci=SimpleMediaService-1&policy=rtt_deviation&trigger=increase_in_rtt** - - * Response - - The response of this request is a JSON-formatted content, which contains the task and topic identifiers, along with the Kapacitor - API endpoints to use for configuring the given task, topic and the respective handlers. - - Returns a 400 Bad Request if the URL query string parameters are invalid or otherwise incorrect. - - * Response Body Example: - - ```json - { - "task_identifier": "094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", - "topic_identifier": "094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", - "task_api_endpoint": "/kapacitor/v1/tasks/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", - "topic_api_endpoint": "/kapacitor/v1/alerts/topics/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", - "topic_handlers_api_endpoint": "/kapacitor/v1/alerts/topics/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388/handlers" - } - ``` - * **POST** ***/alerts*** This API method can be used to send an alert specification document, which is then used by the CLMC service to create @@ -179,6 +144,43 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port } ``` +* **GET** ***/alerts/{sfc_id}/{sfc_instance_id}*** + + This API method can be used to fetch all alerts that are registered for a specific service function chain instance identified + by the ***sfc_id*** and ***sfc_instance_id*** url parameters. + + * Request: + + Expects a URL query with the following parameters - **sfc_id**, **sfc_instance_id**. The given parameters should uniquely + identify a service function chain instance for which the registered alerts information will be returned. + + * Request URL Examples: + + **/alerts/MSDemo/MSDemo_1** + + **/alerts/SimpleMediaService/SimpleMediaService_1** + + * Response: + + The response of this request is a JSON-formatted content, which contains a list of alert objects each of which represents + a registered alert and contains the alert policy ID, trigger ID and Kapacitor resources including handlers. + + * Response Example: + + ```json + [ + { + "policy": "<TOSCA policy ID>", + "trigger": "<TOSCA trigger ID>", + "task_identifier": "<Kapacitor task identifier>", + "topic_identifier": "<Kapacitor topic identifier>", + "task_api_endpoint": "/kapacitor/v1/tasks/<Kapacitor task identifier>", + "topic_api_endpoint": "/kapacitor/v1/alerts/topics/<Kapacitor topic identifier>", + "topic_handlers_api_endpoint": "/kapacitor/v1/alerts/topics/<Kapacitor topic identifier>/handlers" + } + ] + ``` + * **DELETE** ***/alerts*** This API method can be used to send an alert specification document, which is then used by the CLMC service to delete @@ -227,7 +229,43 @@ with **/clmc-service** so that the nginx reverse proxy server (listening on port {"policy": "deadman_policy", "trigger": "no_measurements", "handler": "http://172.40.231.200:9999/"}] } ``` + +* **GET** ***/alerts?sfc={service function chain id}&sfci={service function chain instance id}&policy={policy id}&trigger={trigger id}*** + + (Deprecated - please use *GET /alerts/{sfc_id}/{sfc_instance_id}* instead) + + This API method can be used to retrieve the generated alert task and alert topic identifiers during the processing of an alerts specification document. + These identifiers can then be used to interact with the Kapacitor HTTP API for further configiuration or modification of alerts - https://docs.influxdata.com/kapacitor/v1.4/working/api/. + + * Request: + + Expects a URL query string with the request parameters - **sfc**, **sfci**, **policy** and **trigger**. The given parameters must match the values used in the alerts specification + document. Otherwise, a wrong ID will be returned. + + * Request URL Examples: + **/alerts?sfc=MSDemo&sfci=MSDemo-premium&policy=requests_diff&trigger=low_requests** + + **/alerts?sfc=SimpleMediaService&sfci=SimpleMediaService-1&policy=rtt_deviation&trigger=increase_in_rtt** + + * Response + + The response of this request is a JSON-formatted content, which contains the task and topic identifiers, along with the Kapacitor + API endpoints to use for configuring the given task, topic and the respective handlers. + + Returns a 400 Bad Request if the URL query string parameters are invalid or otherwise incorrect. + + * Response Body Example: + + ```json + { + "task_identifier": "094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", + "topic_identifier": "094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", + "task_api_endpoint": "/kapacitor/v1/tasks/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", + "topic_api_endpoint": "/kapacitor/v1/alerts/topics/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388", + "topic_handlers_api_endpoint": "/kapacitor/v1/alerts/topics/094f23d6e948c78e9fa215528973fb3aeefa5525898626c9ea049dc8e87a7388/handlers" + } + ``` ## Graph API Endpoints