From 36cb95721f060a1fb0ec76f8ced1018e49fede24 Mon Sep 17 00:00:00 2001 From: sujithra Date: Thu, 23 Nov 2023 14:43:22 +0530 Subject: [PATCH] After pullrequest changes --- docs/resources/domain_expiry_monitor.md | 65 +++++++++++++++++++++++-- examples/domain_expiry_monitor_us.tf | 35 +++++++++++-- main.tf | 5 ++ site24x7/monitors/domain_expiry.go | 1 + 4 files changed, 99 insertions(+), 7 deletions(-) diff --git a/docs/resources/domain_expiry_monitor.md b/docs/resources/domain_expiry_monitor.md index d78544c..3df222e 100644 --- a/docs/resources/domain_expiry_monitor.md +++ b/docs/resources/domain_expiry_monitor.md @@ -16,9 +16,69 @@ Use this resource to create, update and delete a Domain-Expiry monitor in Site24 // Site24x7 Domain-Expiry Monitor API doc - https://www.site24x7.com/help/api/#domain-expiry resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_example" { + // (Required) Display name for the monitor display_name = "Domain Expiry Monitor" + //(Required)Host name of the monitor + host_name="www.example.com" + + //(Optional) Domain name to be given to the monitor + domain_name="www.example.com" + + //(Optional)Whois Server Port.Default value is 43 + port=443 + + //Select IPv6 for monitoring the websites hosted with IPv6 address. If + //you choose non IPv6 supported locations, monitoring will happen through + //IPv4. + use_ipv6=true + + //(Optional)Timeout for connecting to the host.Range 1 - 45. + timeout=10 + + //(Optional) Day threshold for domain expiry notification.Range 1 - 999. + expire_days=30 + + //(Optional)Toggle button to perform automation or not + perform_automation=true + + //(Optional)if user_group_ids is not choosen + //On-Call Schedule of your choice. + //Create new On-Call Schedule or find your preferred On-Call Schedule ID. + on_call_schedule_id="456418000001258016" + + //(Optional)Ignores the registry expiry date and prefer registrar expiry + //date when notifying for domain expiry. + ignore_registry_date=true + + // (Optional) Check for the keyword in the response. + matching_keyword = { + severity= 2 + value= "sample" + } + + // (Optional) Check for non existence of keyword in the response. + unmatching_keyword = { + severity= 2 + value= "smile" + } + + // (Optional) Match the regular expression in the response. + match_regex = { + severity= 2 + value= ".*aaa.*" + } + + //(Optional)Perform case sensitive keyword search or not. + match_case = false + + // (Optional) Map of status to actions that should be performed on monitor + // status changes. See + // https://www.site24x7.com/help/api/#action-rule-constants for all available + // status values. + actions = {1=465545643755} + // (Optional) Notification profile to be associated with the monitor. If // omitted, the first profile returned by the /api/notification_profiles // endpoint (https://www.site24x7.com/help/api/#list-notification-profiles) @@ -43,7 +103,8 @@ resource "site24x7_domain_expiry_monitor" // (Optional) List if user group IDs to be notified on down. // Either specify user_group_ids or user_group_names. If omitted, the // first user group returned by the /api/user_groups endpoint - // (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used. + // (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be + //used. user_group_ids = [ "123", ] @@ -75,8 +136,6 @@ resource "site24x7_domain_expiry_monitor" "4567" ] - // (Optional) Mandatory, if the user group ID is not given. On-Call Schedule ID of your choice. - on_call_schedule_id = "3455" } ## Attributes Reference diff --git a/examples/domain_expiry_monitor_us.tf b/examples/domain_expiry_monitor_us.tf index d12ba95..260beb8 100644 --- a/examples/domain_expiry_monitor_us.tf +++ b/examples/domain_expiry_monitor_us.tf @@ -49,7 +49,7 @@ provider "site24x7" { } // Site24x7 Domain Expiry monitor API doc - https://www.site24x7.com/help/api/#domain-expiry -resource "site24x7_ssl_monitor" "doamin_expiry_monitor_basic" { +resource "site24x7_domain_expiry_monitor" "doamin_expiry_monitor_basic" { // (Required) Display name for the monitor display_name = "Example domain expiry Monitor" @@ -69,6 +69,30 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" { //Domain name for the monitor domain_name = "www.example.com" + //(Optional)Whois Server Port.Default value is 43 + port=443 + + //Should we prefer to use IPV6 or not + use_ipv6=true + + //(Optional)Timeout for connecting to the host.Range 1 - 45. + timeout=10 + + //(Optional) Day threshold for domain expiry notification.Range 1 - 999. + expire_days=30 + + //(Optional)Toggle button to perform automation or not + perform_automation=true + + //(Optional)if user_group_ids is not choosen + //On-Call Schedule of your choice. + //Create new On-Call Schedule or find your preferred On-Call Schedule ID. + on_call_schedule_id="456418000001258016" + + //(Optional)Ignores the registry expiry date and prefer registrar expiry + //date when notifying for domain expiry. + ignore_registry_date=true + // (Optional) Location Profile to be associated with the monitor. If // location_profile_id and location_profile_name are omitted, // the first profile returned by the /api/location_profiles endpoint @@ -84,19 +108,19 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" { // used. location_profile_name = "North America" -// (Optional) Check for the keyword in the website response. +// (Optional) Check for the keyword in the response. matching_keyword = { severity= 2 value= "sample" } - // (Optional) Check for non existence of keyword in the website response. + // (Optional) Check for non existence of keyword in the response. unmatching_keyword = { severity= 2 value= "smile" } - // (Optional) Match the regular expression in the website response. + // (Optional) Match the regular expression in the response. match_regex = { severity= 2 value= ".*aaa.*" @@ -107,6 +131,9 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" { // status values. actions = {1=465545643755} + //(Optional)Perform case sensitive keyword search or not. + match_case = false + // (Optional) Notification profile to be associated with the monitor. If // omitted, the first profile returned by the /api/notification_profiles // endpoint (https://www.site24x7.com/help/api/#list-notification-profiles) diff --git a/main.tf b/main.tf index 5771f53..3748c26 100644 --- a/main.tf +++ b/main.tf @@ -106,3 +106,8 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_basic" { } +// DomainExpiry Server API doc: https://www.site24x7.com/help/api/#domain-expiry +resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_basic" { + // (Required) Display name for the monitor + display_name = "ignore registry 2" + host_name = "file.com" \ No newline at end of file diff --git a/site24x7/monitors/domain_expiry.go b/site24x7/monitors/domain_expiry.go index 14f32e4..4d47b98 100644 --- a/site24x7/monitors/domain_expiry.go +++ b/site24x7/monitors/domain_expiry.go @@ -31,6 +31,7 @@ var DomainExpiryMonitorSchema = map[string]*schema.Schema{ "domain_name": { Type: schema.TypeString, Optional: true, + Default: "whios.iana.org", Description: "Specify the name of the Whois server from where you wish to query the domain data.", }, "port": {