Merge branch 'tape-tv-statuscake-contactgroup'

This commit is contained in:
stack72 2016-08-29 00:00:43 +01:00
commit acf9aab692
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
3 changed files with 20 additions and 9 deletions

View File

@ -53,6 +53,10 @@ func resourceStatusCakeTest() *schema.Resource {
Type: schema.TypeInt, Type: schema.TypeInt,
Computed: true, Computed: true,
}, },
"contact_id": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
},
}, },
} }
} }
@ -151,5 +155,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
if v, ok := d.GetOk("timeout"); ok { if v, ok := d.GetOk("timeout"); ok {
test.Timeout = v.(int) test.Timeout = v.(int)
} }
if v, ok := d.GetOk("contact_id"); ok {
test.ContactID = v.(int)
}
return test return test
} }

View File

@ -49,6 +49,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
testAccTestCheckExists("statuscake_test.google", &test), testAccTestCheckExists("statuscake_test.google", &test),
resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"),
resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"),
resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "23456"),
), ),
}, },
}, },
@ -97,19 +98,21 @@ func testAccTestCheckDestroy(test *statuscake.Test) resource.TestCheckFunc {
const testAccTestConfig_basic = ` const testAccTestConfig_basic = `
resource "statuscake_test" "google" { resource "statuscake_test" "google" {
website_name = "google.com" website_name = "google.com"
website_url = "www.google.com" website_url = "www.google.com"
test_type = "HTTP" test_type = "HTTP"
check_rate = 300 check_rate = 300
contact_id = 12345
} }
` `
const testAccTestConfig_update = ` const testAccTestConfig_update = `
resource "statuscake_test" "google" { resource "statuscake_test" "google" {
website_name = "google.com" website_name = "google.com"
website_url = "www.google.com" website_url = "www.google.com"
test_type = "HTTP" test_type = "HTTP"
check_rate = 500 check_rate = 500
paused = true paused = true
contact_id = 23456
} }
` `

View File

@ -31,6 +31,7 @@ The following arguments are supported:
* `test_type` - (Required) The type of Test. Either HTTP or TCP * `test_type` - (Required) The type of Test. Either HTTP or TCP
* `paused` - (Optional) Whether or not the test is paused. Defaults to false. * `paused` - (Optional) Whether or not the test is paused. Defaults to false.
* `timeout` - (Optional) The timeout of the test in seconds. * `timeout` - (Optional) The timeout of the test in seconds.
* `contact_id` - (Optional) The ID of the contact group to associate with the test.
## Attributes Reference ## Attributes Reference