grafana-ansible-collection/docs/collections/grafana/grafana/dashboard_module.html
2022-08-16 11:02:18 +05:30

349 lines
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>grafana.grafana.dashboard module Manage Dashboards in Grafana &mdash; Ansible collections documentation</title>
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/ansible.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/antsibull-minimal.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/css/rtd-ethical-ads.css" type="text/css" />
<link rel="shortcut icon" href="_static/images/Ansible-Mark-RGB_Black.svg"/>
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/js/theme.js"></script>
<link rel="search" title="Search" href="../../../search.html" />
<link rel="next" title="grafana.grafana.datasource module Manage Data sources in Grafana" href="datasource_module.html" />
<link rel="prev" title="grafana.grafana.cloud_stack module Manage Grafana Cloud stack" href="cloud_stack_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
</head>
<body class="wy-body-for-nav"><!-- extra body elements for Ansible beyond RTD Sphinx Theme -->
<div class="DocSite-globalNav ansibleNav">
<ul>
<li><a href="https://www.ansible.com/ansiblefest" target="_blank">AnsibleFest</a></li>
<li><a href="https://www.ansible.com/tower" target="_blank">Products</a></li>
<li><a href="https://www.ansible.com/community" target="_blank">Community</a></li>
<li><a href="https://www.ansible.com/webinars-training" target="_blank">Webinars & Training</a></li>
<li><a href="https://www.ansible.com/blog" target="_blank">Blog</a></li>
</ul>
</div>
<a class="DocSite-nav" href="/" style="padding-bottom: 30px;">
<img class="DocSiteNav-logo"
src="../../../_static/images/Ansible-Mark-RGB_White.svg"
alt="Ansible Logo">
<div class="DocSiteNav-title">Ansible Collections Documentation</div>
</a>
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home"> Ansible collections
</a><!--- Based on https://github.com/rtfd/sphinx_rtd_theme/pull/438/files -->
<div class="version">
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" class="st-default-search-input" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Collections:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../../index.html">Collection Index</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Collections in the Grafana Namespace</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Grafana.Grafana</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="index.html#description">Description</a></li>
<li class="toctree-l4 current"><a class="reference internal" href="index.html#plugin-index">Plugin Index</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Plugin indexes:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../index_module.html">Index of all Modules</a></li>
</ul>
<!-- extra nav elements for Ansible beyond RTD Sphinx Theme -->
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">Ansible collections</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="../../index.html">Collection Index</a> &raquo;</li>
<li><a href="../index.html">Collections in the Grafana Namespace</a> &raquo;</li>
<li><a href="index.html">Grafana.Grafana</a> &raquo;</li>
<li>grafana.grafana.dashboard module Manage Dashboards in Grafana</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<span class="target" id="ansible-collections-grafana-grafana-dashboard-module"></span><section id="grafana-grafana-dashboard-module-manage-dashboards-in-grafana">
<h1>grafana.grafana.dashboard module Manage Dashboards in Grafana<a class="headerlink" href="#grafana-grafana-dashboard-module-manage-dashboards-in-grafana" title="Permalink to this heading"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This module is part of the <a class="reference external" href="https://galaxy.ansible.com/grafana/grafana">grafana.grafana collection</a> (version 0.0.7).</p>
<p>You might already have this collection installed if you are using the <code class="docutils literal notranslate"><span class="pre">ansible</span></code> package.
It is not included in <code class="docutils literal notranslate"><span class="pre">ansible-core</span></code>.
To check whether it is installed, run <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">list</span></code>.</p>
<p>To install it, use: <code class="code docutils literal notranslate"><span class="pre">ansible-galaxy</span> <span class="pre">collection</span> <span class="pre">install</span> <span class="pre">grafana.grafana</span></code>.</p>
<p>To use it in a playbook, specify: <code class="code docutils literal notranslate"><span class="pre">grafana.grafana.dashboard</span></code>.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified added">New in version 0.0.1: </span>of grafana.grafana</p>
</div>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><p><a class="reference internal" href="#synopsis" id="id1">Synopsis</a></p></li>
<li><p><a class="reference internal" href="#requirements" id="id2">Requirements</a></p></li>
<li><p><a class="reference internal" href="#parameters" id="id3">Parameters</a></p></li>
<li><p><a class="reference internal" href="#examples" id="id4">Examples</a></p></li>
<li><p><a class="reference internal" href="#return-values" id="id5">Return Values</a></p></li>
</ul>
</div>
<section id="synopsis">
<h2><a class="toc-backref" href="#id1">Synopsis</a><a class="headerlink" href="#synopsis" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p>Create, Update and delete Dashboards using Ansible.</p></li>
</ul>
</section>
<section id="requirements">
<h2><a class="toc-backref" href="#id2">Requirements</a><a class="headerlink" href="#requirements" title="Permalink to this heading"></a></h2>
<p>The below requirements are needed on the host that executes this module.</p>
<ul class="simple">
<li><p>requests &gt;= 1.0.0</p></li>
</ul>
</section>
<section id="parameters">
<h2><a class="toc-backref" href="#id3">Parameters</a><a class="headerlink" href="#parameters" title="Permalink to this heading"></a></h2>
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">
<thead>
<tr class="row-odd"><th class="head"><p>Parameter</p></th>
<th class="head"><p>Comments</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-dashboard"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-parameter-dashboard"><strong>dashboard</strong></p>
<a class="ansibleOptionLink" href="#parameter-dashboard" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span> / <span class="ansible-option-required">required</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>JSON source code for dashboard</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-grafana_api_key"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-parameter-grafana-api-key"><strong>grafana_api_key</strong></p>
<a class="ansibleOptionLink" href="#parameter-grafana_api_key" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>CLoud API Key to authenticate with Grafana Cloud.</p>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-stack_slug"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-parameter-stack-slug"><strong>stack_slug</strong></p>
<a class="ansibleOptionLink" href="#parameter-stack_slug" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Name of the Grafana Cloud stack to which the dashboard will be added</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-state"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-parameter-state"><strong>state</strong></p>
<a class="ansibleOptionLink" href="#parameter-state" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>State for the Grafana CLoud stack.</p>
<p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
<ul class="simple">
<li><p><span class="ansible-option-default-bold">present</span> <span class="ansible-option-default">← (default)</span></p></li>
<li><p><span class="ansible-option-choices-entry">absent</span></p></li>
</ul>
</div></td>
</tr>
</tbody>
</table>
</section>
<section id="examples">
<h2><a class="toc-backref" href="#id4">Examples</a><a class="headerlink" href="#examples" title="Permalink to this heading"></a></h2>
<div class="highlight-yaml+jinja notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Create/Update a dashboard</span><span class="w"></span>
<span class="w"> </span><span class="nt">grafana.grafana.dashboard</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">datasource</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">&#39;ansible.builtin.file&#39;</span><span class="o">,</span> <span class="s1">&#39;dashboard.json&#39;</span><span class="o">)</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">stack_slug</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">stack_slug</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">grafana_api_key</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">grafana_api_key</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">present</span><span class="w"></span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Delete dashboard</span><span class="w"></span>
<span class="w"> </span><span class="nt">grafana.grafana.dashboard</span><span class="p">:</span><span class="w"></span>
<span class="w"> </span><span class="nt">datasource</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">lookup</span><span class="o">(</span><span class="s1">&#39;ansible.builtin.file&#39;</span><span class="o">,</span> <span class="s1">&#39;dashboard.json&#39;</span><span class="o">)</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">stack_slug</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">stack_slug</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">grafana_api_key</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;</span><span class="cp">{{</span> <span class="nv">grafana_api_key</span> <span class="cp">}}</span><span class="s">&quot;</span><span class="w"></span>
<span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">absent</span><span class="w"></span>
</pre></div>
</div>
</section>
<section id="return-values">
<h2><a class="toc-backref" href="#id5">Return Values</a><a class="headerlink" href="#return-values" title="Permalink to this heading"></a></h2>
<p>Common return values are documented <a class="reference external" href="https://docs.ansible.com/ansible/devel/reference_appendices/common_return_values.html#common-return-values" title="(in Ansible vdevel)"><span class="xref std std-ref">here</span></a>, the following are the fields unique to this module:</p>
<table class="colwidths-auto ansible-option-table docutils align-default" style="width: 100%">
<thead>
<tr class="row-odd"><th class="head"><p>Key</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output"><strong>output</strong></p>
<a class="ansibleOptionLink" href="#return-output" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Dict object containing folder information</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> On success</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/id"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-id"><strong>id</strong></p>
<a class="ansibleOptionLink" href="#return-output/id" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The ID for the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> on success</p>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/message"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-message"><strong>message</strong></p>
<a class="ansibleOptionLink" href="#return-output/message" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The message returned after the operation on the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is absent and on success</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/slug"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-slug"><strong>slug</strong></p>
<a class="ansibleOptionLink" href="#return-output/slug" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The slug for the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is present and on success</p>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/status"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-status"><strong>status</strong></p>
<a class="ansibleOptionLink" href="#return-output/status" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The status of the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is present and on success</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/title"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-title"><strong>title</strong></p>
<a class="ansibleOptionLink" href="#return-output/title" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The name of the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is absent and on success</p>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/uid"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-uid"><strong>uid</strong></p>
<a class="ansibleOptionLink" href="#return-output/uid" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The UID for the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is present and on success</p>
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/url"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-url"><strong>url</strong></p>
<a class="ansibleOptionLink" href="#return-output/url" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The endpoint for the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is present and on success</p>
</div></td>
</tr>
<tr class="row-even"><td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="return-output/version"></div><p class="ansible-option-title" id="ansible-collections-grafana-grafana-dashboard-module-return-output-version"><strong>version</strong></p>
<a class="ansibleOptionLink" href="#return-output/version" title="Permalink to this return value"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
<td><div class="ansible-option-indent-desc"></div><div class="ansible-option-cell"><p>The version of the dashboard</p>
<p class="ansible-option-line"><span class="ansible-option-returned-bold">Returned:</span> state is present and on success</p>
</div></td>
</tr>
</tbody>
</table>
<section id="authors">
<h3>Authors<a class="headerlink" href="#authors" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p>Ishan Jain (&#64;ishanjainn)</p></li>
</ul>
</section>
<section id="collection-links">
<h3>Collection links<a class="headerlink" href="#collection-links" title="Permalink to this heading"></a></h3>
<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></section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="cloud_stack_module.html" class="btn btn-neutral float-left" title="grafana.grafana.cloud_stack module Manage Grafana Cloud stack" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="datasource_module.html" class="btn btn-neutral float-right" title="grafana.grafana.datasource module Manage Data sources in Grafana" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright Ansible contributors.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script><!-- extra footer elements for Ansible beyond RTD Sphinx Theme -->
</body>
</html>