This commit is contained in:
arsvolkov committed 2026-08-21 19:04:19 +04:00
1 parent f34fa6055c
commit 3c5157281e
1285 files changed
+4016 -3302

No files matched your search

@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// AddCustomBackupPathRequest struct to add new path to the list of custom backup paths
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ChangeSettingsRequest struct to change grid settings
@@ -1,46 +0,0 @@
package grid
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// ExecuteMaintenanceScriptRequest struct to execute script
type ExecuteMaintenanceScriptRequest struct {
// Grid (platform) ID
// Required: true
GID uint64 `url:"gid" json:"gid" validate:"required"`
// Type of nodes you want to apply the action on
// Required: true
NodesType string `url:"nodestype" json:"nodestype" validate:"required"`
// The script you want to run
// Required: true
Script string `url:"script" json:"script" validate:"required"`
}
// ExecuteMaintenanceScript executes maintenance script
func (g Grid) ExecuteMaintenanceScript(ctx context.Context, req ExecuteMaintenanceScriptRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/grid/executeMaintenanceScript"
res, err := g.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
}
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetRequest struct to get grid details
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetBackupRequest struct to get backup
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetDiagnosisRequest struct to get platform snapshot with additional diagnosis
@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetResourceConsumptionRequest struct to get resource consumption
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetSettingsRequest struct to get grid settings
+1 -1
View File
@@ -2,7 +2,7 @@
package grid
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/interfaces"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/interfaces"
)
// Structure for creating request to grid
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ListRequest struct to get list of locations
-37
View File
@@ -1,37 +0,0 @@
package grid
import (
"context"
"encoding/json"
"net/http"
)
// ListEmailsRequest struct for getting list of email addresses of users
type ListEmailsRequest struct {
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListEmails returns list of email addresses of users
func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error) {
url := "/cloudbroker/grid/listEmails"
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
list := ListEmails{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
+6
View File
@@ -226,6 +226,12 @@ type RecordSettingsGrid struct {
//Prometheus
Prometheus Prometheus `json:"prometheus"`
//Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
//Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
//Vins max prereservation num
VinsMaxPreReservationsNum int `json:"vinsMaxPreReservationsNum"`
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// PurgeLogsRequest struct to purge logs
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// RemoveCustomBackupPathRequest struct to remove path from the list of custom backup paths
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// RenameRequest struct to rename grid
+1 -1
View File
@@ -3,7 +3,7 @@ package grid
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/serialization"
)
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
-42
View File
@@ -1,42 +0,0 @@
package grid
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// ServicesRestartRequest struct to restart services
type ServicesRestartRequest struct {
// Grid (platform) ID
// Required: true
GID uint64 `url:"gid" json:"gid" validate:"required"`
// Node ID
// Required: true
NID uint64 `url:"nid" json:"nid" validate:"required"`
}
// ServicesRestart restarts decort services on the node
func (g Grid) ServicesRestart(ctx context.Context, req ServicesRestartRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/grid/servicesRestart"
res, err := g.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
}
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetCPUAllocationParameterRequest for setting CPU allocation parameter
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetCPUAllocationRatioRequest struct to set allocation
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetMemAllocationRatioRequest struct to set memory allocation
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetPasswordPolicyRequest struct to set password policy for a grid
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SetResourcesLimitRequest struct to set resources limit