Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added vlb nodes #250

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading