Skip to content

Table of Contents

alerting_provisioning

AlertingProvisioning Objects

class AlertingProvisioning()

The class includes all necessary methods to access the Grafana alerting provisioning 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_alert_rule

def get_alert_rule(uid: str) -> dict

The method includes a functionality to get the alert rule specified by the uid

Arguments:

  • uid str - Specify the alert rule uid

Raises:

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

Returns:

  • api_call dict - Returns the alert rule

add_alert_rule

def add_alert_rule(alert_rule: AlertRule, disable_provenance: bool = False)

The method includes a functionality to create a new alert rule

Arguments:

  • alert_rule AlertRule - Specify the alert rule
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

update_alert_rule

def update_alert_rule(uid: str,
                      alert_rule: AlertRule,
                      disable_provenance: bool = False)

The method includes a functionality to update an existing alert rule

Arguments:

  • uid str - Specify the alert rule uid
  • alert_rule AlertRule - Specify the alert rule
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

update_the_interval_of_a_alert_rule_group

def update_the_interval_of_a_alert_rule_group(
        folder_uid: str,
        group: str,
        alert_rule_group_interval: int,
        disable_provenance: bool = False)

The method includes a functionality to update the interval of a alert rule group

Arguments:

  • folder_uid str - Specify the folder uid
  • group str - Specify the group
  • alert_rule_group_interval int - Specify the alert rule group interval
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

delete_alert_rule

def delete_alert_rule(uid: str, disable_provenance: bool = False)

The method includes a functionality to delete an alert rule

Arguments:

  • uid str - Specify the alert rule uid
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

get_all_contact_points

def get_all_contact_points() -> list

The method includes a functionality to get all contact points

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns all contact points

add_contact_point

def add_contact_point(embedded_contact_point: EmbeddedContactPoint,
                      disable_provenance: bool = False)

The method includes a functionality to create a contact point

Arguments:

  • embedded_contact_point EmbeddedContactPoint - Specify the embedded contact point
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

update_contact_point

def update_contact_point(uid: str,
                         embedded_contact_point: EmbeddedContactPoint,
                         disable_provenance: bool = False)

The method includes a functionality to update a contact point

Arguments:

  • uid str - Specify the uid of the contact point
  • embedded_contact_point EmbeddedContactPoint - Specify the embedded contact point
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

delete_contact_point

def delete_contact_point(uid: str)

The method includes a functionality to delete a contact point

Arguments:

  • uid str - Specify the uid of the contact point

Raises:

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

Returns:

None

get_notification_policies

def get_notification_policies() -> dict

The method includes a functionality to get the notification policy tree

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the notification policy tree

add_notification_policies

def add_notification_policies(route: Route, disable_provenance: bool = False)

The method includes a functionality to set the notification policy tree

Arguments:

  • route Route - Specify the alert rule routes
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

get_all_mute_timings

def get_all_mute_timings() -> list

The method includes a functionality to get all mute timings

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns all mute timings

get_mute_timing

def get_mute_timing(name: str) -> dict

The method includes a functionality to get a mute timings specified by the name

Arguments:

  • name str - Specify the mute timing name

Raises:

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

Returns:

  • api_call dict - Returns the mute timing

add_mute_timing

def add_mute_timing(mute_time_interval: MuteTimeInterval,
                    disable_provenance: bool = False)

The method includes a functionality to create a mute timing

Arguments:

  • mute_time_interval MuteTimeInterval - Specify the mute time interval
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

update_mute_timing

def update_mute_timing(name: str,
                       mute_time_interval: MuteTimeInterval,
                       disable_provenance: bool = False)

The method includes a functionality to update an existing mute timing

Arguments:

  • name str - Specify the mute timing name
  • mute_time_interval MuteTimeInterval - Specify the mute time interval
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

delete_mute_timing

def delete_mute_timing(name: str)

The method includes a functionality to delete a mute timings specified by the name

Arguments:

  • name str - Specify the mute timing name

Raises:

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

Returns:

None

get_all_message_templates

def get_all_message_templates() -> list

The method includes a functionality to get all message templates

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns all message templates

get_message_template

def get_message_template(name: str) -> dict

The method includes a functionality to get a message template specified by the name

Arguments:

  • name str - Specify the message template name

Raises:

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

Returns:

  • api_call dict - Returns the message template

create_or_update_message_template

def create_or_update_message_template(name: str,
                                      message_template: str,
                                      disable_provenance: bool = False)

The method includes a functionality to create or update a message template

Arguments:

  • name str - Specify the message template name
  • message_template str - Specify the message template
  • disable_provenance bool - Specify if the provenance header should be set or not (default False)

Raises:

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

Returns:

None

delete_message_template

def delete_message_template(name: str)

The method includes a functionality to delete a message template

Arguments:

  • name str - Specify the message template name

Raises:

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

Returns:

None