From 32b1e9079e2927a66c73921e26360d8a13a4e4f8 Mon Sep 17 00:00:00 2001 From: vikashkuma Date: Sat, 18 Nov 2023 13:57:33 +0530 Subject: [PATCH] example added --- catchpoint/catchpoint_client.go | 4 +- catchpoint/flatten_all_test_type.go | 2 +- catchpoint/helper.go | 64 ++-- catchpoint/test_section_setter.go | 4 +- catchpoint/test_structure.go | 2 +- docs/commonUtility.md | 312 ++++++++++++++++++ docs/examples/Create test/api_test.tf | 29 ++ docs/examples/Create test/bgp_test.tf | 25 ++ docs/examples/Create test/dns_test.tf | 23 ++ docs/examples/Create test/ping_test.tf | 26 ++ docs/examples/Create test/traceroute_test.tf | 28 ++ docs/examples/Create test/transaction_test.tf | 22 ++ docs/examples/Create test/web_test.tf | 85 +++++ docs/examples/import test/api_test.tf | 20 ++ docs/examples/import test/bgp_test.tf | 20 ++ docs/examples/import test/dns_test.tf | 20 ++ docs/examples/import test/ping_test.tf | 20 ++ docs/examples/import test/traceroute_test.tf | 20 ++ docs/examples/import test/transaction_test.tf | 20 ++ docs/examples/import test/web_test.tf | 21 ++ docs/resources/web_test.md | 226 ------------- 21 files changed, 729 insertions(+), 264 deletions(-) create mode 100644 docs/commonUtility.md create mode 100644 docs/examples/Create test/api_test.tf create mode 100644 docs/examples/Create test/bgp_test.tf create mode 100644 docs/examples/Create test/dns_test.tf create mode 100644 docs/examples/Create test/ping_test.tf create mode 100644 docs/examples/Create test/traceroute_test.tf create mode 100644 docs/examples/Create test/transaction_test.tf create mode 100644 docs/examples/Create test/web_test.tf create mode 100644 docs/examples/import test/api_test.tf create mode 100644 docs/examples/import test/bgp_test.tf create mode 100644 docs/examples/import test/dns_test.tf create mode 100644 docs/examples/import test/ping_test.tf create mode 100644 docs/examples/import test/traceroute_test.tf create mode 100644 docs/examples/import test/transaction_test.tf create mode 100644 docs/examples/import test/web_test.tf diff --git a/catchpoint/catchpoint_client.go b/catchpoint/catchpoint_client.go index 2f3f85a..883c631 100644 --- a/catchpoint/catchpoint_client.go +++ b/catchpoint/catchpoint_client.go @@ -35,7 +35,7 @@ type Thresholds struct { type AuthenticationStruct struct { AuthenticationMethodType GenericIdNameOmitEmpty `json:"authenticationMethodType,omitempty"` PasswordStatus GenericIdNameOmitEmpty `json:"passwordStatus,omitempty"` - UserName string `json:"userName,omitempty"` + Username string `json:"userName,omitempty"` Password string `json:"password,omitempty"` PasswordIds []int `json:"passwordIds,omitempty"` //Id int `json:"id,omitempty"` @@ -547,7 +547,7 @@ func setTestRequestSettings(config *TestConfig) RequestSetting { authenticationMethodType := GenericIdNameOmitEmpty{Id: config.AuthenticationType.Id, Name: config.AuthenticationType.Name} passwordStatus := GenericIdNameOmitEmpty{Id: 1, Name: "Set"} passwordIds := config.AuthenticationPasswordIds - authentication = AuthenticationStruct{AuthenticationMethodType: authenticationMethodType, PasswordStatus: passwordStatus, UserName: config.UserName, Password: config.Password, PasswordIds: passwordIds} + authentication = AuthenticationStruct{AuthenticationMethodType: authenticationMethodType, PasswordStatus: passwordStatus, Username: config.Username, Password: config.Password, PasswordIds: passwordIds} } requestSetting := RequestSetting{RequestSettingType: requestSettingType, HttpHeaderRequests: httpHeaderRequests, TokenIds: config.AuthenticationTokenIds, LibraryCertificateIds: config.AuthenticationCertificateIds} diff --git a/catchpoint/flatten_all_test_type.go b/catchpoint/flatten_all_test_type.go index 53a379d..aed7153 100644 --- a/catchpoint/flatten_all_test_type.go +++ b/catchpoint/flatten_all_test_type.go @@ -57,7 +57,7 @@ func flattenAuthenticationStruct(authentication *AuthenticationStruct) []interfa if authentication != nil { authMap := map[string]interface{}{ "authentication_type": strings.ToLower(authentication.AuthenticationMethodType.Name), - "userName": authentication.UserName, + "username": authentication.Username, "password": authentication.Password, "password_ids": authentication.PasswordIds, } diff --git a/catchpoint/helper.go b/catchpoint/helper.go index 5752f95..f113ef0 100644 --- a/catchpoint/helper.go +++ b/catchpoint/helper.go @@ -372,22 +372,22 @@ func getDnsQueryName(queryType int) string { func getFrequencyId(frequency string) (int, string) { frequencies := map[int]string{ 0: "none", - 1: "1 Minute", - 2: "5 Minutes", - 3: "10 Minutes", - 4: "15 Minutes", - 5: "20 Minutes", - 6: "30 Minutes", - 7: "60 Minutes", - 8: "2 Hours", - 9: "3 Hours", - 10: "4 Hours", - 11: "6 Hours", - 12: "8 Hours", - 13: "12 Hours", - 14: "24 Hours", - 15: "4 Minutes", - 16: "2 Minutes", + 1: "1 minute", + 2: "5 minutes", + 3: "10 minutes", + 4: "15 minutes", + 5: "20 minutes", + 6: "30 minutes", + 7: "60 minutes", + 8: "2 hours", + 9: "3 hours", + 10: "4 hours", + 11: "6 hours", + 12: "8 hours", + 13: "12 hours", + 14: "24 hours", + 15: "4 minutes", + 16: "2 minutes", } for id, freq := range frequencies { if freq == frequency { @@ -400,22 +400,22 @@ func getFrequencyId(frequency string) (int, string) { func getFrequencyName(frequency int) string { frequencies := map[int]string{ 0: "none", - 1: "1 Minute", - 2: "5 Minutes", - 3: "10 Minutes", - 4: "15 Minutes", - 5: "20 Minutes", - 6: "30 Minutes", - 7: "60 Minutes", - 8: "2 Hours", - 9: "3 Hours", - 10: "4 Hours", - 11: "6 Hours", - 12: "8 Hours", - 13: "12 Hours", - 14: "24 Hours", - 15: "4 Minutes", - 16: "2 Minutes", + 1: "1 minute", + 2: "5 minutes", + 3: "10 minutes", + 4: "15 minutes", + 5: "20 minutes", + 6: "30 minutes", + 7: "60 minutes", + 8: "2 hours", + 9: "3 hours", + 10: "4 hours", + 11: "6 hours", + 12: "8 hours", + 13: "12 hours", + 14: "24 hours", + 15: "4 minutes", + 16: "2 minutes", } for id, freq := range frequencies { if id == frequency { diff --git a/catchpoint/test_section_setter.go b/catchpoint/test_section_setter.go index 443ad2d..a3fc64e 100644 --- a/catchpoint/test_section_setter.go +++ b/catchpoint/test_section_setter.go @@ -108,11 +108,11 @@ func setRequestSettings(testTypeId int, request_setting map[string]interface{}, if authentication_type_id == -1 { return errors.New("invalid authentication_type provided. valid types are 'basic','ntlm','digest','login'") } - userName := authentication["userName"].(string) + username := authentication["username"].(string) password := authentication["password"].(string) testConfig.AuthenticationType.Id = authentication_type_id testConfig.AuthenticationType.Name = authentication_type_name - testConfig.UserName = userName + testConfig.Username = username testConfig.Password = password tfpassword_ids := authentication["password_ids"].([]interface{}) diff --git a/catchpoint/test_structure.go b/catchpoint/test_structure.go index 3006114..d66de39 100644 --- a/catchpoint/test_structure.go +++ b/catchpoint/test_structure.go @@ -36,7 +36,7 @@ type TestConfig struct { TestStatus int RequestSettingType int AuthenticationType IdName - UserName string + Username string Password string AuthenticationPasswordIds []int AuthenticationTokenIds []int diff --git a/docs/commonUtility.md b/docs/commonUtility.md new file mode 100644 index 0000000..d4dc200 --- /dev/null +++ b/docs/commonUtility.md @@ -0,0 +1,312 @@ +## some property names which will be used + +### AlertTypeName + + 2: "byte length", + 3: "content match", + 4: "host failure", + 9: "test failure", + 7: "timing", + 12: "ping", + 13: "requests", + 15: "availability", + 20: "path", + 23: "asn" + +### AlertSubTypeName + 1: "byte length", + 2: "page", + 3: "file size", + 10: "regular expression", + 14: "response code", + 15: "response headers", + 50: "dns", + 51: "connect", + 52: "send", + 53: "wait", + 54: "load", + 55: "ttfb", + 57: "content load", + 58: "response", + 59: "test time", + 61: "dom load", + 63: "test time with suspect", + 64: "server response", + 66: "document complete", + 67: "redirect", + 100: "ping rtt", + 101: "ping packet loss", + 110: "# requests", + 111: "# hosts", + 112: "# connections", + 113: "# redirects", + 114: "# other", + 115: "# images", + 116: "# scripts", + 117: "# html", + 118: "# css", + 119: "# xml", + 120: "# flash", + 121: "# media", + 140: "test", + 141: "content", + 142: "% downtime", + 190: "# cities", + 191: "# asns", + 193: "# countries", + 194: "# hops", + 195: "handshake_time", + 196: "days_to_expiration", + 210: "origin as", + 211: "path as", + 212: "origin neighbor", + 213: "prefix mismatch", + +### TestFlagName + + 2: "verify_test_on_failure", + 3: "debug_primary_host_on_failure", + 4: "enable_http2", + 8: "debug_referenced_hosts_on_failure", + 9: "capture_http_headers", + 11: "capture_response_content", + 13: "capture_filmstrip", + 14: "capture_screenshot", + 17: "ignore_ssl_failures", + 19: "enable_bind_hostname", + 20: "enable_tcp_protocol", + 21: "enable_nsid", + 22: "disable_recursive_resolution", + 23: "host_data_collection_enabled", + 24: "zone_data_collection_enabled", + 25: "stop_test_on_document_complete", + 26: "try_next_nameserver_on_failure", + 27: "40x_or_50x_http_mark_successful", + 31: "favor_fastest_round_trip_nameserver", + 33: "30x_redirects_do_not_follow", + 36: "enable_self_versus_third_party_zones", + 37: "allow_test_download_limit_override", + 38: "disable_cross_origin_iframe_access", + 39: "stop_test_on_dom_content_load", + 42: "certificate_revocation_disabled", + 48: "enable_dnssec", + 50: "enable_path_mtu_discovery", + +### AdditionalMonitorTypeName + + 8: "ping icmp", + 11: "ping tcp", + 23: "ping udp", + 9: "traceroute icmp", + 14: "traceroute udp", + 29: "traceroute tcp", + +### BandwidthThrottlingTypeName + 1: "gprs", + 2: "regular 2g", + 3: "good 2g", + 4: "regular 3g", + 5: "good 3g", + 6: "regular 4g", + 7: "dsl", + 8: "wifi", + +### ReqHeaderTypeName + 1: "user_agent", + 2: "accept", + 3: "accept_encoding", + 4: "accept_language", + 5: "accept_charset", + 6: "cookie", + 7: "cache_control", + 9: "pragma", + 10: "referer", + 12: "host", + 13: "request_override", + 14: "dns_override", + 15: "request_block", + 16: "request_delay", + +### HistoricalIntervalName + 5: "5 minutes", + 10: "10 minutes", + 15: "15 minutes", + 30: "30 minutes", + 60: "1 hour", + 120: "2 hours", + 360: "6 hours", + 720: "12 hours", + 1440: "1 day", + 10080: "1 week", + +### ThresholdIntervalName + 0: "default", + 5: "5 minutes", + 10: "10 minutes", + 15: "15 minutes", + 30: "30 minutes", + 60: "1 hour", + 120: "2 hours", + 360: "6 hours", + 720: "12 hours", + +### ReminderName + + 0: "none", + 1: "1 minute", + 5: "5 minutes", + 10: "10 minutes", + 15: "15 minutes", + 30: "30 minutes", + 60: "1 hour", + 1440: "daily", + +### TriggerTypeName + 1: "specific value", + 2: "trailing value", + 3: "trendshift", + +### OperationTypeName + 0: "not equals", + 1: "equals", + 2: "greater than", + 3: "greater than or equals", + 4: "less than", + 5: "less than or equals", + +### NodeThresholdTypeName + 0: "runs", + 1: "average across nodes", + 2: "node", + +### NodeDistributionName + 0: "random", + 1: "concurrent", + +### FrequencyName + 0: "none", + 1: "1 minute", + 2: "5 minutes", + 3: "10 minutes", + 4: "15 minutes", + 5: "20 minutes", + 6: "30 minutes", + 7: "60 minutes", + 8: "2 hours", + 9: "3 hours", + 10: "4 hours", + 11: "6 hours", + 12: "8 hours", + 13: "12 hours", + 14: "24 hours", + 15: "4 minutes", + 16: "2 minutes", + +### DnsQueryName + 0: "none", + 1: "a", + 2: "ns", + 5: "cname", + 6: "soa", + 7: "mb", + 8: "mg", + 9: "mr", + 10: "null", + 11: "wks", + 12: "ptr", + 13: "hinfo", + 14: "minfo", + 15: "mx", + 16: "txt", + 17: "rp", + 18: "afsdb", + 19: "x25", + 20: "isdn", + 21: "rt", + 22: "nsap", + 24: "sig", + 25: "key", + 26: "px", + 28: "aaaa", + 29: "loc", + 31: "eid", + 32: "nimloc", + 33: "srv", + 34: "atma", + 35: "naptr", + 36: "kx", + 37: "cert", + 38: "a6", + 39: "dname", + 40: "sink", + 41: "opt", + 42: "apl", + 43: "ds", + 44: "sshfp", + 45: "ipseckey", + 46: "rrsig", + 47: "nsec", + 48: "dnskey", + 49: "dhcid", + 50: "nsec3", + 51: "nsec3param", + 55: "hip", + 99: "spf", + 100: "uinfo", + 101: "uid", + 102: "gid", + 103: "unspec", + 249: "tkey", + 250: "tsig", + 251: "ixfr", + 252: "axfr", + 253: "mailb", + 255: "any", + 32768: "ta", + 32769: "dlv", + +### UserAgentTypeName + + 3: "android", + 4: "iphone", + 5: "ipad 2", + 6: "kindle fire", + 7: "galaxy tab", + 8: "iphone 5", + 9: "ipad mini", + 10: "galaxy note", + 11: "nexus 7", + 12: "nexus 4", + 13: "nokia lumia920", + 14: "iphone 6", + 15: "blackberry z30", + 16: "galaxy s4", + 17: "htc onex", + 18: "lg optimusg", + 19: "droid razr hd", + 20: "nexus 6", + 21: "iphone 6s", + 22: "galaxy s6", + 23: "iphone 7", + 24: "google pixel", + 25: "galaxy s8", + +### MonitorName + 2: "object", + 3: "emulated", + 18: "chrome", + 19: "playback", + 20: "mobile playback", + 26: "mobile", + 25: "api", + 8: "ping icmp", + 11: "ping tcp", + 12: "dns experience", + 13: "dns direct", + 23: "ping udp", + 9: "traceroute icmp", + 14: "traceroute udp", + 29: "traceroute tcp", + 31: "ssl", + 34: "bgp", + 41: "bgp basic", \ No newline at end of file diff --git a/docs/examples/Create test/api_test.tf b/docs/examples/Create test/api_test.tf new file mode 100644 index 0000000..6fc9ad1 --- /dev/null +++ b/docs/examples/Create test/api_test.tf @@ -0,0 +1,29 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.1" + } + } +} + + + +provider "catchpoint" { +api_token="5618ABF44CA1117B42XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + + + + + +resource "api_test" "test55" { +test_name = "APItest_TF" +provider=catchpoint +division_id=2633 +product_id=23791 +test_script="// Step - 1\r\nopen(\"\\\"https:www.google.com)\")" +test_script_type="selenium" +end_time="2023-10-30T04:59:00Z" + +} \ No newline at end of file diff --git a/docs/examples/Create test/bgp_test.tf b/docs/examples/Create test/bgp_test.tf new file mode 100644 index 0000000..da1ce30 --- /dev/null +++ b/docs/examples/Create test/bgp_test.tf @@ -0,0 +1,25 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.1" + } + } +} + + + +provider "catchpoint" { + api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + + + +resource "bgp_test" "test" { + test_name = "BGP test created from Terraform" + provider=catchpoint + division_id=2633 + product_id=23791 + prefix="101.188.67.134/8" + end_time="2023-09-30T04:59:00Z" +} \ No newline at end of file diff --git a/docs/examples/Create test/dns_test.tf b/docs/examples/Create test/dns_test.tf new file mode 100644 index 0000000..b3625ae --- /dev/null +++ b/docs/examples/Create test/dns_test.tf @@ -0,0 +1,23 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.5" + } + } +} + +provider "catchpoint" { + api_token="5618ABF44CA1117B4286CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "dns_test" "testDNS" { + test_name = "Terraform DNS Test 0.2.5" + provider=catchpoint + division_id=2633 + product_id=23791 + monitor="dns direct" + query_type="a" + test_domain ="https:www.google.com" + end_time="2023-11-30T04:59:00Z" +} \ No newline at end of file diff --git a/docs/examples/Create test/ping_test.tf b/docs/examples/Create test/ping_test.tf new file mode 100644 index 0000000..8ff94a1 --- /dev/null +++ b/docs/examples/Create test/ping_test.tf @@ -0,0 +1,26 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.1" + } + } +} + + + +provider "catchpoint" { +api_token="5618ABF44CA1117B428XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "ping_test" "test5501" { +test_name = "Ping_TF3" +provider=catchpoint +division_id=2633 +product_id=23791 +test_location="https:www.google.com" +monitor ="ping tcp" +status="active" +end_time="2023-10-30T04:59:00Z" + +} \ No newline at end of file diff --git a/docs/examples/Create test/traceroute_test.tf b/docs/examples/Create test/traceroute_test.tf new file mode 100644 index 0000000..1518039 --- /dev/null +++ b/docs/examples/Create test/traceroute_test.tf @@ -0,0 +1,28 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.1" + } + } +} + + + +provider "catchpoint" { +api_token="5618ABF44CA1117B42XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + + + + + +resource "traceroute_test" "testTraceroute" { + test_name = "Tracetest_TF" + provider=catchpoint + division_id=2633 + product_id=23791 + monitor="traceroute icmp" + test_location="https://www.google.com" + end_time="2023-10-30T04:59:00Z" +} \ No newline at end of file diff --git a/docs/examples/Create test/transaction_test.tf b/docs/examples/Create test/transaction_test.tf new file mode 100644 index 0000000..fabd1b2 --- /dev/null +++ b/docs/examples/Create test/transaction_test.tf @@ -0,0 +1,22 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.1" + } + } +} + +provider "catchpoint" { + api_token="5618ABF44CA1117B4286C9572D00B47AD166125E4F88A6DE472AF29562C50595" +} + +resource "transaction_test" "testTransaction" { + test_name = "Transaction_TF" + provider=catchpoint + division_id=2633 + product_id=23791 + monitor="chrome" + test_script="//Step-1\r\nopen(\"https:www.google.com)" + end_time="2023-10-30T04:59:00Z" +} \ No newline at end of file diff --git a/docs/examples/Create test/web_test.tf b/docs/examples/Create test/web_test.tf new file mode 100644 index 0000000..1d2b50c --- /dev/null +++ b/docs/examples/Create test/web_test.tf @@ -0,0 +1,85 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.6" + } + } +} + +provider "catchpoint" { + api_token="ABAA8C66AE593EDCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + + +resource "web_test" "test" { + test_name = "Web_test1 from terraform " + monitor="object" + provider=catchpoint + division_id=2923 + product_id=28335 + test_description="An object test for catchpoint.com" + test_url="https://www.catchpoint.com" + alerts_paused=false + enable_test_data_webhook=true + end_time="2023-12-30T04:59:00Z" + + label { + key="label1" + values=["v1","v2"] + } + + advanced_settings { + verify_test_on_failure = false + additional_monitor="ping icmp" + } + + alert_settings { + alert_rule { + alert_type="timing" + alert_sub_type="response" + node_threshold_type="node" + threshold_number_of_runs=5 + threshold_interval="30 minutes" + trigger_type="specific value" + warning_trigger=50 + critical_trigger=70.0 + operation_type = "less than or equals" + use_rolling_window=true + } + alert_rule { + alert_type="availability" + alert_sub_type="test" + node_threshold_type="average across nodes" + threshold_number_of_runs=3 + trigger_type="trailing value" + warning_trigger=50 + critical_trigger=80 + historical_interval="15 minutes" + operation_type = "greater than" + } + alert_rule { + alert_type="test failure" + node_threshold_type="runs" + threshold_number_of_runs=2 + threshold_percentage_of_runs=60 + } + alert_rule { + alert_type="host failure" + node_threshold_type="runs" + threshold_number_of_runs=5 + threshold_percentage_of_runs=90 + } + alert_rule { + alert_type="content match" + alert_sub_type="response headers" + node_threshold_type="runs" + operation_type = "not equals" + expression="something" + threshold_number_of_runs=5 + } + notification_group { + recipient_email_ids=["vikash@catchpoint.com"] + } + } +} diff --git a/docs/examples/import test/api_test.tf b/docs/examples/import test/api_test.tf new file mode 100644 index 0000000..d9db95a --- /dev/null +++ b/docs/examples/import test/api_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "api_test" "apiTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import api_test.apiTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/bgp_test.tf b/docs/examples/import test/bgp_test.tf new file mode 100644 index 0000000..7c9db27 --- /dev/null +++ b/docs/examples/import test/bgp_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "bgp_test" "bgpTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import bgp_test.bgpTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/dns_test.tf b/docs/examples/import test/dns_test.tf new file mode 100644 index 0000000..cc3fd83 --- /dev/null +++ b/docs/examples/import test/dns_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "dns_test" "dnsTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import dns_test.dnsTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/ping_test.tf b/docs/examples/import test/ping_test.tf new file mode 100644 index 0000000..a5cf06c --- /dev/null +++ b/docs/examples/import test/ping_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "ping_test" "pingTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import ping_test.pingTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/traceroute_test.tf b/docs/examples/import test/traceroute_test.tf new file mode 100644 index 0000000..06c4767 --- /dev/null +++ b/docs/examples/import test/traceroute_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "traceroute_test" "tracerouteTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import traceroute_test.tracerouteTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/transaction_test.tf b/docs/examples/import test/transaction_test.tf new file mode 100644 index 0000000..0264d4a --- /dev/null +++ b/docs/examples/import test/transaction_test.tf @@ -0,0 +1,20 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CA1117B4286C9572XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "transaction_test" "transactionTest" { + provider=catchpoint + id="2340152" +} + +# ========================================================= +# Command to run the importing test details: +# terraform import transaction_test.transactionTest 2340152 \ No newline at end of file diff --git a/docs/examples/import test/web_test.tf b/docs/examples/import test/web_test.tf new file mode 100644 index 0000000..f40ca3e --- /dev/null +++ b/docs/examples/import test/web_test.tf @@ -0,0 +1,21 @@ +terraform { + required_providers { + catchpoint = { + source = "catchpoint/catchpoint" + version = "0.2.7" + } + } +} +provider "catchpoint" { +api_token="5618ABF44CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} + +resource "web_test" "webTest" { + provider=catchpoint + id="2340171" +} + + +# ========================================================= +# Command to run the importing test details: +# terraform import web_test.webTest 2340171 \ No newline at end of file diff --git a/docs/resources/web_test.md b/docs/resources/web_test.md index bc1d66f..ec14c4f 100644 --- a/docs/resources/web_test.md +++ b/docs/resources/web_test.md @@ -35,8 +35,6 @@ description: |- - `gateway_address_or_host` (String) Host/IP to use for network troubleshooting and monitoring - `insights` (Block Set, Max: 1) Optional. Used for overriding the insights section (see [below for nested schema](#nestedblock--insights)) - `label` (Block Set) Optional. Label with key, values pair (see [below for nested schema](#nestedblock--label)) -- `request_settings` (Block Set, Max: 1) Optional. Used for overriding authentication and HTTP request headers (see [below for nested schema](#nestedblock--request_settings)) -- `schedule_settings` (Block Set, Max: 1) Optional. Used for overriding the schedule section (see [below for nested schema](#nestedblock--schedule_settings)) - `simulate` (String) The device to simulate for mobile, mobile playback(playback source) monitors - `start_time` (String) Optional. Start time for the Test in ISO format - `status` (String) Optional. Test status: active or inactive @@ -149,230 +147,6 @@ Required: - `values` (List of String) - -### Nested Schema for `request_settings` - -Optional: - -- `authentication` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--request_settings--authentication)) -- `http_request_headers` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--request_settings--http_request_headers)) -- `library_certificate_ids` (List of Number, Sensitive) Optional. Library certificate ids in a list -- `token_ids` (List of Number, Sensitive) Optional. Token ids in a list - - -### Nested Schema for `request_settings.authentication` - -Required: - -- `authentication_type` (String) Type of authentication to use 'basic', 'ntlm', 'digest', 'login' - -Optional: - -- `password` (String, Sensitive) -- `password_ids` (List of Number, Sensitive) Optional. Password ids in a list -- `username` (String) - - - -### Nested Schema for `request_settings.http_request_headers` - -Optional: - -- `accept` (Block Set, Max: 1) Optional. Sets the accept header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--accept)) -- `accept_charset` (Block Set, Max: 1) Optional. Sets the accept charset header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--accept_charset)) -- `accept_encoding` (Block Set, Max: 1) Optional. Sets the user accept encoding header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--accept_encoding)) -- `accept_language` (Block Set, Max: 1) Optional. Sets the accept language header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--accept_language)) -- `cache_control` (Block Set, Max: 1) Optional. Sets the cache control header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--cache_control)) -- `cookie` (Block Set, Max: 1) Optional. Sets the cookie header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--cookie)) -- `dns_override` (Block Set, Max: 1) Optional. Sets the dns override header for the given child_host_pattern (see [below for nested schema](#nestedblock--request_settings--http_request_headers--dns_override)) -- `host` (Block Set, Max: 1) Optional. Sets the host header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--host)) -- `pragma` (Block Set, Max: 1) Optional. Sets the pragma header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--pragma)) -- `referer` (Block Set, Max: 1) Optional. Sets the referer header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--referer)) -- `request_block` (Block Set, Max: 1) Optional. Sets the request block header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--request_block)) -- `request_delay` (Block Set, Max: 1) Optional. Sets the request delay header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--request_delay)) -- `request_override` (Block Set, Max: 1) Optional. Sets the request override header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--request_override)) -- `user_agent` (Block Set, Max: 1) Optional. Sets the user agent header for test url if child_host_pattern attribute is omitted (see [below for nested schema](#nestedblock--request_settings--http_request_headers--user_agent)) - - -### Nested Schema for `request_settings.http_request_headers.accept` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.accept_charset` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.accept_encoding` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.accept_language` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.cache_control` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.cookie` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.dns_override` - -Required: - -- `child_host_pattern` (String) -- `value` (String) - - - -### Nested Schema for `request_settings.http_request_headers.host` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.pragma` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.referer` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.request_block` - -Optional: - -- `child_host_pattern` (String) -- `value` (String) - - - -### Nested Schema for `request_settings.http_request_headers.request_delay` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.request_override` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - -### Nested Schema for `request_settings.http_request_headers.user_agent` - -Required: - -- `value` (String) - -Optional: - -- `child_host_pattern` (String) - - - - - -### Nested Schema for `schedule_settings` - -Required: - -- `frequency` (String) Sets the scheduling frequency: '1 minute', '5 minutes', '10 minutes', '15 minutes', '20 minutes', '30 minutes', '60 minutes', '2 hours', '3 hours', '4 hours', '6 hours', '8 hours', '12 hours', '24 hours', '4 minutes', '2 minutes' -- `node_distribution` (String) Node distribution type: 'random' or 'concurrent' - -Optional: - -- `maintenance_schedule_id` (Number) The maintenance schedule id to utilize for the test -- `node_group_ids` (List of Number) Optional if node_ids is used. Node group ids in a list -- `node_ids` (List of Number) Optional if node_group_ids is used. Node ids in a list -- `run_schedule_id` (Number) The run schedule id to utilize for the test - - ### Nested Schema for `thresholds`