Documentation ¶
Index ¶
- Constants
- func AddTargetToTargetPool(targetPool *loadbalancer.TargetPool, target *loadbalancer.Target) error
- func FilterCredentials(ctx context.Context, client LoadBalancerClient, ...) ([]loadbalancer.CredentialsResponse, error)
- func FindLoadBalancerListenerByTargetPool(listeners []loadbalancer.Listener, targetPoolName string) *loadbalancer.Listener
- func FindLoadBalancerTargetPoolByName(targetPools []loadbalancer.TargetPool, targetPoolName string) *loadbalancer.TargetPool
- func GetCredentialsDisplayName(ctx context.Context, apiClient LoadBalancerClient, ...) (string, error)
- func GetLoadBalancerTargetPool(ctx context.Context, apiClient LoadBalancerClient, ...) (*loadbalancer.TargetPool, error)
- func GetTargetName(ctx context.Context, apiClient LoadBalancerClient, ...) (string, error)
- func GetUnusedObsCredentials(usedCredentials, allCredentials []loadbalancer.CredentialsResponse) []loadbalancer.CredentialsResponse
- func GetUsedObsCredentials(ctx context.Context, apiClient LoadBalancerClient, ...) ([]loadbalancer.CredentialsResponse, error)
- func RemoveTargetFromTargetPool(targetPool *loadbalancer.TargetPool, ip string) error
- func ToPayloadTargetPool(targetPool *loadbalancer.TargetPool) *loadbalancer.UpdateTargetPoolPayload
- type LoadBalancerClient
Constants ¶
const ( OP_FILTER_NOP = iota OP_FILTER_USED OP_FILTER_UNUSED )
Variables ¶
This section is empty.
Functions ¶
func AddTargetToTargetPool ¶
func AddTargetToTargetPool(targetPool *loadbalancer.TargetPool, target *loadbalancer.Target) error
func FilterCredentials ¶ added in v0.6.0
func FilterCredentials(ctx context.Context, client LoadBalancerClient, allCredentials []loadbalancer.CredentialsResponse, projectId string, filterOp int) ([]loadbalancer.CredentialsResponse, error)
FilterCredentials filters a list of credentials based on the used and unused flags. If used is true, it returns only the credentials that are used by load balancers for observability metrics or logs. If unused is true, it returns only the credentials that are not used by any load balancer for observability metrics or logs. If both used and unused are true, it returns an error. If both used and unused are false, it returns the original list of credentials.
func FindLoadBalancerListenerByTargetPool ¶
func FindLoadBalancerListenerByTargetPool(listeners []loadbalancer.Listener, targetPoolName string) *loadbalancer.Listener
func FindLoadBalancerTargetPoolByName ¶
func FindLoadBalancerTargetPoolByName(targetPools []loadbalancer.TargetPool, targetPoolName string) *loadbalancer.TargetPool
func GetLoadBalancerTargetPool ¶
func GetLoadBalancerTargetPool(ctx context.Context, apiClient LoadBalancerClient, projectId, loadBalancerName, targetPoolName string) (*loadbalancer.TargetPool, error)
func GetTargetName ¶
func GetUnusedObsCredentials ¶ added in v0.6.0
func GetUnusedObsCredentials(usedCredentials, allCredentials []loadbalancer.CredentialsResponse) []loadbalancer.CredentialsResponse
GetUnusedObsCredentials returns a list of credentials that are not used by any load balancer for observability metrics or logs. It compares the list of all credentials with the list of used credentials and returns a list of credentials that are not used.
func GetUsedObsCredentials ¶ added in v0.6.0
func GetUsedObsCredentials(ctx context.Context, apiClient LoadBalancerClient, allCredentials []loadbalancer.CredentialsResponse, projectId string) ([]loadbalancer.CredentialsResponse, error)
GetUsedObsCredentials returns a list of credentials that are used by load balancers for observability metrics or logs. It goes through all load balancers and checks what observability credentials are being used, then returns a list of those credentials.
func RemoveTargetFromTargetPool ¶
func RemoveTargetFromTargetPool(targetPool *loadbalancer.TargetPool, ip string) error
func ToPayloadTargetPool ¶
func ToPayloadTargetPool(targetPool *loadbalancer.TargetPool) *loadbalancer.UpdateTargetPoolPayload
Types ¶
type LoadBalancerClient ¶
type LoadBalancerClient interface { GetCredentialsExecute(ctx context.Context, projectId, credentialsRef string) (*loadbalancer.GetCredentialsResponse, error) GetLoadBalancerExecute(ctx context.Context, projectId, name string) (*loadbalancer.LoadBalancer, error) UpdateTargetPool(ctx context.Context, projectId, loadBalancerName, targetPoolName string) loadbalancer.ApiUpdateTargetPoolRequest ListLoadBalancersExecute(ctx context.Context, projectId string) (*loadbalancer.ListLoadBalancersResponse, error) }