Skip to content

Commit

Permalink
Generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Jun 2, 2023
1 parent 14d0f44 commit 9af123f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/resources/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
5 changes: 3 additions & 2 deletions internal/resources/grafana/resource_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 9af123f

Please sign in to comment.