Skip to content

Commit

Permalink
docs(ilert): branding issues (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored Sep 26, 2024
1 parent 4f1d253 commit 02f219d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 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
37 changes: 19 additions & 18 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 @@ -20,7 +20,7 @@

class IlertIncidentStatus(str, enum.Enum):
"""
Ilert incident status.
ilert incident status.
"""

INVESTIGATING = "INVESTIGATING"
Expand All @@ -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(
Expand All @@ -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),
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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 = (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()
Expand All @@ -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()

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

0 comments on commit 02f219d

Please sign in to comment.