Skip to content

Conversation

@gizmoguy
Copy link
Contributor

SUMMARY

This feature allows users to set dashboard inputs when creating/updating a dashboard by providing a dictionary of input names and values with the new optional inputs attribute.

Fixes #329

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

grafana_dashboard

ADDITIONAL INFORMATION

See included integration test for some examples of how to use, or this simple ansible playbook:

- name: Test grafana
  hosts: localhost
  tasks:
    - name: Create dashboard with inputs
      community.grafana.grafana_dashboard:
        grafana_url: "http://localhost:3000"
        uid: test-dashboard-inputs
        dashboard_id: "1860"
        dashboard_revision: "40"
        inputs:
          DS_PROMETHEUS: prometheus
        overwrite: "true"
        state: "present"

@gizmoguy gizmoguy requested review from rrey and seuf as code owners May 18, 2025 07:18
@codecov
Copy link

codecov bot commented May 18, 2025

Codecov Report

❌ Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.59%. Comparing base (2330479) to head (6c4f88c).

Files with missing lines Patch % Lines
plugins/modules/grafana_dashboard.py 72.41% 4 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #430      +/-   ##
==========================================
- Coverage   73.62%   73.59%   -0.03%     
==========================================
  Files          21       21              
  Lines        2328     2356      +28     
  Branches      495      507      +12     
==========================================
+ Hits         1714     1734      +20     
- Misses        445      449       +4     
- Partials      169      173       +4     
Flag Coverage Δ
integration 71.27% <72.41%> (+<0.01%) ⬆️
sanity 22.99% <3.44%> (-0.31%) ⬇️
units 66.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add support for dashboard inputs

2 participants