From 02f219deb0368955bc69ab5fc36e666423fcc3b8 Mon Sep 17 00:00:00 2001 From: Tal Date: Thu, 26 Sep 2024 17:24:00 +0300 Subject: [PATCH] docs(ilert): branding issues (#2011) --- .../documentation/ilert-provider.mdx | 12 +++--- docs/providers/overview.mdx | 2 +- .../ilert_provider/ilert_provider.py | 37 ++++++++++--------- 3 files changed, 26 insertions(+), 25 deletions(-) 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..748e67c63 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 @@ -20,7 +20,7 @@ class IlertIncidentStatus(str, enum.Enum): """ - Ilert incident status. + ilert incident status. """ INVESTIGATING = "INVESTIGATING" @@ -32,7 +32,7 @@ class IlertIncidentStatus(str, enum.Enum): @pydantic.dataclasses.dataclass class IlertProviderAuthConfig: """ - Ilert authentication configuration. + ilert authentication configuration. """ ilert_token: str = dataclasses.field( @@ -54,8 +54,9 @@ class IlertProviderAuthConfig: class IlertProvider(BaseProvider): - """Create/Resolve incidents in Ilert.""" + """Create/Resolve incidents in ilert.""" + PROVIDER_DISPLAY_NAME = "ilert" PROVIDER_SCOPES = [ ProviderScope("read_permission", "Read permission", mandatory=True), ProviderScope("write_permission", "Write permission", mandatory=False), @@ -89,7 +90,7 @@ def dispose(self): def validate_config(self): """ - Validates required configuration for Ilert provider. + Validates required configuration for ilert provider. """ self.authentication_config = IlertProviderAuthConfig( @@ -123,10 +124,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 +140,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 = ( @@ -217,7 +218,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 +272,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 +309,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() @@ -335,7 +336,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