Skip to content

Commit

Permalink
Add minimum origins to load balancer pool (cloudflare#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjvi authored and elithrar committed Feb 23, 2018
1 parent 46dee6d commit 16d3478
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions load_balancing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 1 addition & 0 deletions load_balancing_example_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package cloudflare
16 changes: 9 additions & 7 deletions load_balancing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion rate_limiting_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 16d3478

Please sign in to comment.