aboutsummaryrefslogtreecommitdiffhomepage
path: root/statuscake/resource_statuscaketest.go
diff options
context:
space:
mode:
Diffstat (limited to 'statuscake/resource_statuscaketest.go')
-rw-r--r--statuscake/resource_statuscaketest.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/statuscake/resource_statuscaketest.go b/statuscake/resource_statuscaketest.go
index 866cdce..b0dc84f 100644
--- a/statuscake/resource_statuscaketest.go
+++ b/statuscake/resource_statuscaketest.go
@@ -51,9 +51,11 @@ func resourceStatusCakeTest() *schema.Resource {
51 Required: true, 51 Required: true,
52 }, 52 },
53 53
54 "contact_id": { 54 "contact_group": {
55 Type: schema.TypeInt, 55 Type: schema.TypeSet,
56 Elem: &schema.Schema{Type: schema.TypeString},
56 Optional: true, 57 Optional: true,
58 Set: schema.HashString,
57 }, 59 },
58 60
59 "check_rate": { 61 "check_rate": {
@@ -223,7 +225,7 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error {
223 TestType: d.Get("test_type").(string), 225 TestType: d.Get("test_type").(string),
224 Paused: d.Get("paused").(bool), 226 Paused: d.Get("paused").(bool),
225 Timeout: d.Get("timeout").(int), 227 Timeout: d.Get("timeout").(int),
226 ContactID: d.Get("contact_id").(int), 228 ContactGroup: castSetToSliceStrings(d.Get("contact_group").(*schema.Set).List()),
227 Confirmation: d.Get("confirmations").(int), 229 Confirmation: d.Get("confirmations").(int),
228 Port: d.Get("port").(int), 230 Port: d.Get("port").(int),
229 TriggerRate: d.Get("trigger_rate").(int), 231 TriggerRate: d.Get("trigger_rate").(int),
@@ -312,7 +314,7 @@ func ReadTest(d *schema.ResourceData, meta interface{}) error {
312 d.Set("test_type", testResp.TestType) 314 d.Set("test_type", testResp.TestType)
313 d.Set("paused", testResp.Paused) 315 d.Set("paused", testResp.Paused)
314 d.Set("timeout", testResp.Timeout) 316 d.Set("timeout", testResp.Timeout)
315 d.Set("contact_id", testResp.ContactID) 317 d.Set("contact_group", testResp.ContactGroup)
316 d.Set("confirmations", testResp.Confirmation) 318 d.Set("confirmations", testResp.Confirmation)
317 d.Set("port", testResp.Port) 319 d.Set("port", testResp.Port)
318 d.Set("trigger_rate", testResp.TriggerRate) 320 d.Set("trigger_rate", testResp.TriggerRate)
@@ -356,8 +358,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
356 if v, ok := d.GetOk("check_rate"); ok { 358 if v, ok := d.GetOk("check_rate"); ok {
357 test.CheckRate = v.(int) 359 test.CheckRate = v.(int)
358 } 360 }
359 if v, ok := d.GetOk("contact_id"); ok { 361 if v, ok := d.GetOk("contact_group"); ok {
360 test.ContactID = v.(int) 362 test.ContactGroup = castSetToSliceStrings(v.(*schema.Set).List())
361 } 363 }
362 if v, ok := d.GetOk("test_type"); ok { 364 if v, ok := d.GetOk("test_type"); ok {
363 test.TestType = v.(string) 365 test.TestType = v.(string)