Skip to content

Commit

Permalink
docs(ilert): branding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Sep 26, 2024
1 parent afe8c58 commit 0353c76
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
12 changes: 6 additions & 6 deletions docs/providers/documentation/ilert-provider.mdx
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion docs/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ By leveraging Keep Providers, users are able to deeply integrate Keep with the t
></Card>

<Card
title="Ilert"
title="ilert"
href="/providers/documentation/ilert-provider"
icon={
<img src="https://img.logo.dev/ilert.com?token=pk_dfXfZBoKQMGDTIgqu7LvYg" />
Expand Down
52 changes: 26 additions & 26 deletions keep/providers/ilert_provider/ilert_provider.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -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(
Expand All @@ -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),
Expand Down Expand Up @@ -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
)

Expand Down Expand Up @@ -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,
Expand All @@ -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 = (
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down Expand Up @@ -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()
Expand All @@ -308,21 +308,21 @@ 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()

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",
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0353c76

Please sign in to comment.