grafana-ansible-collection/docs/alert_notification_policy_module.rst

895 lines
21 KiB
ReStructuredText
Raw Normal View History

.. Document meta
:orphan:
.. |antsibull-internal-nbsp| unicode:: 0xA0
:trim:
.. role:: ansible-attribute-support-label
.. role:: ansible-attribute-support-property
.. role:: ansible-attribute-support-full
.. role:: ansible-attribute-support-partial
.. role:: ansible-attribute-support-none
.. role:: ansible-attribute-support-na
.. role:: ansible-option-type
.. role:: ansible-option-elements
.. role:: ansible-option-required
.. role:: ansible-option-versionadded
.. role:: ansible-option-aliases
.. role:: ansible-option-choices
.. role:: ansible-option-choices-entry
.. role:: ansible-option-default
.. role:: ansible-option-default-bold
.. role:: ansible-option-configuration
.. role:: ansible-option-returned-bold
.. role:: ansible-option-sample-bold
.. Anchors
.. _ansible_collections.grafana.grafana.alert_notification_policy_module:
.. Anchors: short name for ansible.builtin
.. Anchors: aliases
.. Title
grafana.grafana.alert_notification_policy module -- Sets the notification policy tree in Grafana Alerting
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. Collection note
.. note::
This module is part of the `grafana.grafana collection <https://galaxy.ansible.com/grafana/grafana>`_ (version 0.0.5).
You might already have this collection installed if you are using the ``ansible`` package.
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
To install it, use: :code:`ansible-galaxy collection install grafana.grafana`.
To use it in a playbook, specify: :code:`grafana.grafana.alert_notification_policy`.
.. version_added
.. versionadded:: 0.0.1 of grafana.grafana
.. contents::
:local:
:depth: 1
.. Deprecated
Synopsis
--------
.. Description
- Set the notification policy tree using Ansible
.. Aliases
.. Requirements
.. Options
Parameters
----------
.. rst-class:: ansible-option-table
.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
* - Parameter
- Comments
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-Continue"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-continue:
.. rst-class:: ansible-option-title
**Continue**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-Continue" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`boolean`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
Continue matching subsequent sibling nodes if set to `True`.
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-default-bold:`no` :ansible-option-default:`← (default)`
- :ansible-option-choices-entry:`yes`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-grafana_api_key"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-grafana_api_key:
.. rst-class:: ansible-option-title
**grafana_api_key**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-grafana_api_key" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string` / :ansible-option-required:`required`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
Grafana API Key used to authenticate with Grafana.
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-GroupByStr"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-groupbystr:
.. rst-class:: ansible-option-title
**GroupByStr**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-GroupByStr" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
List of string.
Group alerts when you receive a notification based on labels. If empty it will be inherited from the parent policy.
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`[]`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-groupInterval"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-groupinterval:
.. rst-class:: ansible-option-title
**groupInterval**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-groupInterval" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
The wait time to send a batch of new alerts for that group after the first notification was sent. Inherited from the parent policy if empty.
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`"5m"`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-groupWait"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-groupwait:
.. rst-class:: ansible-option-title
**groupWait**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-groupWait" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
The wait time until the initial notification is sent for a new group created by an incoming alert. Inherited from the parent policy if empty.
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`"30s"`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-MuteTimeIntervals"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-mutetimeintervals:
.. rst-class:: ansible-option-title
**MuteTimeIntervals**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-MuteTimeIntervals" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
List of string.
Add mute timing to policy
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`[]`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-objectMatchers"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-objectmatchers:
.. rst-class:: ansible-option-title
**objectMatchers**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-objectMatchers" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
State for the Grafana CLoud stack.
.. rst-class:: ansible-option-line
:ansible-option-choices:`Choices:`
- :ansible-option-default-bold:`present` :ansible-option-default:`← (default)`
- :ansible-option-choices-entry:`absent`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-repeatInterval"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-repeatinterval:
.. rst-class:: ansible-option-title
**repeatInterval**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-repeatInterval" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
The waiting time to resend an alert after they have successfully been sent.
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`"4h"`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-root_policy_receiver"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-root_policy_receiver:
.. rst-class:: ansible-option-title
**root_policy_receiver**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-root_policy_receiver" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
Name of the contact point to set as the default receiver
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`"grafana-default-email"`
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-Routes"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-routes:
.. rst-class:: ansible-option-title
**Routes**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-Routes" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`list` / :ansible-option-elements:`elements=string` / :ansible-option-required:`required`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
List of objects
A Route is a node that contains definitions of how to handle alerts.
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-stack_slug"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__parameter-stack_slug:
.. rst-class:: ansible-option-title
**stack_slug**
.. raw:: html
<a class="ansibleOptionLink" href="#parameter-stack_slug" title="Permalink to this option"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string` / :ansible-option-required:`required`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
Name of the Grafana Cloud stack to which the notification policies will be added
.. raw:: html
</div>
.. Attributes
.. Notes
.. Seealso
.. Examples
Examples
--------
.. code-block:: yaml+jinja
- name: Set Notification policy tree
alert_notification_policy:
stack_slug: "{{ stack_slug }}"
grafana_api_key: "{{ grafana_api_key }}"
routes: [
{
receiver: myReceiver,
object_matchers: [["env", "=", "Production"]],
}
]
- name: Set nested Notification policies
alert_notification_policy:
routes: [
{
receiver: myReceiver,
object_matchers: [["env", "=", "Production"],["team", "=", "ops"]],
routes: [
{
receiver: myReceiver2,
object_matchers: [["region", "=", "eu"]],
}
]
},
{
receiver: myReceiver3,
object_matchers: [["env", "=", "Staging"]]
}
]
stack_slug: "{{ stack_slug }}"
grafana_api_key: "{{ grafana_api_key }}"
.. Facts
.. Return values
Return Values
-------------
Common return values are documented :ref:`here <common_return_values>`, the following are the fields unique to this module:
.. rst-class:: ansible-option-table
.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
* - Key
- Description
* - .. raw:: html
<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output:
.. rst-class:: ansible-option-title
**output**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`dictionary`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-cell">
Dict object containing Notification tree information
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` On success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/group_interval"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/group_interval:
.. rst-class:: ansible-option-title
**group_interval**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/group_interval" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
The waiting time to send a batch of new alerts for that group after the first notification was sent. This is of the parent policy.
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` on success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/group_wait"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/group_wait:
.. rst-class:: ansible-option-title
**group_wait**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/group_wait" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
The waiting time until the initial notification is sent for a new group created by an incoming alert. This is of the parent policy.
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` on success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/provenance"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/provenance:
.. rst-class:: ansible-option-title
**provenance**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/provenance" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` on success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/receiver"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/receiver:
.. rst-class:: ansible-option-title
**receiver**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/receiver" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
The name of the default contact point
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` state is present and on success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/repeat_interval"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/repeat_interval:
.. rst-class:: ansible-option-title
**repeat_interval**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/repeat_interval" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
The waiting time to resend an alert after they have successfully been sent. This is of the parent policy
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` on success
.. raw:: html
</div>
* - .. raw:: html
<div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/routes"></div>
.. _ansible_collections.grafana.grafana.alert_notification_policy_module__return-output/routes:
.. rst-class:: ansible-option-title
**routes**
.. raw:: html
<a class="ansibleOptionLink" href="#return-output/routes" title="Permalink to this return value"></a>
.. rst-class:: ansible-option-type-line
:ansible-option-type:`list` / :ansible-option-elements:`elements=string`
.. raw:: html
</div>
- .. raw:: html
<div class="ansible-option-indent-desc"></div><div class="ansible-option-cell">
The entire notification tree returned as a list
.. rst-class:: ansible-option-line
:ansible-option-returned-bold:`Returned:` on success
.. raw:: html
</div>
.. Status (Presently only deprecated)
.. Authors
Authors
~~~~~~~
- Ishan Jain (@ishanjainn)
.. Extra links
Collection links
~~~~~~~~~~~~~~~~
.. raw:: html
<p class="ansible-links">
<a href="https://github.com/grafana/grafana-ansible-collection/issues" aria-role="button" target="_blank" rel="noopener external">Issue Tracker</a>
<a href="https://github.com/grafana/grafana-ansible-collection" aria-role="button" target="_blank" rel="noopener external">Repository (Sources)</a>
</p>
.. Parsing errors