This commit is contained in:
2023-09-28 15:37:28 +03:00
parent d3e6309ef8
commit 35fa4af0d6
7 changed files with 253 additions and 82 deletions

View File

@@ -16,11 +16,11 @@ type HighlyAvailableRequest struct {
}
// Make Load Balancer Highly available
func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (uint64, error) {
func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return 0, validators.ValidationError(validationError)
return false, validators.ValidationError(validationError)
}
}
@@ -28,12 +28,12 @@ func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (ui
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return 0, err
return false, err
}
result, err := strconv.ParseUint(string(res), 10, 64)
result, err := strconv.ParseBool(string(res))
if err != nil {
return 0, err
return false, err
}
return result, nil

View File

@@ -156,6 +156,9 @@ type RecordLB struct {
// Access Control List
ACL []interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
// List of load balancer backends
Backends ListBackends `json:"backends"`
@@ -171,6 +174,9 @@ type RecordLB struct {
// External network ID
ExtNetID uint64 `json:"extnetId"`
// FrontendHAIP
FrontendHAIP string `json:"frontendHAIP"`
// List of load balancer frontends
Frontends ListFrontends `json:"frontends"`
@@ -225,6 +231,9 @@ type ItemLBList struct {
// Access Control List
ACL []interface{} `json:"acl"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
// List of load balancer backends
Backends ListBackends `json:"backends"`
@@ -252,6 +261,9 @@ type ItemLBList struct {
// External network ID
ExtNetID uint64 `json:"extnetId"`
// FrontendHAIP
FrontendHAIP string `json:"frontendHAIP"`
// List of load balancer frontends
Frontends ListFrontends `json:"frontends"`