From 9af123fce0b0b53e4f9719fc5886b47f42d9d352 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 2 Jun 2023 13:00:44 -0400 Subject: [PATCH] Generate docs --- docs/resources/report.md | 1 + internal/resources/grafana/resource_report.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/resources/report.md b/docs/resources/report.md index 94ab0b092..981348717 100644 --- a/docs/resources/report.md +++ b/docs/resources/report.md @@ -50,6 +50,7 @@ resource "grafana_report" "test" { - `dashboard_id` (Number, Deprecated) Dashboard to be sent in the report. This field is deprecated, use `dashboard_uid` instead. - `dashboard_uid` (String) Dashboard to be sent in the report. +- `formats` (Set of String) Specifies what kind of attachment to generate for the report. Allowed values: `pdf`, `csv`, `image`. - `include_dashboard_link` (Boolean) Whether to include a link to the dashboard in the report. Defaults to `true`. - `include_table_csv` (Boolean) Whether to include a CSV file of table panel data. Defaults to `false`. - `layout` (String) Layout of the report. Allowed values: `simple`, `grid`. Defaults to `grid`. diff --git a/internal/resources/grafana/resource_report.go b/internal/resources/grafana/resource_report.go index 032f0abf5..32c164d97 100644 --- a/internal/resources/grafana/resource_report.go +++ b/internal/resources/grafana/resource_report.go @@ -43,6 +43,7 @@ var ( reportLayouts = []string{reportLayoutSimple, reportLayoutGrid} reportOrientations = []string{reportOrientationLandscape, reportOrientationPortrait} reportFrequencies = []string{reportFrequencyNever, reportFrequencyOnce, reportFrequencyHourly, reportFrequencyDaily, reportFrequencyWeekly, reportFrequencyMonthly, reportFrequencyCustom} + reportFormats = []string{reportFormatPDF, reportFormatCSV, reportFormatImage} ) func ResourceReport() *schema.Resource { @@ -137,10 +138,10 @@ func ResourceReport() *schema.Resource { "formats": { Type: schema.TypeSet, Optional: true, - Description: "specifies what kind of attachment to generate for the report", + Description: common.AllowedValuesDescription("Specifies what kind of attachment to generate for the report", reportFormats), Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{reportFormatPDF, reportFormatCSV, reportFormatImage}, false), + ValidateFunc: validation.StringInSlice(reportFormats, false), }, }, "time_range": {