Manage alert rules and their notifications in Logpoint.
Wraps the Alert Rules API.
Use the Rule, EmailNotification, and HttpNotification builders to compose
structs for creation endpoints.
Summary
Functions
Activate alert rules by IDs.
Create an alert rule.
Create an email notification for alert rules.
Create an HTTP notification for alert rules.
Deactivate alert rules by IDs.
Delete alert rules by IDs.
Get an alert rule by ID.
Get alert notification by alert ID and type.
List alert rules.
Update an alert rule.
Functions
@spec activate(LogpointApi.Data.Client.t(), [String.t()]) :: {:ok, map()} | {:error, term()}
Activate alert rules by IDs.
@spec create(LogpointApi.Data.Client.t(), LogpointApi.Data.Rule.t() | map()) :: {:ok, map()} | {:error, term()}
Create an alert rule.
@spec create_email_notification( LogpointApi.Data.Client.t(), LogpointApi.Data.EmailNotification.t() ) :: {:ok, map()} | {:error, term()}
Create an email notification for alert rules.
@spec create_email_notification(LogpointApi.Data.Client.t(), [String.t()], map()) :: {:ok, map()} | {:error, term()}
@spec create_http_notification( LogpointApi.Data.Client.t(), LogpointApi.Data.HttpNotification.t() ) :: {:ok, map()} | {:error, term()}
Create an HTTP notification for alert rules.
@spec create_http_notification(LogpointApi.Data.Client.t(), [String.t()], map()) :: {:ok, map()} | {:error, term()}
@spec deactivate(LogpointApi.Data.Client.t(), [String.t()]) :: {:ok, map()} | {:error, term()}
Deactivate alert rules by IDs.
@spec delete(LogpointApi.Data.Client.t(), [String.t()]) :: {:ok, map()} | {:error, term()}
Delete alert rules by IDs.
@spec get(LogpointApi.Data.Client.t(), String.t()) :: {:ok, map()} | {:error, term()}
Get an alert rule by ID.
@spec get_notification(LogpointApi.Data.Client.t(), String.t(), :email | :http) :: {:ok, map()} | {:error, term()}
Get alert notification by alert ID and type.
@spec list(LogpointApi.Data.Client.t(), map()) :: {:ok, map()} | {:error, term()}
List alert rules.
Supported keys in params:
:limit- maximum number of rules to return:page- page number for pagination:return_all_data- whentrue, returns all rule data
Examples
AlertRule.list(client)
AlertRule.list(client, %{limit: 10, page: 1})
@spec update( LogpointApi.Data.Client.t(), String.t(), LogpointApi.Data.Rule.t() | map() ) :: {:ok, map()} | {:error, term()}
Update an alert rule.