mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-14 04:01:09 -04:00
Update go-cloudstack dependency
This commit is contained in:
167
vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go
generated
vendored
167
vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright 2014, Sander van Harmelen
|
||||
// Copyright 2016, Sander van Harmelen
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -1067,27 +1067,23 @@ func (s *LoadBalancerService) NewListLoadBalancerRulesParams() *ListLoadBalancer
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleID(name string) (string, error) {
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleID(name string, opts ...OptionFunc) (string, error) {
|
||||
p := &ListLoadBalancerRulesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["name"] = name
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return "", fmt.Errorf("No match found for %s: %+v", name, l)
|
||||
}
|
||||
@@ -1107,13 +1103,13 @@ func (s *LoadBalancerService) GetLoadBalancerRuleID(name string) (string, error)
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleByName(name string) (*LoadBalancerRule, int, error) {
|
||||
id, err := s.GetLoadBalancerRuleID(name)
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleByName(name string, opts ...OptionFunc) (*LoadBalancerRule, int, error) {
|
||||
id, err := s.GetLoadBalancerRuleID(name, opts...)
|
||||
if err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
r, count, err := s.GetLoadBalancerRuleByID(id)
|
||||
r, count, err := s.GetLoadBalancerRuleByID(id, opts...)
|
||||
if err != nil {
|
||||
return nil, count, err
|
||||
}
|
||||
@@ -1121,12 +1117,18 @@ func (s *LoadBalancerService) GetLoadBalancerRuleByName(name string) (*LoadBalan
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleByID(id string) (*LoadBalancerRule, int, error) {
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleByID(id string, opts ...OptionFunc) (*LoadBalancerRule, int, error) {
|
||||
p := &ListLoadBalancerRulesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -1137,21 +1139,6 @@ func (s *LoadBalancerService) GetLoadBalancerRuleByID(id string) (*LoadBalancerR
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
"Invalid parameter id value=%s due to incorrect long value format, "+
|
||||
"or entity does not exist", id)) {
|
||||
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
@@ -1305,12 +1292,18 @@ func (s *LoadBalancerService) NewListLBStickinessPoliciesParams() *ListLBStickin
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLBStickinessPolicyByID(id string) (*LBStickinessPolicy, int, error) {
|
||||
func (s *LoadBalancerService) GetLBStickinessPolicyByID(id string, opts ...OptionFunc) (*LBStickinessPolicy, int, error) {
|
||||
p := &ListLBStickinessPoliciesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLBStickinessPolicies(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -1460,12 +1453,18 @@ func (s *LoadBalancerService) NewListLBHealthCheckPoliciesParams() *ListLBHealth
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLBHealthCheckPolicyByID(id string) (*LBHealthCheckPolicy, int, error) {
|
||||
func (s *LoadBalancerService) GetLBHealthCheckPolicyByID(id string, opts ...OptionFunc) (*LBHealthCheckPolicy, int, error) {
|
||||
p := &ListLBHealthCheckPoliciesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLBHealthCheckPolicies(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -1960,13 +1959,19 @@ func (s *LoadBalancerService) NewListLoadBalancerRuleInstancesParams(id string)
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleInstanceByID(id string) (*LoadBalancerRuleInstance, int, error) {
|
||||
func (s *LoadBalancerService) GetLoadBalancerRuleInstanceByID(id string, opts ...OptionFunc) (*LoadBalancerRuleInstance, int, error) {
|
||||
p := &ListLoadBalancerRuleInstancesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLoadBalancerRuleInstances(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -3656,27 +3661,23 @@ func (s *LoadBalancerService) NewListGlobalLoadBalancerRulesParams() *ListGlobal
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleID(keyword string) (string, error) {
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleID(keyword string, opts ...OptionFunc) (string, error) {
|
||||
p := &ListGlobalLoadBalancerRulesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["keyword"] = keyword
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListGlobalLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListGlobalLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return "", fmt.Errorf("No match found for %s: %+v", keyword, l)
|
||||
}
|
||||
@@ -3696,13 +3697,13 @@ func (s *LoadBalancerService) GetGlobalLoadBalancerRuleID(keyword string) (strin
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByName(name string) (*GlobalLoadBalancerRule, int, error) {
|
||||
id, err := s.GetGlobalLoadBalancerRuleID(name)
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByName(name string, opts ...OptionFunc) (*GlobalLoadBalancerRule, int, error) {
|
||||
id, err := s.GetGlobalLoadBalancerRuleID(name, opts...)
|
||||
if err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
r, count, err := s.GetGlobalLoadBalancerRuleByID(id)
|
||||
r, count, err := s.GetGlobalLoadBalancerRuleByID(id, opts...)
|
||||
if err != nil {
|
||||
return nil, count, err
|
||||
}
|
||||
@@ -3710,12 +3711,18 @@ func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByName(name string) (*Glo
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByID(id string) (*GlobalLoadBalancerRule, int, error) {
|
||||
func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByID(id string, opts ...OptionFunc) (*GlobalLoadBalancerRule, int, error) {
|
||||
p := &ListGlobalLoadBalancerRulesParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListGlobalLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -3726,21 +3733,6 @@ func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByID(id string) (*GlobalL
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListGlobalLoadBalancerRules(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
"Invalid parameter id value=%s due to incorrect long value format, "+
|
||||
"or entity does not exist", id)) {
|
||||
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
@@ -4416,27 +4408,23 @@ func (s *LoadBalancerService) NewListLoadBalancersParams() *ListLoadBalancersPar
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerID(name string) (string, error) {
|
||||
func (s *LoadBalancerService) GetLoadBalancerID(name string, opts ...OptionFunc) (string, error) {
|
||||
p := &ListLoadBalancersParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["name"] = name
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLoadBalancers(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListLoadBalancers(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return "", fmt.Errorf("No match found for %s: %+v", name, l)
|
||||
}
|
||||
@@ -4456,13 +4444,13 @@ func (s *LoadBalancerService) GetLoadBalancerID(name string) (string, error) {
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerByName(name string) (*LoadBalancer, int, error) {
|
||||
id, err := s.GetLoadBalancerID(name)
|
||||
func (s *LoadBalancerService) GetLoadBalancerByName(name string, opts ...OptionFunc) (*LoadBalancer, int, error) {
|
||||
id, err := s.GetLoadBalancerID(name, opts...)
|
||||
if err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
r, count, err := s.GetLoadBalancerByID(id)
|
||||
r, count, err := s.GetLoadBalancerByID(id, opts...)
|
||||
if err != nil {
|
||||
return nil, count, err
|
||||
}
|
||||
@@ -4470,12 +4458,18 @@ func (s *LoadBalancerService) GetLoadBalancerByName(name string) (*LoadBalancer,
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *LoadBalancerService) GetLoadBalancerByID(id string) (*LoadBalancer, int, error) {
|
||||
func (s *LoadBalancerService) GetLoadBalancerByID(id string, opts ...OptionFunc) (*LoadBalancer, int, error) {
|
||||
p := &ListLoadBalancersParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListLoadBalancers(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
@@ -4486,21 +4480,6 @@ func (s *LoadBalancerService) GetLoadBalancerByID(id string) (*LoadBalancer, int
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
// If no matches, search all projects
|
||||
p.p["projectid"] = "-1"
|
||||
|
||||
l, err = s.ListLoadBalancers(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
"Invalid parameter id value=%s due to incorrect long value format, "+
|
||||
"or entity does not exist", id)) {
|
||||
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
if l.Count == 0 {
|
||||
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user