This commit is contained in:
asteam
2025-09-27 01:06:15 +03:00
parent 1ccc37a104
commit cf584c8123
1175 changed files with 11022 additions and 1832 deletions

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendCreateRequest struct to create backend

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendDeleteRequest struct to delete backend

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendServerAddRequest struct to add server definition to the backend

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendServerDeleteRequest struct to delete server definition

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendServerUpdateRequest struct to update server

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// BackendUpdateRequest struct to update backend

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// ConfigResetRequest struct for reset config

View File

@@ -7,7 +7,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// CreateRequest struct to create load balancer
@@ -38,12 +38,16 @@ type CreateRequest struct {
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
// Start now Load balancer
// Required: false
Start bool `url:"start" json:"start"`
// Required: true
Start bool `url:"start" json:"start" validate:"required"`
// Text description of this load balancer
// Required: false
Description string `url:"desc,omitempty" json:"desc,omitempty"`
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
}
type wrapperCreateRequest struct {

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// DeleteRequest struct to delete load balancer

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// DisableEnableRequest struct for disable/enable load balancer

View File

@@ -3,8 +3,8 @@ package lb
import (
"context"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8s"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/interfaces"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/pkg/cloudapi/k8s"
)
// FilterByID returns ListLB with specified ID.

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// FrontendBindRequest struct for frontend bind

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// FrontendBindDeleteRequest struct to delete bind

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// FrontendBindUpdateRequest struct to update binding

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// FrontendCreateRequest struct to create frontend

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// FrontendDeleteRequest struct to delete frontend

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// GetRequest struct to get detailed information about load balancer

View File

@@ -2,7 +2,7 @@
package lb
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/interfaces"
)
// Structure for creating request to load balancer

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// ListRequest struct to get list of load balancers
@@ -50,6 +50,11 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by zone id
// Default value: 0
// Required: false
ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`

View File

@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// ListDeletedRequest struct to get list of deleted load balancers

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// HighlyAvailableRequest struct to make Load Balancer Highly available

View File

@@ -0,0 +1,42 @@
package lb
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// MigrateToZone struct to move lb to another zone
type MigrateToZoneRequest struct {
// ID of the load balancer instance to move
// Required: true
LBID uint64 `url:"lbId" json:"lbId" validate:"required"`
// ID of the zone to move
// Required: true
ZoneID uint64 `url:"zoneId" json:"zoneId" validate:"required"`
}
// MigrateToZone moves lb instance to new zone
func (l LB) MigrateToZone(ctx context.Context, req MigrateToZoneRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/lb/migrateToZone"
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}

View File

@@ -8,6 +8,9 @@ type RecordLB struct {
// Access Control List
ACL interface{} `json:"acl"`
//Account ID
AccountID uint64 `json:"accountId"`
// BackendHAIP
BackendHAIP string `json:"backendHAIP"`
@@ -84,7 +87,7 @@ type RecordLB struct {
Status string `json:"status"`
// Sysctl Params
SysctlParams interface{} `json:"sysctlParams"`
SysctlParams map[string]string `json:"sysctlParams"`
// Tech status
TechStatus string `json:"techStatus"`
@@ -100,6 +103,9 @@ type RecordLB struct {
// VINS ID
VINSID uint64 `json:"vinsId"`
// Zone ID
ZoneID uint64 `json:"zoneId"`
}
// Main information about load balancer

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// RestartRequest struct to restart load balancer

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// RestoreRequest struct to restore load balancer

View File

@@ -3,7 +3,7 @@ package lb
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/serialization"
)
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// StartRequest struct to start load balancer

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// StopRequest struct to stop load balancer

View File

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// UpdateRequest struct to update load balancer

View File

@@ -6,7 +6,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// UpdateSysctParamsRequest struct to update sysct params for lb