diff --git a/newrelic/resource_newrelic_one_dashboard.go b/newrelic/resource_newrelic_one_dashboard.go index 95e88c837..b31a17bd5 100644 --- a/newrelic/resource_newrelic_one_dashboard.go +++ b/newrelic/resource_newrelic_one_dashboard.go @@ -599,12 +599,12 @@ func dashboardWidgetLineSchemaElem() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "from": { - Type: schema.TypeInt, + Type: schema.TypeFloat, Optional: true, Description: "The number from which the range starts in thresholds.", }, "to": { - Type: schema.TypeInt, + Type: schema.TypeFloat, Optional: true, Description: "The number at which the range ends in thresholds.", }, @@ -697,12 +697,12 @@ func dashboardWidgetTableSchemaElem() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "from": { - Type: schema.TypeInt, + Type: schema.TypeFloat, Optional: true, Description: "The number from which the range starts in thresholds.", }, "to": { - Type: schema.TypeInt, + Type: schema.TypeFloat, Optional: true, Description: "The number at which the range ends in thresholds.", }, diff --git a/newrelic/resource_newrelic_one_dashboard_test.go b/newrelic/resource_newrelic_one_dashboard_test.go index 009c2e14a..528892773 100644 --- a/newrelic/resource_newrelic_one_dashboard_test.go +++ b/newrelic/resource_newrelic_one_dashboard_test.go @@ -726,6 +726,12 @@ func testAccCheckNewRelicOneDashboardConfig_PageFull(pageName string, accountID y_axis_right_zero = false y_axis_right_series = ["A", "B"] } + threshold { + name = "Duration Threshold" + from = 10.8 + to = 30.7 + severity = "critical" + } } widget_markdown { @@ -762,8 +768,8 @@ func testAccCheckNewRelicOneDashboardConfig_PageFull(pageName string, accountID query = "FROM Transaction SELECT average(duration) FACET appName" } threshold { - from = 100 - to = 200 + from = 100.1 + to = 200.2 column_name = "C1" severity = "unavailable" } @@ -961,8 +967,8 @@ func testAccCheckNewRelicOneDashboardConfig_PageFullChanged(pageName string, acc y_axis_left_max = 25 is_label_visible = true threshold { - from = 100 - to = 200 + from = 100.1 + to = 200.2 name = "T1" severity = "warning" } @@ -1004,6 +1010,12 @@ func testAccCheckNewRelicOneDashboardConfig_PageFullChanged(pageName string, acc nrql_query { query = "FROM Transaction SELECT average(duration) FACET appName LIMIT 10" } + threshold { + from = 100.2 + to = 200.4 + column_name = "C1" + severity = "unavailable" + } linked_entity_guids = ["MjUyMDUyOHxWSVp8REFTSEJPQVJEfDE2NDYzMDQ"] } diff --git a/newrelic/structures_newrelic_one_dashboard.go b/newrelic/structures_newrelic_one_dashboard.go index d12ed4981..4b552d4ab 100644 --- a/newrelic/structures_newrelic_one_dashboard.go +++ b/newrelic/structures_newrelic_one_dashboard.go @@ -504,11 +504,11 @@ func expandDashboardLineWidgetConfigurationThresholdInput(d *schema.ResourceData // and assign them to respective attributes of the DashboardLineWidgetThresholdThresholdInput object if v, ok := lineWidgetThresholdInInputSingularInterface["from"]; ok { - t := v.(int) + t := v.(float64) lineWidgetThresholdToBeAdded.From = &t } if v, ok := lineWidgetThresholdInInputSingularInterface["to"]; ok { - t := v.(int) + t := v.(float64) lineWidgetThresholdToBeAdded.To = &t } if v, ok := lineWidgetThresholdInInputSingularInterface["name"]; ok { @@ -559,11 +559,11 @@ func expandDashboardTableWidgetConfigurationThresholdInput(d *schema.ResourceDat // and assign them to respective attributes of the DashboardTableWidgetThresholdInput object if v, ok := tableWidgetThresholdInInputSingularInterface["from"]; ok { - t := v.(int) + t := v.(float64) tableWidgetThresholdToBeAdded.From = &t } if v, ok := tableWidgetThresholdInInputSingularInterface["to"]; ok { - t := v.(int) + t := v.(float64) tableWidgetThresholdToBeAdded.To = &t } if v, ok := tableWidgetThresholdInInputSingularInterface["column_name"]; ok {