diff --git a/load_balancing.go b/load_balancing.go index 1516da8013..9b398c8801 100644 --- a/load_balancing.go +++ b/load_balancing.go @@ -15,6 +15,7 @@ type LoadBalancerPool struct { Description string `json:"description"` Name string `json:"name"` Enabled bool `json:"enabled"` + MinimumOrigins int `json:"minimum_origins,omitempty"` Monitor string `json:"monitor,omitempty"` Origins []LoadBalancerOrigin `json:"origins"` NotificationEmail string `json:"notification_email,omitempty"` diff --git a/load_balancing_example_test.go b/load_balancing_example_test.go new file mode 100644 index 0000000000..9235e63722 --- /dev/null +++ b/load_balancing_example_test.go @@ -0,0 +1 @@ +package cloudflare diff --git a/load_balancing_test.go b/load_balancing_test.go index 580786b5e8..ace8ffe151 100644 --- a/load_balancing_test.go +++ b/load_balancing_test.go @@ -49,6 +49,7 @@ func TestCreateLoadBalancerPool(t *testing.T) { "description": "Primary data center - Provider XYZ", "name": "primary-dc-1", "enabled": true, + "minimum_origins": 1, "monitor": "f1aba936b94213e5b8dca0c0dbf1f9cc", "origins": [ { @@ -69,13 +70,14 @@ func TestCreateLoadBalancerPool(t *testing.T) { createdOn, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z") modifiedOn, _ := time.Parse(time.RFC3339, "2014-02-01T05:20:00.12345Z") want := LoadBalancerPool{ - ID: "17b5962d775c646f3f9725cbc7a53df4", - CreatedOn: &createdOn, - ModifiedOn: &modifiedOn, - Description: "Primary data center - Provider XYZ", - Name: "primary-dc-1", - Enabled: true, - Monitor: "f1aba936b94213e5b8dca0c0dbf1f9cc", + ID: "17b5962d775c646f3f9725cbc7a53df4", + CreatedOn: &createdOn, + ModifiedOn: &modifiedOn, + Description: "Primary data center - Provider XYZ", + Name: "primary-dc-1", + Enabled: true, + MinimumOrigins: 1, + Monitor: "f1aba936b94213e5b8dca0c0dbf1f9cc", Origins: []LoadBalancerOrigin{ { Name: "app-server-1", diff --git a/rate_limiting_example_test.go b/rate_limiting_example_test.go index ae96c1a006..8ce7c64122 100644 --- a/rate_limiting_example_test.go +++ b/rate_limiting_example_test.go @@ -73,7 +73,7 @@ func ExampleAPI_ListRateLimits() { } } -func ExampleAPI_GetRateLimit() { +func ExampleAPI_RateLimit() { api, err := cloudflare.New(apiKey, user) if err != nil { log.Fatal(err)