aboutsummaryrefslogtreecommitdiffhomepage
path: root/resource_statuscaketest.go
diff options
context:
space:
mode:
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}