This commit is contained in:
2024-04-16 14:26:06 +03:00
parent bc264c4d90
commit e7c968797b
298 changed files with 11066 additions and 398 deletions

View File

@@ -10,8 +10,6 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type Params []string
// CreateRequest struct to create load balancer
type CreateRequest struct {
// ID of the resource group where this load balancer instance will be located
@@ -33,7 +31,7 @@ type CreateRequest struct {
// Custom sysctl values for Load Balancer instance. Applied on boot
// Required: false
SysctlParams Params `url:"-" json:"sysctlParams,omitempty" validate:"omitempty,dive"`
SysctlParams []map[string]interface{} `url:"-" json:"sysctlParams,omitempty" validate:"omitempty,dive"`
// Use Highly Available schema for LB deploy
// Required: false
@@ -68,14 +66,12 @@ func (l LB) Create(ctx context.Context, req CreateRequest) (uint64, error) {
if len(req.SysctlParams) != 0 {
params = make([]string, 0, len(req.SysctlParams))
for r := range req.SysctlParams {
b, err := json.Marshal(req.SysctlParams[r])
for _, m := range req.SysctlParams {
encodeStr, err := json.Marshal(m)
if err != nil {
return 0, err
}
params = append(params, string(b))
params = append(params, string(encodeStr))
}
} else {
params = []string{}