aboutsummaryrefslogtreecommitdiffhomepage
path: root/resource_statuscaketest.go
diff options
context:
space:
mode:
authorSam Crang <sam.crang@gmail.com>2017-01-13 11:35:15 +0000
committerPaul Stack <public@paulstack.co.uk>2017-01-13 11:35:15 +0000
commitb581540543290cbcd9b0e07ef93fec8b1d24b5c2 (patch)
tree5eabbd479541c2278ea1be507bdbfa98b6e96822 /resource_statuscaketest.go
parentc07010769685fd6127e977d9ea7e891773fe75a0 (diff)
downloadterraform-provider-statuscake-b581540543290cbcd9b0e07ef93fec8b1d24b5c2.tar.gz
terraform-provider-statuscake-b581540543290cbcd9b0e07ef93fec8b1d24b5c2.tar.zst
terraform-provider-statuscake-b581540543290cbcd9b0e07ef93fec8b1d24b5c2.zip
Add support for StatusCake confirmation servers (#11179)
* Add support for StatusCake confirmation servers * Add documentation for new StatusCake confirmations argument
Diffstat (limited to 'resource_statuscaketest.go')
-rw-r--r--resource_statuscaketest.go23
1 files changed, 16 insertions, 7 deletions
diff --git a/resource_statuscaketest.go b/resource_statuscaketest.go
index 08ace97..6c340d8 100644
--- a/resource_statuscaketest.go
+++ b/resource_statuscaketest.go
@@ -57,6 +57,10 @@ func resourceStatusCakeTest() *schema.Resource {
57 Type: schema.TypeInt, 57 Type: schema.TypeInt,
58 Optional: true, 58 Optional: true,
59 }, 59 },
60 "confirmations": &schema.Schema{
61 Type: schema.TypeInt,
62 Optional: true,
63 },
60 }, 64 },
61 } 65 }
62} 66}
@@ -65,13 +69,14 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error {
65 client := meta.(*statuscake.Client) 69 client := meta.(*statuscake.Client)
66 70
67 newTest := &statuscake.Test{ 71 newTest := &statuscake.Test{
68 WebsiteName: d.Get("website_name").(string), 72 WebsiteName: d.Get("website_name").(string),
69 WebsiteURL: d.Get("website_url").(string), 73 WebsiteURL: d.Get("website_url").(string),
70 CheckRate: d.Get("check_rate").(int), 74 CheckRate: d.Get("check_rate").(int),
71 TestType: d.Get("test_type").(string), 75 TestType: d.Get("test_type").(string),
72 Paused: d.Get("paused").(bool), 76 Paused: d.Get("paused").(bool),
73 Timeout: d.Get("timeout").(int), 77 Timeout: d.Get("timeout").(int),
74 ContactID: d.Get("contact_id").(int), 78 ContactID: d.Get("contact_id").(int),
79 Confirmation: d.Get("confirmations").(int),
75 } 80 }
76 81
77 log.Printf("[DEBUG] Creating new StatusCake Test: %s", d.Get("website_name").(string)) 82 log.Printf("[DEBUG] Creating new StatusCake Test: %s", d.Get("website_name").(string))
@@ -134,6 +139,7 @@ func ReadTest(d *schema.ResourceData, meta interface{}) error {
134 d.Set("paused", testResp.Paused) 139 d.Set("paused", testResp.Paused)
135 d.Set("timeout", testResp.Timeout) 140 d.Set("timeout", testResp.Timeout)
136 d.Set("contact_id", testResp.ContactID) 141 d.Set("contact_id", testResp.ContactID)
142 d.Set("confirmations", testResp.Confirmation)
137 143
138 return nil 144 return nil
139} 145}
@@ -167,5 +173,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
167 if v, ok := d.GetOk("contact_id"); ok { 173 if v, ok := d.GetOk("contact_id"); ok {
168 test.ContactID = v.(int) 174 test.ContactID = v.(int)
169 } 175 }
176 if v, ok := d.GetOk("confirmations"); ok {
177 test.Confirmation = v.(int)
178 }
170 return test 179 return test
171} 180}