File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/grafana4_dashboard.cpython-310.pyc
Back
o ;jE � @ s� d Z ddlZddlZddlmZ dd� ZdZdZdZ d Z d(dd�Zd)d d�Zg d�Z g Zg d�ZdgZdd� Zdd� Zdd� Zdd� ZdZdZdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� ZdS )*a% Manage Grafana v4.0 Dashboards .. versionadded:: 2017.7.0 :configuration: This state requires a configuration profile to be configured in the minion config, minion pillar, or master config. The module will use the 'grafana' key by default, if defined. Example configuration using basic authentication: .. code-block:: yaml grafana: grafana_url: http://grafana.localhost grafana_user: admin grafana_password: admin grafana_timeout: 3 Example configuration using token based authentication: .. code-block:: yaml grafana: grafana_url: http://grafana.localhost grafana_token: token grafana_timeout: 3 The behavior of this module is to create dashboards if they do not exist, to add rows if they do not exist in existing dashboards, and to update rows if they exist in dashboards. The module will not manage rows that are not defined, allowing users to manage their own custom rows. .. code-block:: yaml Ensure minimum dashboard is managed: grafana4_dashboard.present: - name: insightful-dashboard - base_dashboards_from_pillar: - default_dashboard - base_rows_from_pillar: - default_row - base_panels_from_pillar: - default_panel - dashboard: rows: - title: Usage panels: - targets: - target: alias(constantLine(50), 'max') title: Imaginary type: graph � N)� DictDifferc C s dt v rdS dS )z)Only load if grafana4 module is available�grafana4.get_dashboardT)Fz#grafana4 module could not be loaded)�__salt__� r r �R/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/grafana4_dashboard.py�__virtual__= s r zgrafana_dashboards:defaultzgrafana_panels:defaultzgrafana_rows:defaultZgrafana_pinned_rows�grafanac C s� | ddi d�}|p i }t |t�rtd |�}tg|pg }tg|p"g }tg|p)g }t|||�}d|vr9| |d<