diff --git a/docs/providers/documentation/ilert-provider.mdx b/docs/providers/documentation/ilert-provider.mdx index f8676a395..cd53fce11 100644 --- a/docs/providers/documentation/ilert-provider.mdx +++ b/docs/providers/documentation/ilert-provider.mdx @@ -1,9 +1,9 @@ --- -title: "Ilert Provider" -sidebarTitle: "Ilert Provider" +title: "ilert Provider" +sidebarTitle: "ilert Provider" description: "The ilert provider enables the creation, updating, and resolution of events or incidents on ilert, leveraging both incident management and event notification capabilities for effective incident response." --- -# Ilert Provider +# ilert Provider ## Overview @@ -21,7 +21,7 @@ Depending on the `_type` specified, the provider will route the operation to the ### Incident Management - `summary`: A brief summary of the incident. This is required for creating a new incident. -- `status`: `IlertIncidentStatus` - The current status of the incident (e.g., INVESTIGATING, RESOLVED, MONITORING, IDENTIFIED). +- `status`: `ilertIncidentStatus` - The current status of the incident (e.g., INVESTIGATING, RESOLVED, MONITORING, IDENTIFIED). - `message`: A detailed message describing the incident or situation. Default is an empty string. - `affectedServices`: A JSON string representing the list of affected services and their statuses. Default is an empty array (`"[]"`). - `id`: The ID of the incident to update. If set to `"0"`, a new incident will be created. @@ -69,5 +69,5 @@ This provider is part of Keep's integration with ilert, designed to enhance oper ## Useful Links -- [ilert API Documentation](https://api.ilert.com/api-docs/) -- [ilert Alerting](https://www.ilert.com/product/reliable-actionable-alerting) +- [ilert API Documentation](https://api.ilert.com/api-docs/?utm_campaign=Keep&utm_source=integration&utm_medium=organic) +- [ilert Alerting](https://www.ilert.com/product/reliable-actionable-alerting?utm_campaign=Keep&utm_source=integration&utm_medium=organic) diff --git a/docs/providers/overview.mdx b/docs/providers/overview.mdx index 7a45033ce..49069603c 100644 --- a/docs/providers/overview.mdx +++ b/docs/providers/overview.mdx @@ -181,7 +181,7 @@ By leveraging Keep Providers, users are able to deeply integrate Keep with the t > diff --git a/keep/providers/ilert_provider/ilert_provider.py b/keep/providers/ilert_provider/ilert_provider.py index 1fcfff87d..37d535f46 100644 --- a/keep/providers/ilert_provider/ilert_provider.py +++ b/keep/providers/ilert_provider/ilert_provider.py @@ -1,5 +1,5 @@ """ -Ilert Provider is a class that allows to create/close incidents in Ilert. +ilert Provider is a class that allows to create/close incidents in ilert. """ import dataclasses @@ -18,9 +18,9 @@ from keep.providers.providers_factory import ProvidersFactory -class IlertIncidentStatus(str, enum.Enum): +class ilertIncidentStatus(str, enum.Enum): """ - Ilert incident status. + ilert incident status. """ INVESTIGATING = "INVESTIGATING" @@ -30,9 +30,9 @@ class IlertIncidentStatus(str, enum.Enum): @pydantic.dataclasses.dataclass -class IlertProviderAuthConfig: +class ilertProviderAuthConfig: """ - Ilert authentication configuration. + ilert authentication configuration. """ ilert_token: str = dataclasses.field( @@ -53,8 +53,8 @@ class IlertProviderAuthConfig: ) -class IlertProvider(BaseProvider): - """Create/Resolve incidents in Ilert.""" +class ilertProvider(BaseProvider): + """Create/Resolve incidents in ilert.""" PROVIDER_SCOPES = [ ProviderScope("read_permission", "Read permission", mandatory=True), @@ -89,10 +89,10 @@ def dispose(self): def validate_config(self): """ - Validates required configuration for Ilert provider. + Validates required configuration for ilert provider. """ - self.authentication_config = IlertProviderAuthConfig( + self.authentication_config = ilertProviderAuthConfig( **self.config.authentication ) @@ -123,10 +123,10 @@ def validate_scopes(self): def _query(self, incident_id: str, **kwargs): """ - Query Ilert incident. + Query ilert incident. """ self.logger.info( - "Querying Ilert incident", + "Querying ilert incident", extra={ "incident_id": incident_id, **kwargs, @@ -139,24 +139,24 @@ def _query(self, incident_id: str, **kwargs): ) if not response.ok: self.logger.error( - "Failed to query Ilert incident", + "Failed to query ilert incident", extra={ "status_code": response.status_code, "response": response.text, }, ) raise Exception( - f"Failed to query Ilert incident: {response.status_code} {response.text}" + f"Failed to query ilert incident: {response.status_code} {response.text}" ) self.logger.info( - "Ilert incident queried", + "ilert incident queried", extra={"status_code": response.status_code}, ) return response.json() def _get_alerts(self) -> list[AlertDto]: """ - Get incidents from Ilert. + Get incidents from ilert. """ if not self.authentication_config.ilert_host.endswith("/api"): self.authentication_config.ilert_host = ( @@ -187,10 +187,10 @@ def _get_alerts(self) -> list[AlertDto]: alert_dtos = [] for alert in alerts: - severity = IlertProvider.SEVERITIES_MAP.get( + severity = ilertProvider.SEVERITIES_MAP.get( alert.get("affectedServices", [{}])[0].get("impact", "OPERATIONAL") ) - status = IlertProvider.STATUS_MAP.get( + status = ilertProvider.STATUS_MAP.get( alert.get("status"), AlertStatus.ACKNOWLEDGED ) alert_dto = AlertDto( @@ -217,7 +217,7 @@ def __create_or_update_incident( self, summary, status, message, affectedServices, id ): self.logger.info( - "Creating/updating Ilert incident", + "Creating/updating ilert incident", extra={ "summary": summary, "status": status, @@ -271,17 +271,17 @@ def __create_or_update_incident( if not response.ok: self.logger.error( - "Failed to create/update Ilert incident", + "Failed to create/update ilert incident", extra={ "status_code": response.status_code, "response": response.text, }, ) raise Exception( - f"Failed to create/update Ilert incident: {response.status_code} {response.text}" + f"Failed to create/update ilert incident: {response.status_code} {response.text}" ) self.logger.info( - "Ilert incident created/updated", + "ilert incident created/updated", extra={"status_code": response.status_code}, ) return response.json() @@ -308,13 +308,13 @@ def __post_ilert_event( "links": links, "customDetails": custom_details, } - self.logger.info("Posting Ilert event", extra=payload) + self.logger.info("Posting ilert event", extra=payload) response = requests.post( f"{self.authentication_config.ilert_host}/events/keep/{self.authentication_config.ilert_token} ", json=payload, ) self.logger.info( - "Ilert event posted", extra={"status_code": response.status_code} + "ilert event posted", extra={"status_code": response.status_code} ) return response.json() @@ -322,7 +322,7 @@ def _notify( self, _type: Literal["incident", "event"] = "event", summary: str = "", - status: IlertIncidentStatus = IlertIncidentStatus.INVESTIGATING, + status: ilertIncidentStatus = ilertIncidentStatus.INVESTIGATING, message: str = "", affectedServices: str | list = "[]", id: str = "0", @@ -335,7 +335,7 @@ def _notify( custom_details: dict = {}, **kwargs: dict, ): - self.logger.info("Notifying Ilert", extra=locals()) + self.logger.info("Notifying ilert", extra=locals()) if _type == "incident": return self.__create_or_update_incident( summary, status, message, affectedServices, id @@ -371,7 +371,7 @@ def _notify( provider_config = { "authentication": {"ilert_token": api_key, "ilert_host": host}, } - provider: IlertProvider = ProvidersFactory.get_provider( + provider: ilertProvider = ProvidersFactory.get_provider( context_manager=context_manager, provider_id="ilert", provider_type="ilert",