Skip to content

Commit

Permalink
Added automatic_retries to all /test api responses
Browse files Browse the repository at this point in the history
  • Loading branch information
kparvin committed Apr 3, 2024
1 parent 7671546 commit 050be6e
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synthetics/data_source_apicheck_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ func dataSourceApiCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/data_source_browsercheck_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ func dataSourceBrowserCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/data_source_httpcheck_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func dataSourceHttpCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/data_source_portcheck_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func dataSourcePortCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_api_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ func resourceApiCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_api_check_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "synthetics_create_api_check_v2" "api_v2_foo_check" {
location_ids = ["aws-us-east-1"]
name = "2 Terraform-Api V2 Acceptance Checkaroo"
scheduling_strategy = "round_robin"
automatic_retries = 1
custom_properties {
key = "key"
value = "value"
Expand Down Expand Up @@ -123,6 +124,7 @@ resource "synthetics_create_api_check_v2" "api_v2_foo_check" {
location_ids = ["aws-us-west-1"]
name = "2 Terraform-Api V2 Acceptance Checkaroo Updated"
scheduling_strategy = "concurrent"
automatic_retries = 0
custom_properties {
key = "beepkey"
value = "boopvalue"
Expand Down Expand Up @@ -220,6 +222,7 @@ func TestAccCreateUpdateApiCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.active", "true"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.device_id", "1"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.frequency", "5"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.automatic_retries", "1"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.location_ids.0", "aws-us-east-1"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.name", "2 Terraform-Api V2 Acceptance Checkaroo"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.scheduling_strategy", "round_robin"),
Expand Down Expand Up @@ -291,6 +294,7 @@ func TestAccCreateUpdateApiCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.active", "false"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.device_id", "2"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.frequency", "15"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.automatic_retries", "0"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.location_ids.0", "aws-us-west-1"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.name", "2 Terraform-Api V2 Acceptance Checkaroo Updated"),
resource.TestCheckResourceAttr("synthetics_create_api_check_v2.api_v2_foo_check", "test.0.scheduling_strategy", "concurrent"),
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_browser_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ func resourceBrowserCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_browser_check_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ resource "synthetics_create_browser_check_v2" "browser_v2_foo_check" {
device_id = 1
frequency = 5
location_ids = ["aws-us-east-1"]
automatic_retries = 1
name = "01-acceptance-Terraform-Browser-V2"
scheduling_strategy = "round_robin"
custom_properties {
Expand Down Expand Up @@ -133,6 +134,7 @@ resource "synthetics_create_browser_check_v2" "browser_v2_foo_check" {
device_id = 2
frequency = 15
location_ids = ["aws-us-west-1"]
automatic_retries = 0
name = "01-acceptance-updated-Terraform-Browser-V2"
scheduling_strategy = "concurrent"
custom_properties {
Expand Down Expand Up @@ -261,6 +263,7 @@ func TestAccCreateUpdateBrowserCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.active", "true"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.device_id", "1"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.frequency", "5"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.automatic_retries", "1"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.location_ids.0", "aws-us-east-1"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.name", "01-acceptance-Terraform-Browser-V2"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.scheduling_strategy", "round_robin"),
Expand Down Expand Up @@ -337,6 +340,7 @@ func TestAccCreateUpdateBrowserCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.active", "false"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.device_id", "2"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.frequency", "15"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.automatic_retries", "0"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.location_ids.0", "aws-us-west-1"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.name", "01-acceptance-updated-Terraform-Browser-V2"),
resource.TestCheckResourceAttr("synthetics_create_browser_check_v2.browser_v2_foo_check", "test.0.scheduling_strategy", "concurrent"),
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_http_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ func resourceHttpCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_http_check_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ resource "synthetics_create_http_check_v2" "http_v2_foo_check" {
name = "01-acceptance-Terraform-HTTP-V2"
type = "http"
url = "https://www.splunk.com"
automatic_retries = 1
scheduling_strategy = "round_robin"
custom_properties {
key = "key"
Expand Down Expand Up @@ -75,6 +76,7 @@ resource "synthetics_create_http_check_v2" "http_v2_foo_check" {
name = "01-acceptance-updated-Terraform-HTTP-V2"
type = "http"
url = "https://www.duckduckgo.com"
automatic_retries = 0
scheduling_strategy = "concurrent"
custom_properties {
key = "beepkey"
Expand Down Expand Up @@ -123,6 +125,7 @@ func TestAccCreateUpdateHttpCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.#", "1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.active", "true"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.frequency", "5"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.automatic_retries", "1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.location_ids.0", "aws-us-east-1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.location_ids.1", "aws-us-west-1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.name", "01-acceptance-Terraform-HTTP-V2"),
Expand Down Expand Up @@ -164,6 +167,7 @@ func TestAccCreateUpdateHttpCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.#", "1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.active", "false"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.frequency", "15"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.automatic_retries", "0"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.location_ids.0", "aws-us-west-1"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.name", "01-acceptance-updated-Terraform-HTTP-V2"),
resource.TestCheckResourceAttr("synthetics_create_http_check_v2.http_v2_foo_check", "test.0.type", "http"),
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_port_check_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ func resourcePortCheckV2() *schema.Resource {
},
},
},
"automatic_retries": {
Type: schema.TypeInt,
Computed: true,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions synthetics/resource_port_check_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ resource "synthetics_create_port_check_v2" "port_v2_foo_check" {
active = true
frequency = 5
location_ids = ["aws-us-west-2", "aws-us-east-1"]
automatic_retries = 1
scheduling_strategy = "round_robin"
custom_properties {
key = "key"
Expand All @@ -47,6 +48,7 @@ resource "synthetics_create_port_check_v2" "port_v2_foo_check" {
active = false
frequency = 15
location_ids = ["aws-us-east-1"]
automatic_retries = 0
scheduling_strategy = "concurrent"
custom_properties {
key = "beepkey"
Expand All @@ -73,6 +75,7 @@ func TestAccCreateUpdatePortCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.#", "1"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.active", "true"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.frequency", "5"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.automatic_retries", "1"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.location_ids.0", "aws-us-west-2"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.location_ids.1", "aws-us-east-1"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.scheduling_strategy", "round_robin"),
Expand All @@ -97,6 +100,7 @@ func TestAccCreateUpdatePortCheckV2(t *testing.T) {
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.#", "1"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.active", "false"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.frequency", "15"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.automatic_retries", "0"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.location_ids.0", "aws-us-east-1"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.scheduling_strategy", "concurrent"),
resource.TestCheckResourceAttr("synthetics_create_port_check_v2.port_v2_foo_check", "test.0.custom_properties.0.key", "beepkey"),
Expand Down
12 changes: 12 additions & 0 deletions synthetics/structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func flattenApiV2Read(checkApiV2 *sc2.ApiCheckV2Response) []interface{} {
apiV2 := make(map[string]interface{})

apiV2["active"] = checkApiV2.Test.Active
apiV2["automatic_retries"] = checkApiV2.Test.Automaticretries

if checkApiV2.Test.Frequency != 0 {
apiV2["frequency"] = checkApiV2.Test.Frequency
Expand Down Expand Up @@ -81,6 +82,7 @@ func flattenApiV2Data(checkApiV2 *sc2.ApiCheckV2Response) []interface{} {
apiV2 := make(map[string]interface{})

apiV2["active"] = checkApiV2.Test.Active
apiV2["automatic_retries"] = checkApiV2.Test.Automaticretries

if checkApiV2.Test.Createdat.IsZero() {
} else {
Expand Down Expand Up @@ -303,6 +305,7 @@ func flattenBrowserV2Read(checkBrowserV2 *sc2.BrowserCheckV2Response) []interfac
browserV2 := make(map[string]interface{})

browserV2["active"] = checkBrowserV2.Test.Active
browserV2["automatic_retries"] = checkBrowserV2.Test.Automaticretries

browserV2["device_id"] = checkBrowserV2.Test.Device.ID

Expand Down Expand Up @@ -339,6 +342,7 @@ func flattenBrowserV2Data(checkBrowserV2 *sc2.BrowserCheckV2Response) []interfac
browserV2 := make(map[string]interface{})

browserV2["active"] = checkBrowserV2.Test.Active
browserV2["automatic_retries"] = checkBrowserV2.Test.Automaticretries

if checkBrowserV2.Test.Createdat.IsZero() {
} else {
Expand Down Expand Up @@ -401,6 +405,7 @@ func flattenHttpV2Read(checkHttpV2 *sc2.HttpCheckV2Response) []interface{} {
}

httpV2["active"] = checkHttpV2.Test.Active
httpV2["automatic_retries"] = checkHttpV2.Test.Automaticretries

if checkHttpV2.Test.Frequency != 0 {
httpV2["frequency"] = checkHttpV2.Test.Frequency
Expand Down Expand Up @@ -459,6 +464,7 @@ func flattenHttpV2Data(checkHttpV2 *sc2.HttpCheckV2Response) []interface{} {
}

httpV2["active"] = checkHttpV2.Test.Active
httpV2["automatic_retries"] = checkHttpV2.Test.Automaticretries

if checkHttpV2.Test.Frequency != 0 {
httpV2["frequency"] = checkHttpV2.Test.Frequency
Expand Down Expand Up @@ -527,6 +533,7 @@ func flattenPortCheckV2Read(checkPortV2 *sc2.PortCheckV2Response) []interface{}
}

portV2["active"] = checkPortV2.Test.Active
portV2["automatic_retries"] = checkPortV2.Test.Automaticretries

if checkPortV2.Test.Frequency != 0 {
portV2["frequency"] = checkPortV2.Test.Frequency
Expand Down Expand Up @@ -575,6 +582,7 @@ func flattenPortCheckV2Data(checkPortV2 *sc2.PortCheckV2Response) []interface{}
}

portV2["active"] = checkPortV2.Test.Active
portV2["automatic_retries"] = checkPortV2.Test.Automaticretries

if checkPortV2.Test.Frequency != 0 {
portV2["frequency"] = checkPortV2.Test.Frequency
Expand Down Expand Up @@ -1115,6 +1123,7 @@ func buildApiV2Data(d *schema.ResourceData) sc2.ApiCheckV2Input {
apiv2.Test.Active = api["active"].(bool)
apiv2.Test.Deviceid = api["device_id"].(int)
apiv2.Test.Frequency = api["frequency"].(int)
apiv2.Test.Automaticretries = api["automatic_retries"].(int)
apiv2.Test.Locationids = buildLocationIdData(api["location_ids"].([]interface{}))
apiv2.Test.Name = api["name"].(string)
apiv2.Test.Requests = buildRequestsData(api["requests"].(([]interface{})))
Expand All @@ -1135,6 +1144,7 @@ func buildBrowserV2Data(d *schema.ResourceData) sc2.BrowserCheckV2Input {
browserv2.Test.Active = browser["active"].(bool)
browserv2.Test.DeviceID = browser["device_id"].(int)
browserv2.Test.Frequency = browser["frequency"].(int)
browserv2.Test.Automaticretries = browser["automatic_retries"].(int)
browserv2.Test.LocationIds = buildLocationIdData(browser["location_ids"].([]interface{}))
browserv2.Test.Name = browser["name"].(string)
browserv2.Test.Transactions = buildBusinessTransactionsData(browser["transactions"].([]interface{}))
Expand All @@ -1159,6 +1169,7 @@ func buildHttpV2Data(d *schema.ResourceData) sc2.HttpCheckV2Input {
httpv2.Test.URL = http["url"].(string)
httpv2.Test.LocationIds = buildLocationIdData(http["location_ids"].([]interface{}))
httpv2.Test.Frequency = http["frequency"].(int)
httpv2.Test.Automaticretries = http["automatic_retries"].(int)
httpv2.Test.SchedulingStrategy = http["scheduling_strategy"].(string)
httpv2.Test.Active = http["active"].(bool)
httpv2.Test.RequestMethod = http["request_method"].(string)
Expand Down Expand Up @@ -1191,6 +1202,7 @@ func buildPortCheckV2Data(d *schema.ResourceData) sc2.PortCheckV2Input {
portv2.Test.Host = port["host"].(string)
portv2.Test.LocationIds = buildLocationIdData(port["location_ids"].([]interface{}))
portv2.Test.Frequency = port["frequency"].(int)
portv2.Test.Automaticretries = port["automatic_retries"].(int)
portv2.Test.SchedulingStrategy = port["scheduling_strategy"].(string)
portv2.Test.Active = port["active"].(bool)
portv2.Test.Customproperties = buildCustomPropertiesData(port["custom_properties"].(*schema.Set))
Expand Down

0 comments on commit 050be6e

Please sign in to comment.