Merge branch 'statuscake_adding_contact_group' of https://github.com/ldjohnson/terraform into ldjohnson-statuscake_adding_contact_group

This commit is contained in:
stack72 2017-01-17 16:11:23 +00:00
commit f6ac901315
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
3 changed files with 16 additions and 9 deletions

View File

@ -33,6 +33,11 @@ func resourceStatusCakeTest() *schema.Resource {
Required: true,
},
"contact_id": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
},
"check_rate": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
@ -53,10 +58,6 @@ func resourceStatusCakeTest() *schema.Resource {
Type: schema.TypeInt,
Computed: true,
},
"contact_id": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
},
"confirmations": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
@ -161,6 +162,9 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
if v, ok := d.GetOk("check_rate"); ok {
test.CheckRate = v.(int)
}
if v, ok := d.GetOk("contact_id"); ok {
test.ContactID = v.(int)
}
if v, ok := d.GetOk("test_type"); ok {
test.TestType = v.(string)
}

View File

@ -34,5 +34,6 @@ resource "statuscake_test" "google" {
website_url = "www.google.com"
test_type = "HTTP"
check_rate = 300
contact_id = 12345
}
```

View File

@ -18,6 +18,7 @@ resource "statuscake_test" "google" {
website_url = "www.google.com"
test_type = "HTTP"
check_rate = 300
contact_id = 12345
}
```
@ -26,9 +27,10 @@ resource "statuscake_test" "google" {
The following arguments are supported:
* `website_name` - (Required) This is the name of the test and the website to be monitored.
* `website_url` - (Required) The URL of the website to be monitored.
* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300.
* `test_type` - (Required) The type of Test. Either HTTP or TCP.
* `website_url` - (Required) The URL of the website to be monitored
* `check_rate` - (Optional) Test check rate in seconds. Defaults to 300
* `contact_id` - (Optional) The id of the contact group to be add to the test. Each test can have only one.
* `test_type` - (Required) The type of Test. Either HTTP or TCP
* `paused` - (Optional) Whether or not the test is paused. Defaults to false.
* `timeout` - (Optional) The timeout of the test in seconds.
* `contact_id` - (Optional) The ID of the contact group to associate with the test.