-
Notifications
You must be signed in to change notification settings - Fork 12
/
loadbalancers.go
35 lines (30 loc) · 1.33 KB
/
loadbalancers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mdlib
import (
"fmt"
)
// LoadBalancerTargetGroup contains the name of the target group for an ALB
type LoadBalancerTargetGroup struct {
Name string `json:"name"`
}
// LoadBalancerServerGroup contains the server groups for an ELB
type LoadBalancerServerGroup struct {
Name string `json:"name"`
}
// LoadBalancer contains details about a load balancer, TargetGroups
// will be populated if it is an ALB. ServerGroups will be populated
// if it is an ELB.
type LoadBalancer struct {
Name string `json:"name"`
Account string `json:"account"`
Region string `json:"region"`
Type string `json:"type"`
LoadBalancerType string `json:"loadBalancerType"`
SecurityGroups []string `json:"securityGroups"`
ServerGroups []LoadBalancerServerGroup `json:"serverGroups"`
TargetGroups []LoadBalancerTargetGroup `json:"targetGroups"`
}
// GetLoadBalancers populates the load balancers result structure for spinnaker application appName.
// Unless a custom result type is required, *[]LoadBalancer is recommended.
func GetLoadBalancers(cli *Client, appName string, result interface{}) error {
return commonParsedGet(cli, fmt.Sprintf("/applications/%s/loadBalancers", appName), result)
}