From dfa917b670a189b69cff8e558b32e4c3df0792f4 Mon Sep 17 00:00:00 2001 From: vagrant Date: Tue, 23 Aug 2016 14:43:31 +0000 Subject: [PATCH 1/2] enable contact-group id in statuscake test --- .../statuscake/resource_statuscaketest.go | 7 +++++++ .../resource_statuscaketest_test.go | 21 +++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/builtin/providers/statuscake/resource_statuscaketest.go b/builtin/providers/statuscake/resource_statuscaketest.go index 7f5ff67bb..53b30599b 100644 --- a/builtin/providers/statuscake/resource_statuscaketest.go +++ b/builtin/providers/statuscake/resource_statuscaketest.go @@ -53,6 +53,10 @@ func resourceStatusCakeTest() *schema.Resource { Type: schema.TypeInt, 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 { test.Timeout = v.(int) } + if v, ok := d.GetOk("contact_id"); ok { + test.ContactID = v.(int) + } return test } diff --git a/builtin/providers/statuscake/resource_statuscaketest_test.go b/builtin/providers/statuscake/resource_statuscaketest_test.go index bbc6932a8..bec1a4546 100644 --- a/builtin/providers/statuscake/resource_statuscaketest_test.go +++ b/builtin/providers/statuscake/resource_statuscaketest_test.go @@ -49,6 +49,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) { testAccTestCheckExists("statuscake_test.google", &test), resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), 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 = ` resource "statuscake_test" "google" { - website_name = "google.com" - website_url = "www.google.com" - test_type = "HTTP" - check_rate = 300 + website_name = "google.com" + website_url = "www.google.com" + test_type = "HTTP" + check_rate = 300 + contact_id = 12345 } ` const testAccTestConfig_update = ` resource "statuscake_test" "google" { - website_name = "google.com" - website_url = "www.google.com" - test_type = "HTTP" - check_rate = 500 - paused = true + website_name = "google.com" + website_url = "www.google.com" + test_type = "HTTP" + check_rate = 500 + paused = true + contact_id = 23456 } ` From b158cbc2dd92ecc20c4448a03feaa91c8732b9df Mon Sep 17 00:00:00 2001 From: stack72 Date: Mon, 29 Aug 2016 00:00:27 +0100 Subject: [PATCH 2/2] docs/statuscake: Adding the parameter to the docs --- website/source/docs/providers/statuscake/r/test.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/source/docs/providers/statuscake/r/test.html.markdown b/website/source/docs/providers/statuscake/r/test.html.markdown index d2d1572ed..1cb0fccdb 100644 --- a/website/source/docs/providers/statuscake/r/test.html.markdown +++ b/website/source/docs/providers/statuscake/r/test.html.markdown @@ -31,6 +31,7 @@ The following arguments are supported: * `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. ## Attributes Reference