Skip to content

Commit

Permalink
fix templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelle Leempoels authored and Jelle Leempoels committed Nov 13, 2019
1 parent 1daae3c commit 35df6d4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion tmpl/monitor.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ EOT
{{- end }}
{{- end }}

}
}
24 changes: 12 additions & 12 deletions tmpl/screenboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- if .TemplateVariables }}
{{- with .TemplateVariables }}
{{- range . }}
template_variable = {
template_variable {
name = "{{ .Name }}"
prefix = "{{ .Prefix }}"
default = "{{ .Default }}"
default = "{{ .Default }}"
}
{{- end }}
{{- end }}
{{- end }}

{{- with .Widgets }}
{{- range . }}
widget = {
widget {
type = "{{ .Type }}"
x = "{{ .X }}"
y = "{{ .Y }}"
Expand All @@ -47,14 +47,14 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- end }}
{{- if .Time }}
{{- with .Time }}
time = {
time {
live_span = "{{ .LiveSpan }}"
}
{{- end }}
{{- end }}
{{- if .TileDef }}
{{- with .TileDef }}
tile_def = {
tile_def {
{{- if .Viz }}
viz = "{{ .Viz }}"
{{- end }}
Expand All @@ -70,7 +70,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- if .Requests }}
{{- with .Requests }}
{{- range . }}
request = {
request {
{{- if .Query }}
q = "{{ .Query }}"
{{- end }}
Expand Down Expand Up @@ -113,7 +113,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- if .ConditionalFormats }}
{{- with .ConditionalFormats -}}
{{- range . }}
conditional_format = {
conditional_format {
{{- if .Color }}
color = "{{ .Color }}"
{{- end }}
Expand All @@ -133,7 +133,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
image_url = "{{ .ImageURL }}"
{{- end }}
}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Style }}
Expand Down Expand Up @@ -161,7 +161,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- if .Events -}}
{{- with .Events -}}
{{- range . }}
event = {
event {
q = "{{ .Query }}"
} //event
{{- end -}}
Expand All @@ -171,7 +171,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- if .Markers }}
{{- with .Markers }}
{{- range . }}
marker = {
marker {
{{- if .Type }}
type = "{{ .Type }}"
{{- end }}
Expand Down Expand Up @@ -310,7 +310,7 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
{{- end }}
{{- if .Params }}
{{- with .Params }}
params = {
params {
{{- if .Sort }}
sort = "{{ .Sort }}"
{{- end }}
Expand All @@ -335,4 +335,4 @@ resource "datadog_screenboard" "dd_{{ .Id }}" {
} //widget
{{- end }}
{{- end }}
}
}
14 changes: 7 additions & 7 deletions tmpl/timeboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "datadog_timeboard" "dd_{{ .Id }}" {
read_only = {{ .ReadOnly -}}
{{with .Graphs -}}
{{range . }}
graph = {
graph {
title = "{{ .Title }}"
{{with .Definition -}}
viz = "{{ .Viz -}}"
Expand All @@ -18,13 +18,13 @@ resource "datadog_timeboard" "dd_{{ .Id }}" {
palette_flip = "{{ .Style.PaletteFlip }}"
}{{- end}}
{{- if .Markers -}}{{- with .Markers -}}{{range .}}
marker = {
marker {
type = "{{ .Type }}"
value = "{{ .Value }}"
{{ if .Label -}}label = "{{ .Label }}"{{- end}}
}{{- end}}{{- end}}{{- end}}
{{- with .Requests -}}{{range .}}
request = {
request {
q = "{{ .Query -}}"
{{ if .Type -}}type = "{{ .Type }}"{{ end }}
{{ if .Aggregator -}}{{ if ne "" (DeRefString .Aggregator) -}}aggregator = "{{ .Aggregator }}"{{ end}}{{ end -}}
Expand All @@ -36,7 +36,7 @@ resource "datadog_timeboard" "dd_{{ .Id }}" {
}
{{ end -}}{{ end}}
{{- if .ConditionalFormats }}{{- with .ConditionalFormats }}{{- range . -}}
conditional_format = {
conditional_format {
{{ if .Palette }}palette = "{{ .Palette }}"{{ end }}
comparator = "{{ .Comparator }}"
{{- if .Value }}value = "{{ .Value }}"{{ end }}
Expand All @@ -51,9 +51,9 @@ resource "datadog_timeboard" "dd_{{ .Id }}" {
}{{end}}{{- end}}
{{- with .TemplateVariables -}}{{- range . }}

template_variable = {
template_variable {
name = "{{ .Name }}"
prefix = "{{ .Prefix }}"
default = "{{ .Default }}"
default = "{{ .Default }}"
}{{end}}{{- end}}
}
}
Loading

0 comments on commit 35df6d4

Please sign in to comment.