Skip to content

Commit

Permalink
added vlb nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
happytreees committed Jul 10, 2023
1 parent b36999e commit 2f22669
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type LoadBalancer struct {
IPV4 string `json:"ipv4,omitempty"`
IPV6 string `json:"ipv6,omitempty"`
Instances []string `json:"instances,omitempty"`
Nodes int `json:"nodes,omitempty"`
HealthCheck *HealthCheck `json:"health_check,omitempty"`
GenericInfo *GenericInfo `json:"generic_info,omitempty"`
SSLInfo *bool `json:"has_ssl,omitempty"`
Expand All @@ -52,7 +53,8 @@ type LoadBalancer struct {
type LoadBalancerReq struct {
Region string `json:"region,omitempty"`
Label string `json:"label,omitempty"`
Instances []string `json:"instances"`
Instances []string `json:"instances,omitempty"`
Nodes int `json:"nodes,omitempty"`
HealthCheck *HealthCheck `json:"health_check,omitempty"`
StickySessions *StickySessions `json:"sticky_session,omitempty"`
ForwardingRules []ForwardingRule `json:"forwarding_rules,omitempty"`
Expand Down
8 changes: 8 additions & 0 deletions load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func TestLoadBalancerHandler_List(t *testing.T) {
"ip_type": "v4"
}
],
"nodes": 3,
"instances": [
"12345"
]
Expand Down Expand Up @@ -122,6 +123,7 @@ func TestLoadBalancerHandler_List(t *testing.T) {
HealthyThreshold: 5,
},
Instances: []string{"12345"},
Nodes: 3,
FirewallRules: []LBFirewallRule{
{
RuleID: "abcd12345",
Expand Down Expand Up @@ -215,6 +217,7 @@ func TestLoadBalancerHandler_Get(t *testing.T) {
"ip_type": "v4"
}
],
"nodes": 3,
"instances": [
"12345"
]
Expand Down Expand Up @@ -268,6 +271,7 @@ func TestLoadBalancerHandler_Get(t *testing.T) {
HealthyThreshold: 5,
},
Instances: []string{"12345"},
Nodes: 3,
FirewallRules: []LBFirewallRule{
{
RuleID: "abcd12345",
Expand Down Expand Up @@ -453,6 +457,7 @@ func TestLoadBalancerHandler_Create(t *testing.T) {
"ip_type": "v4"
}
],
"nodes": 3,
"instances": [
"1234"
]
Expand All @@ -477,6 +482,7 @@ func TestLoadBalancerHandler_Create(t *testing.T) {
BalancingAlgorithm: "roundrobin",
SSLRedirect: BoolToBoolPtr(false),
ProxyProtocol: BoolToBoolPtr(false),
Nodes: 3,
PrivateNetwork: StringToStringPtr("8d5bdbdb-3324-4d0c-b303-03e1315e1c02"),
VPC: StringToStringPtr("8d5bdbdb-3324-4d0c-b303-03e1315e1c02"),
HealthCheck: &HealthCheck{
Expand Down Expand Up @@ -533,6 +539,7 @@ func TestLoadBalancerHandler_Create(t *testing.T) {
HealthyThreshold: 5,
},
Instances: []string{"1234"},
Nodes: 3,
FirewallRules: []LBFirewallRule{
{
RuleID: "abcd12345",
Expand Down Expand Up @@ -573,6 +580,7 @@ func TestLoadBalancerHandler_Update(t *testing.T) {
ProxyProtocol: BoolToBoolPtr(false),
PrivateNetwork: StringToStringPtr("8d5bdbdb-3324-4d0c-b303-03e1315e1c02"),
VPC: StringToStringPtr("8d5bdbdb-3324-4d0c-b303-03e1315e1c02"),
Nodes: 5,
HealthCheck: &HealthCheck{
Protocol: "http",
Port: 80,
Expand Down

0 comments on commit 2f22669

Please sign in to comment.