diff options
author | vagrant <vagrant@terraform> | 2016-08-23 14:43:31 +0000 |
---|---|---|
committer | vagrant <vagrant@terraform> | 2016-08-23 14:43:31 +0000 |
commit | 516886070835127727defe348567a0edfa138528 (patch) | |
tree | 8dc2734278215cac1c5bdf14c3096dc4d56319ff | |
parent | 4917b1d3ebabeb85d8b8087a375fc90d41c7d6c1 (diff) | |
download | terraform-provider-statuscake-516886070835127727defe348567a0edfa138528.tar.gz terraform-provider-statuscake-516886070835127727defe348567a0edfa138528.tar.zst terraform-provider-statuscake-516886070835127727defe348567a0edfa138528.zip |
enable contact-group id in statuscake test
-rw-r--r-- | resource_statuscaketest.go | 7 | ||||
-rw-r--r-- | resource_statuscaketest_test.go | 21 |
2 files changed, 19 insertions, 9 deletions
diff --git a/resource_statuscaketest.go b/resource_statuscaketest.go index 7f5ff67..53b3059 100644 --- a/resource_statuscaketest.go +++ b/resource_statuscaketest.go | |||
@@ -53,6 +53,10 @@ func resourceStatusCakeTest() *schema.Resource { | |||
53 | Type: schema.TypeInt, | 53 | Type: schema.TypeInt, |
54 | Computed: true, | 54 | Computed: true, |
55 | }, | 55 | }, |
56 | "contact_id": &schema.Schema{ | ||
57 | Type: schema.TypeInt, | ||
58 | Optional: true, | ||
59 | }, | ||
56 | }, | 60 | }, |
57 | } | 61 | } |
58 | } | 62 | } |
@@ -151,5 +155,8 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test { | |||
151 | if v, ok := d.GetOk("timeout"); ok { | 155 | if v, ok := d.GetOk("timeout"); ok { |
152 | test.Timeout = v.(int) | 156 | test.Timeout = v.(int) |
153 | } | 157 | } |
158 | if v, ok := d.GetOk("contact_id"); ok { | ||
159 | test.ContactID = v.(int) | ||
160 | } | ||
154 | return test | 161 | return test |
155 | } | 162 | } |
diff --git a/resource_statuscaketest_test.go b/resource_statuscaketest_test.go index bbc6932..bec1a45 100644 --- a/resource_statuscaketest_test.go +++ b/resource_statuscaketest_test.go | |||
@@ -49,6 +49,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) { | |||
49 | testAccTestCheckExists("statuscake_test.google", &test), | 49 | testAccTestCheckExists("statuscake_test.google", &test), |
50 | resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), | 50 | resource.TestCheckResourceAttr("statuscake_test.google", "check_rate", "500"), |
51 | resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), | 51 | resource.TestCheckResourceAttr("statuscake_test.google", "paused", "true"), |
52 | resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", "23456"), | ||
52 | ), | 53 | ), |
53 | }, | 54 | }, |
54 | }, | 55 | }, |
@@ -97,19 +98,21 @@ func testAccTestCheckDestroy(test *statuscake.Test) resource.TestCheckFunc { | |||
97 | 98 | ||
98 | const testAccTestConfig_basic = ` | 99 | const testAccTestConfig_basic = ` |
99 | resource "statuscake_test" "google" { | 100 | resource "statuscake_test" "google" { |
100 | website_name = "google.com" | 101 | website_name = "google.com" |
101 | website_url = "www.google.com" | 102 | website_url = "www.google.com" |
102 | test_type = "HTTP" | 103 | test_type = "HTTP" |
103 | check_rate = 300 | 104 | check_rate = 300 |
105 | contact_id = 12345 | ||
104 | } | 106 | } |
105 | ` | 107 | ` |
106 | 108 | ||
107 | const testAccTestConfig_update = ` | 109 | const testAccTestConfig_update = ` |
108 | resource "statuscake_test" "google" { | 110 | resource "statuscake_test" "google" { |
109 | website_name = "google.com" | 111 | website_name = "google.com" |
110 | website_url = "www.google.com" | 112 | website_url = "www.google.com" |
111 | test_type = "HTTP" | 113 | test_type = "HTTP" |
112 | check_rate = 500 | 114 | check_rate = 500 |
113 | paused = true | 115 | paused = true |
116 | contact_id = 23456 | ||
114 | } | 117 | } |
115 | ` | 118 | ` |