diff --git a/examples/resources/routeros_tool_netwatch/resource.tf b/examples/resources/routeros_tool_netwatch/resource.tf index 9f18a74d..ed36d210 100644 --- a/examples/resources/routeros_tool_netwatch/resource.tf +++ b/examples/resources/routeros_tool_netwatch/resource.tf @@ -1,6 +1,8 @@ resource "routeros_tool_netwatch" "test" { name = "watch-google-pdns" + type = "icmp" host = "8.8.8.8" interval = "30s" up_script = ":log info \"Ping to 8.8.8.8 successful\"" + thr_max = "400ms" } diff --git a/routeros/resource_tool_netwatch.go b/routeros/resource_tool_netwatch.go index 46d31380..ac3cca85 100644 --- a/routeros/resource_tool_netwatch.go +++ b/routeros/resource_tool_netwatch.go @@ -25,6 +25,19 @@ func ResourceToolNetwatch() *schema.Resource { resSchema := map[string]*schema.Schema{ MetaResourcePath: PropResourcePath("/tool/netwatch"), MetaId: PropId(Id), + MetaSkipFields: PropSkipFields( + // Generic + "since", "status", "done_tests", "failed_tests", + // ICMP + "sent_count", "response_count", "loss_count", "loss_percent", "rtt_avg", "rtt_min", "rtt_max", "rtt_jitter", + "rtt_stdev", + // TCP + "tcp_connect_time", + // HTTP, HTTPS + "http_status_code", + // DNS + "ip", "ip6", "mail_servers", "name_servers", + ), KeyComment: PropCommentRw, KeyDisabled: PropDisabledRw, @@ -135,25 +148,25 @@ func ResourceToolNetwatch() *schema.Resource { Description: "Fail threshold for loss-percent.", DiffSuppressFunc: AlwaysPresentNotUserProvided, }, - "thr_rtt_avg": { + "thr_avg": { Type: schema.TypeString, Optional: true, Description: "Fail threshold for rtt-avg.", DiffSuppressFunc: TimeEquall, }, - "thr_rtt_jitter": { + "thr_jitter": { Type: schema.TypeString, Optional: true, Description: "Fail threshold for rtt-jitter.", DiffSuppressFunc: TimeEquall, }, - "thr_rtt_max": { + "thr_max": { Type: schema.TypeString, Optional: true, Description: "Fail threshold for rtt-max (a value above thr-max is a probe fail).", DiffSuppressFunc: TimeEquall, }, - "thr_rtt_stdev": { + "thr_stdev": { Type: schema.TypeString, Optional: true, Description: "Fail threshold for rtt-stdev.", diff --git a/routeros/resource_tool_netwatch_test.go b/routeros/resource_tool_netwatch_test.go index aa9a4971..be77bc1d 100644 --- a/routeros/resource_tool_netwatch_test.go +++ b/routeros/resource_tool_netwatch_test.go @@ -51,9 +51,11 @@ func testAccToolNetwatchConfig() string { return fmt.Sprintf(`%v resource "routeros_tool_netwatch" "test" { name = "watch-google-pdns" + type = "icmp" host = "8.8.8.8" interval = "30s" up_script = ":log info \"Ping to 8.8.8.8 successful\"" + thr_max = "400ms" } `, providerConfig) }