diff options
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | statuscake/resource_statuscaketest.go | 11 | ||||
-rw-r--r-- | statuscake/resource_statuscaketest_test.go | 4 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/.gitignore | 1 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/.travis.yml | 14 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock | 48 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml | 38 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/README.md | 2 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/doc.go | 12 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/makefile | 6 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/responses.go | 2 | ||||
-rw-r--r-- | vendor/github.com/DreamItGetIT/statuscake/tests.go | 29 | ||||
-rw-r--r-- | vendor/modules.txt | 2 | ||||
-rw-r--r-- | website/docs/r/test.html.markdown | 5 |
15 files changed, 166 insertions, 14 deletions
@@ -1,6 +1,6 @@ | |||
1 | module github.com/terraform-providers/terraform-provider-statuscake | 1 | module github.com/terraform-providers/terraform-provider-statuscake |
2 | 2 | ||
3 | require ( | 3 | require ( |
4 | github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3 | 4 | github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb |
5 | github.com/hashicorp/terraform v0.12.0 | 5 | github.com/hashicorp/terraform v0.12.0 |
6 | ) | 6 | ) |
@@ -17,8 +17,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzS | |||
17 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | 17 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= |
18 | github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= | 18 | github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= |
19 | github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= | 19 | github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= |
20 | github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3 h1:BmnYSwnNifByVfy5Yp3AxiEWAS4EkzK0Cu6/Rh/7mu4= | 20 | github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb h1:vJ3lnCyZNmSV/OKyw4d7GuZHFrUaa3FY6/NqtvRE0lw= |
21 | github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3/go.mod h1:OclNh7ZacJo61GDJablmsOZ7l8/AVtzGqP8G7baOdAs= | 21 | github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb/go.mod h1:OclNh7ZacJo61GDJablmsOZ7l8/AVtzGqP8G7baOdAs= |
22 | github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= | 22 | github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= |
23 | github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= | 23 | github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= |
24 | github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= | 24 | github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= |
diff --git a/statuscake/resource_statuscaketest.go b/statuscake/resource_statuscaketest.go index b062456..d32a870 100644 --- a/statuscake/resource_statuscaketest.go +++ b/statuscake/resource_statuscaketest.go | |||
@@ -215,6 +215,12 @@ func resourceStatusCakeTest() *schema.Resource { | |||
215 | Optional: true, | 215 | Optional: true, |
216 | }, | 216 | }, |
217 | 217 | ||
218 | "enable_ssl_alert": { | ||
219 | Type: schema.TypeBool, | ||
220 | Optional: true, | ||
221 | Default: false, | ||
222 | }, | ||
223 | |||
218 | "follow_redirect": { | 224 | "follow_redirect": { |
219 | Type: schema.TypeBool, | 225 | Type: schema.TypeBool, |
220 | Optional: true, | 226 | Optional: true, |
@@ -257,6 +263,7 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error { | |||
257 | UseJar: d.Get("use_jar").(int), | 263 | UseJar: d.Get("use_jar").(int), |
258 | PostRaw: d.Get("post_raw").(string), | 264 | PostRaw: d.Get("post_raw").(string), |
259 | FinalEndpoint: d.Get("final_endpoint").(string), | 265 | FinalEndpoint: d.Get("final_endpoint").(string), |
266 | EnableSSLAlert: d.Get("enable_ssl_alert").(bool), | ||
260 | FollowRedirect: d.Get("follow_redirect").(bool), | 267 | FollowRedirect: d.Get("follow_redirect").(bool), |
261 | } | 268 | } |
262 | 269 | ||
@@ -354,6 +361,7 @@ func ReadTest(d *schema.ResourceData, meta interface{}) error { | |||
354 | d.Set("use_jar", testResp.UseJar) | 361 | d.Set("use_jar", testResp.UseJar) |
355 | d.Set("post_raw", testResp.PostRaw) | 362 | d.Set("post_raw", testResp.PostRaw) |
356 | d.Set("final_endpoint", testResp.FinalEndpoint) | 363 | d.Set("final_endpoint", testResp.FinalEndpoint) |
364 | d.Set("enable_ssl_alert", testResp.EnableSSLAlert) | ||
357 | d.Set("follow_redirect", testResp.FollowRedirect) | 365 | d.Set("follow_redirect", testResp.FollowRedirect) |
358 | 366 | ||
359 | return nil | 367 | return nil |
@@ -456,6 +464,9 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test { | |||
456 | if v, ok := d.GetOk("final_endpoint"); ok { | 464 | if v, ok := d.GetOk("final_endpoint"); ok { |
457 | test.FinalEndpoint = v.(string) | 465 | test.FinalEndpoint = v.(string) |
458 | } | 466 | } |
467 | if v, ok := d.GetOk("enable_ssl_alert"); ok { | ||
468 | test.EnableSSLAlert = v.(bool) | ||
469 | } | ||
459 | if v, ok := d.GetOk("follow_redirect"); ok { | 470 | if v, ok := d.GetOk("follow_redirect"); ok { |
460 | test.FollowRedirect = v.(bool) | 471 | test.FollowRedirect = v.(bool) |
461 | } | 472 | } |
diff --git a/statuscake/resource_statuscaketest_test.go b/statuscake/resource_statuscaketest_test.go index bd609d8..71362f7 100644 --- a/statuscake/resource_statuscaketest_test.go +++ b/statuscake/resource_statuscaketest_test.go | |||
@@ -114,6 +114,7 @@ func TestAccStatusCake_withUpdate(t *testing.T) { | |||
114 | resource.TestCheckResourceAttr("statuscake_test.google", "use_jar", "1"), | 114 | resource.TestCheckResourceAttr("statuscake_test.google", "use_jar", "1"), |
115 | resource.TestCheckResourceAttr("statuscake_test.google", "post_raw", "string32096"), | 115 | resource.TestCheckResourceAttr("statuscake_test.google", "post_raw", "string32096"), |
116 | resource.TestCheckResourceAttr("statuscake_test.google", "final_endpoint", "string10781"), | 116 | resource.TestCheckResourceAttr("statuscake_test.google", "final_endpoint", "string10781"), |
117 | resource.TestCheckResourceAttr("statuscake_test.google", "enable_ssl_alert", "false"), | ||
117 | resource.TestCheckResourceAttr("statuscake_test.google", "follow_redirect", "true"), | 118 | resource.TestCheckResourceAttr("statuscake_test.google", "follow_redirect", "true"), |
118 | ), | 119 | ), |
119 | }, | 120 | }, |
@@ -213,6 +214,8 @@ func testAccTestCheckAttributes(rn string, test *statuscake.Test) resource.TestC | |||
213 | err = check(key, value, test.PostRaw) | 214 | err = check(key, value, test.PostRaw) |
214 | case "final_endpoint": | 215 | case "final_endpoint": |
215 | err = check(key, value, test.FinalEndpoint) | 216 | err = check(key, value, test.FinalEndpoint) |
217 | case "enable_ssl_alert": | ||
218 | err = check(key, value, strconv.FormatBool(test.EnableSSLAlert)) | ||
216 | case "follow_redirect": | 219 | case "follow_redirect": |
217 | err = check(key, value, strconv.FormatBool(test.FollowRedirect)) | 220 | err = check(key, value, strconv.FormatBool(test.FollowRedirect)) |
218 | } | 221 | } |
@@ -297,6 +300,7 @@ resource "statuscake_test" "google" { | |||
297 | use_jar = 1 | 300 | use_jar = 1 |
298 | post_raw = "string32096" | 301 | post_raw = "string32096" |
299 | final_endpoint = "string10781" | 302 | final_endpoint = "string10781" |
303 | enable_ssl_alert = false | ||
300 | follow_redirect = true | 304 | follow_redirect = true |
301 | } | 305 | } |
302 | ` | 306 | ` |
diff --git a/vendor/github.com/DreamItGetIT/statuscake/.gitignore b/vendor/github.com/DreamItGetIT/statuscake/.gitignore new file mode 100644 index 0000000..22d0d82 --- /dev/null +++ b/vendor/github.com/DreamItGetIT/statuscake/.gitignore | |||
@@ -0,0 +1 @@ | |||
vendor | |||
diff --git a/vendor/github.com/DreamItGetIT/statuscake/.travis.yml b/vendor/github.com/DreamItGetIT/statuscake/.travis.yml new file mode 100644 index 0000000..c7bad4e --- /dev/null +++ b/vendor/github.com/DreamItGetIT/statuscake/.travis.yml | |||
@@ -0,0 +1,14 @@ | |||
1 | language: go | ||
2 | go: | ||
3 | - "1.x" | ||
4 | |||
5 | env: | ||
6 | - DEP_VERSION="0.5.0" | ||
7 | |||
8 | before_install: | ||
9 | # Install dep | ||
10 | - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep | ||
11 | - chmod +x $GOPATH/bin/dep | ||
12 | |||
13 | # Install golint | ||
14 | - go get golang.org/x/lint/golint | ||
diff --git a/vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock new file mode 100644 index 0000000..c5b189e --- /dev/null +++ b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.lock | |||
@@ -0,0 +1,48 @@ | |||
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. | ||
2 | |||
3 | |||
4 | [[projects]] | ||
5 | branch = "master" | ||
6 | digest = "1:27dce89d419e7be582ae735623fb0b538012e62b08a87c0308c3b360de2a74b0" | ||
7 | name = "github.com/DreamItGetIT/statuscake" | ||
8 | packages = ["."] | ||
9 | pruneopts = "UT" | ||
10 | revision = "49ae6aae1769b896774d7e860e620f1bd8221355" | ||
11 | |||
12 | [[projects]] | ||
13 | digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" | ||
14 | name = "github.com/davecgh/go-spew" | ||
15 | packages = ["spew"] | ||
16 | pruneopts = "UT" | ||
17 | revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" | ||
18 | version = "v1.1.1" | ||
19 | |||
20 | [[projects]] | ||
21 | digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" | ||
22 | name = "github.com/pmezard/go-difflib" | ||
23 | packages = ["difflib"] | ||
24 | pruneopts = "UT" | ||
25 | revision = "792786c7400a136282c1664665ae0a8db921c6c2" | ||
26 | version = "v1.0.0" | ||
27 | |||
28 | [[projects]] | ||
29 | digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e" | ||
30 | name = "github.com/stretchr/testify" | ||
31 | packages = [ | ||
32 | "assert", | ||
33 | "require", | ||
34 | ] | ||
35 | pruneopts = "UT" | ||
36 | revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" | ||
37 | version = "v1.2.2" | ||
38 | |||
39 | [solve-meta] | ||
40 | analyzer-name = "dep" | ||
41 | analyzer-version = 1 | ||
42 | input-imports = [ | ||
43 | "github.com/DreamItGetIT/statuscake", | ||
44 | "github.com/stretchr/testify/assert", | ||
45 | "github.com/stretchr/testify/require", | ||
46 | ] | ||
47 | solver-name = "gps-cdcl" | ||
48 | solver-version = 1 | ||
diff --git a/vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml new file mode 100644 index 0000000..b0c1687 --- /dev/null +++ b/vendor/github.com/DreamItGetIT/statuscake/Gopkg.toml | |||
@@ -0,0 +1,38 @@ | |||
1 | # Gopkg.toml example | ||
2 | # | ||
3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html | ||
4 | # for detailed Gopkg.toml documentation. | ||
5 | # | ||
6 | # required = ["github.com/user/thing/cmd/thing"] | ||
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
8 | # | ||
9 | # [[constraint]] | ||
10 | # name = "github.com/user/project" | ||
11 | # version = "1.0.0" | ||
12 | # | ||
13 | # [[constraint]] | ||
14 | # name = "github.com/user/project2" | ||
15 | # branch = "dev" | ||
16 | # source = "github.com/myfork/project2" | ||
17 | # | ||
18 | # [[override]] | ||
19 | # name = "github.com/x/y" | ||
20 | # version = "2.4.0" | ||
21 | # | ||
22 | # [prune] | ||
23 | # non-go = false | ||
24 | # go-tests = true | ||
25 | # unused-packages = true | ||
26 | |||
27 | |||
28 | [[constraint]] | ||
29 | branch = "master" | ||
30 | name = "github.com/DreamItGetIT/statuscake" | ||
31 | |||
32 | [[constraint]] | ||
33 | name = "github.com/stretchr/testify" | ||
34 | version = "1.2.2" | ||
35 | |||
36 | [prune] | ||
37 | go-tests = true | ||
38 | unused-packages = true | ||
diff --git a/vendor/github.com/DreamItGetIT/statuscake/README.md b/vendor/github.com/DreamItGetIT/statuscake/README.md index f1e4eaf..0806028 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/README.md +++ b/vendor/github.com/DreamItGetIT/statuscake/README.md | |||
@@ -1,5 +1,7 @@ | |||
1 | # statuscake | 1 | # statuscake |
2 | 2 | ||
3 | [![Build Status](https://travis-ci.org/DreamItGetIT/statuscake.svg?branch=master)](https://travis-ci.org/DreamItGetIT/statuscake) | ||
4 | |||
3 | `statuscake` is a Go pkg that implements a client for the [statuscake]("https://statuscake.com") API. | 5 | `statuscake` is a Go pkg that implements a client for the [statuscake]("https://statuscake.com") API. |
4 | 6 | ||
5 | More documentation and examples at [http://godoc.org/github.com/DreamItGetIT/statuscake](http://godoc.org/github.com/DreamItGetIT/statuscake). | 7 | More documentation and examples at [http://godoc.org/github.com/DreamItGetIT/statuscake](http://godoc.org/github.com/DreamItGetIT/statuscake). |
diff --git a/vendor/github.com/DreamItGetIT/statuscake/doc.go b/vendor/github.com/DreamItGetIT/statuscake/doc.go index fa68d94..d45680e 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/doc.go +++ b/vendor/github.com/DreamItGetIT/statuscake/doc.go | |||
@@ -11,6 +11,13 @@ | |||
11 | // log.Fatal(err) | 11 | // log.Fatal(err) |
12 | // } | 12 | // } |
13 | // | 13 | // |
14 | // v := url.Values{} | ||
15 | // v.Set("tags", "test1,test2") | ||
16 | // testsWithFilter, err := c.Tests().AllWithFilter(v) | ||
17 | // if err != nil { | ||
18 | // log.Fatal(err) | ||
19 | // } | ||
20 | // | ||
14 | // // delete a `Test` | 21 | // // delete a `Test` |
15 | // err = c.Tests().Delete(TestID) | 22 | // err = c.Tests().Delete(TestID) |
16 | // | 23 | // |
@@ -25,7 +32,10 @@ | |||
25 | // log.Fatal(err) | 32 | // log.Fatal(err) |
26 | // } | 33 | // } |
27 | // | 34 | // |
28 | // t2 := c.Tests().Update(t) | 35 | // t2, err := c.Tests().Update(t) |
36 | // if err != nil { | ||
37 | // log.Fatal(err) | ||
38 | // } | ||
29 | // fmt.Printf("New Test created with id: %d\n", t2.TestID) | 39 | // fmt.Printf("New Test created with id: %d\n", t2.TestID) |
30 | // | 40 | // |
31 | // // get Tests details | 41 | // // get Tests details |
diff --git a/vendor/github.com/DreamItGetIT/statuscake/makefile b/vendor/github.com/DreamItGetIT/statuscake/makefile index 946f6d9..6149bbf 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/makefile +++ b/vendor/github.com/DreamItGetIT/statuscake/makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | .PHONY: default lint test | 1 | .PHONY: default deps lint test |
2 | 2 | ||
3 | default: lint test | 3 | default: deps lint test |
4 | 4 | ||
5 | lint: | 5 | lint: |
6 | @golint ./... | 6 | @golint ./... |
@@ -9,3 +9,5 @@ lint: | |||
9 | test: | 9 | test: |
10 | go test ${GOTEST_ARGS} ./... | 10 | go test ${GOTEST_ARGS} ./... |
11 | 11 | ||
12 | deps: | ||
13 | dep ensure \ No newline at end of file | ||
diff --git a/vendor/github.com/DreamItGetIT/statuscake/responses.go b/vendor/github.com/DreamItGetIT/statuscake/responses.go index e8d4af4..ec74a63 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/responses.go +++ b/vendor/github.com/DreamItGetIT/statuscake/responses.go | |||
@@ -61,6 +61,7 @@ type detailResponse struct { | |||
61 | UseJar int `json:"UseJar"` | 61 | UseJar int `json:"UseJar"` |
62 | PostRaw string `json:"PostRaw"` | 62 | PostRaw string `json:"PostRaw"` |
63 | FinalEndpoint string `json:"FinalEndpoint"` | 63 | FinalEndpoint string `json:"FinalEndpoint"` |
64 | EnableSSLWarning bool `json:"EnableSSLWarning"` | ||
64 | FollowRedirect bool `json:"FollowRedirect"` | 65 | FollowRedirect bool `json:"FollowRedirect"` |
65 | StatusCodes []string `json:"StatusCodes"` | 66 | StatusCodes []string `json:"StatusCodes"` |
66 | } | 67 | } |
@@ -96,6 +97,7 @@ func (d *detailResponse) test() *Test { | |||
96 | UseJar: d.UseJar, | 97 | UseJar: d.UseJar, |
97 | PostRaw: d.PostRaw, | 98 | PostRaw: d.PostRaw, |
98 | FinalEndpoint: d.FinalEndpoint, | 99 | FinalEndpoint: d.FinalEndpoint, |
100 | EnableSSLAlert: d.EnableSSLWarning, | ||
99 | FollowRedirect: d.FollowRedirect, | 101 | FollowRedirect: d.FollowRedirect, |
100 | StatusCodes: strings.Join(d.StatusCodes[:], ","), | 102 | StatusCodes: strings.Join(d.StatusCodes[:], ","), |
101 | } | 103 | } |
diff --git a/vendor/github.com/DreamItGetIT/statuscake/tests.go b/vendor/github.com/DreamItGetIT/statuscake/tests.go index c6e6dd2..2a2383d 100644 --- a/vendor/github.com/DreamItGetIT/statuscake/tests.go +++ b/vendor/github.com/DreamItGetIT/statuscake/tests.go | |||
@@ -42,7 +42,7 @@ type Test struct { | |||
42 | // Current status at last test | 42 | // Current status at last test |
43 | Status string `json:"Status"` | 43 | Status string `json:"Status"` |
44 | 44 | ||
45 | // 7 Day Uptime | 45 | // 1 Day Uptime |
46 | Uptime float64 `json:"Uptime"` | 46 | Uptime float64 `json:"Uptime"` |
47 | 47 | ||
48 | // Any test locations seperated by a comma (using the Node Location IDs) | 48 | // Any test locations seperated by a comma (using the Node Location IDs) |
@@ -75,7 +75,7 @@ type Test struct { | |||
75 | Branding int `json:"Branding" querystring:"Branding"` | 75 | Branding int `json:"Branding" querystring:"Branding"` |
76 | 76 | ||
77 | // Used internally by the statuscake API | 77 | // Used internally by the statuscake API |
78 | WebsiteHost string `json:"WebsiteHost"` | 78 | WebsiteHost string `json:"WebsiteHost" querystring:"WebsiteHost"` |
79 | 79 | ||
80 | // Enable virus checking or not. 1 to enable | 80 | // Enable virus checking or not. 1 to enable |
81 | Virus int `json:"Virus" querystring:"Virus"` | 81 | Virus int `json:"Virus" querystring:"Virus"` |
@@ -110,6 +110,9 @@ type Test struct { | |||
110 | // Use to specify the expected Final URL in the testing process | 110 | // Use to specify the expected Final URL in the testing process |
111 | FinalEndpoint string `json:"FinalEndpoint" querystring:"FinalEndpoint"` | 111 | FinalEndpoint string `json:"FinalEndpoint" querystring:"FinalEndpoint"` |
112 | 112 | ||
113 | // Use to enable SSL validation | ||
114 | EnableSSLAlert bool `json:"EnableSSLAlert" querystring:"EnableSSLAlert"` | ||
115 | |||
113 | // Use to specify whether redirects should be followed | 116 | // Use to specify whether redirects should be followed |
114 | FollowRedirect bool `json:"FollowRedirect" querystring:"FollowRedirect"` | 117 | FollowRedirect bool `json:"FollowRedirect" querystring:"FollowRedirect"` |
115 | } | 118 | } |
@@ -166,9 +169,11 @@ func (t *Test) Validate() error { | |||
166 | e["FinalEndpoint"] = "must be a Valid URL" | 169 | e["FinalEndpoint"] = "must be a Valid URL" |
167 | } | 170 | } |
168 | 171 | ||
169 | var jsonVerifiable map[string]interface{} | 172 | if t.CustomHeader != "" { |
170 | if json.Unmarshal([]byte(t.CustomHeader), &jsonVerifiable) != nil { | 173 | var jsonVerifiable map[string]interface{} |
171 | e["CustomHeader"] = "must be provided as json string" | 174 | if json.Unmarshal([]byte(t.CustomHeader), &jsonVerifiable) != nil { |
175 | e["CustomHeader"] = "must be provided as json string" | ||
176 | } | ||
172 | } | 177 | } |
173 | 178 | ||
174 | if len(e) > 0 { | 179 | if len(e) > 0 { |
@@ -244,6 +249,7 @@ func valueToQueryStringValue(v reflect.Value) string { | |||
244 | // Tests is a client that implements the `Tests` API. | 249 | // Tests is a client that implements the `Tests` API. |
245 | type Tests interface { | 250 | type Tests interface { |
246 | All() ([]*Test, error) | 251 | All() ([]*Test, error) |
252 | AllWithFilter(url.Values) ([]*Test, error) | ||
247 | Detail(int) (*Test, error) | 253 | Detail(int) (*Test, error) |
248 | Update(*Test) (*Test, error) | 254 | Update(*Test) (*Test, error) |
249 | Delete(TestID int) error | 255 | Delete(TestID int) error |
@@ -272,6 +278,19 @@ func (tt *tests) All() ([]*Test, error) { | |||
272 | return tests, err | 278 | return tests, err |
273 | } | 279 | } |
274 | 280 | ||
281 | func (tt *tests) AllWithFilter(filterOptions url.Values) ([]*Test, error) { | ||
282 | resp, err := tt.client.get("/Tests", filterOptions) | ||
283 | if err != nil { | ||
284 | return nil, err | ||
285 | } | ||
286 | defer resp.Body.Close() | ||
287 | |||
288 | var tests []*Test | ||
289 | err = json.NewDecoder(resp.Body).Decode(&tests) | ||
290 | |||
291 | return tests, err | ||
292 | } | ||
293 | |||
275 | func (tt *tests) Update(t *Test) (*Test, error) { | 294 | func (tt *tests) Update(t *Test) (*Test, error) { |
276 | resp, err := tt.client.put("/Tests/Update", t.ToURLValues()) | 295 | resp, err := tt.client.put("/Tests/Update", t.ToURLValues()) |
277 | if err != nil { | 296 | if err != nil { |
diff --git a/vendor/modules.txt b/vendor/modules.txt index e083517..b1009a7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt | |||
@@ -6,7 +6,7 @@ cloud.google.com/go/internal/optional | |||
6 | cloud.google.com/go/internal/trace | 6 | cloud.google.com/go/internal/trace |
7 | cloud.google.com/go/internal/version | 7 | cloud.google.com/go/internal/version |
8 | cloud.google.com/go/compute/metadata | 8 | cloud.google.com/go/compute/metadata |
9 | # github.com/DreamItGetIT/statuscake v0.0.0-20180728152938-85edefcbdaa3 | 9 | # github.com/DreamItGetIT/statuscake v0.0.0-20190218105717-471b24d8edfb |
10 | github.com/DreamItGetIT/statuscake | 10 | github.com/DreamItGetIT/statuscake |
11 | # github.com/agext/levenshtein v1.2.2 | 11 | # github.com/agext/levenshtein v1.2.2 |
12 | github.com/agext/levenshtein | 12 | github.com/agext/levenshtein |
diff --git a/website/docs/r/test.html.markdown b/website/docs/r/test.html.markdown index 6c65f10..f5cc5e0 100644 --- a/website/docs/r/test.html.markdown +++ b/website/docs/r/test.html.markdown | |||
@@ -29,8 +29,8 @@ The following arguments are supported: | |||
29 | * `website_name` - (Required) This is the name of the test and the website to be monitored. | 29 | * `website_name` - (Required) This is the name of the test and the website to be monitored. |
30 | * `website_url` - (Required) The URL of the website to be monitored | 30 | * `website_url` - (Required) The URL of the website to be monitored |
31 | * `check_rate` - (Optional) Test check rate in seconds. Defaults to 300 | 31 | * `check_rate` - (Optional) Test check rate in seconds. Defaults to 300 |
32 | * `contact_id` - **Deprecated** (Optional) The id of the contact group to be added to the test. Each test can have only one. | 32 | * `contact_id` - **Deprecated** (Optional) The id of the contact group to be added to the test. Each test can have only one. |
33 | * `contact_group` - (Optional) Set test contact groups, must be array of strings. | 33 | * `contact_group` - (Optional) Set test contact groups, must be array of strings. |
34 | * `test_type` - (Required) The type of Test. Either HTTP, TCP, PING, or DNS | 34 | * `test_type` - (Required) The type of Test. Either HTTP, TCP, PING, or DNS |
35 | * `paused` - (Optional) Whether or not the test is paused. Defaults to false. | 35 | * `paused` - (Optional) Whether or not the test is paused. Defaults to false. |
36 | * `timeout` - (Optional) The timeout of the test in seconds. | 36 | * `timeout` - (Optional) The timeout of the test in seconds. |
@@ -56,6 +56,7 @@ The following arguments are supported: | |||
56 | * `use_jar` - (Optional) Set to true to enable the Cookie Jar. Required for some redirects. Default is false. | 56 | * `use_jar` - (Optional) Set to true to enable the Cookie Jar. Required for some redirects. Default is false. |
57 | * `post_raw` - (Optional) Use to populate the RAW POST data field on the test. | 57 | * `post_raw` - (Optional) Use to populate the RAW POST data field on the test. |
58 | * `final_endpoint` - (Optional) Use to specify the expected Final URL in the testing process. | 58 | * `final_endpoint` - (Optional) Use to specify the expected Final URL in the testing process. |
59 | * `enable_ssl_alert` - (Optional) HTTP Tests only. If enabled, tests will send warnings if the SSL certificate is about to expire. Paid users only. Default is false | ||
59 | * `follow_redirect` - (Optional) Use to specify whether redirects should be followed, set to true to enable. Default is false. | 60 | * `follow_redirect` - (Optional) Use to specify whether redirects should be followed, set to true to enable. Default is false. |
60 | 61 | ||
61 | ## Attributes Reference | 62 | ## Attributes Reference |