Type: schema.TypeInt,
Optional: true,
},
+ "confirmations": &schema.Schema{
+ Type: schema.TypeInt,
+ Optional: true,
+ },
},
}
}
client := meta.(*statuscake.Client)
newTest := &statuscake.Test{
- WebsiteName: d.Get("website_name").(string),
- WebsiteURL: d.Get("website_url").(string),
- CheckRate: d.Get("check_rate").(int),
- TestType: d.Get("test_type").(string),
- Paused: d.Get("paused").(bool),
- Timeout: d.Get("timeout").(int),
- ContactID: d.Get("contact_id").(int),
+ WebsiteName: d.Get("website_name").(string),
+ WebsiteURL: d.Get("website_url").(string),
+ CheckRate: d.Get("check_rate").(int),
+ TestType: d.Get("test_type").(string),
+ Paused: d.Get("paused").(bool),
+ Timeout: d.Get("timeout").(int),
+ ContactID: d.Get("contact_id").(int),
+ Confirmation: d.Get("confirmations").(int),
}
log.Printf("[DEBUG] Creating new StatusCake Test: %s", d.Get("website_name").(string))
d.Set("paused", testResp.Paused)
d.Set("timeout", testResp.Timeout)
d.Set("contact_id", testResp.ContactID)
+ d.Set("confirmations", testResp.Confirmation)
return nil
}
if v, ok := d.GetOk("contact_id"); ok {
test.ContactID = v.(int)
}
+ if v, ok := d.GetOk("confirmations"); ok {
+ test.Confirmation = v.(int)
+ }
return test
}
resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"),
resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"),
resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "0"),
+ resource.TestCheckResourceAttr("statuscake_test.google", "confirmations", "0"),
),
},
},
err = check(key, value, strconv.Itoa(test.Timeout))
case "contact_id":
err = check(key, value, strconv.Itoa(test.ContactID))
+ case "confirmations":
+ err = check(key, value, strconv.Itoa(test.Confirmation))
}
if err != nil {
test_type = "HTTP"
check_rate = 300
contact_id = 12345
+ confirmations = 1
}
`