Skip to content

Table of Contents

alerting_notifications

AlertingNotifications Objects

class AlertingNotifications()

The class includes all necessary methods to access the Grafana alerting notifications API endpoints

Arguments:

  • grafana_api_model APIModel - Inject a Grafana API model object that includes all necessary values and information

Attributes:

  • grafana_api_model APIModel - This is where we store the grafana_api_model

get_all_notification_channels

def get_all_notification_channels() -> list

The method includes a functionality to get all alerting notification channels

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns all notification channels

get_all_notification_channels_lookup

def get_all_notification_channels_lookup() -> list

The method includes a functionality to lookup and get reduced information of all alerting notification channels

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns all notification channels as reduced information

get_notification_channel_by_uid

def get_notification_channel_by_uid(uid: str) -> dict

The method includes a functionality to get an alerting notification channel specified by the uid

Arguments:

  • uid str - Specify the uid of the notification channel

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the specified notification channel

get_notification_channel_by_id

def get_notification_channel_by_id(id: int) -> dict

The method includes a functionality to get an alerting notification channel specified by the id

Arguments:

  • id int - Specify the id of the notification channel

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the specified notification channel

create_notification_channel

def create_notification_channel(notification_channel: dict) -> dict

The method includes a functionality to create an alerting notification channel specified by the notification channel dict

Arguments:

  • notification_channel dict - Specify the channel of the notification

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the newly created notification channel

update_notification_channel_by_uid

def update_notification_channel_by_uid(uid: str,
                                       notification_channel: dict) -> dict

The method includes a functionality to update an alerting notification channel specified by the notification channel dict and the uid

Arguments:

  • uid str - Specify the uid of the notification channel
  • notification_channel dict - Specify the channel of the notification

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the updated notification channel

update_notification_channel_by_id

def update_notification_channel_by_id(id: int,
                                      notification_channel: dict) -> dict

The method includes a functionality to update an alerting notification channel specified by the notification channel dict and the id

Arguments:

  • id int - Specify the id of the notification channel
  • notification_channel dict - Specify the channel of the notification

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the updated notification channel

delete_notification_channel_by_uid

def delete_notification_channel_by_uid(uid: str)

The method includes a functionality to delete an alerting notification channel specified by the uid

Arguments:

  • uid uid - Specify the uid of the notification channel

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

None

delete_notification_channel_by_id

def delete_notification_channel_by_id(id: int)

The method includes a functionality to delete an alerting notification channel specified by the id

Arguments:

  • id int - Specify the id of the notification channel

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

None

test_notification_channel

def test_notification_channel(notification_channel: dict)

The method includes a functionality to test an alerting notification channel specified by the notification_channel

Arguments:

  • notification_channel dict - Specify the channel of the notification

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

None