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"
)
// AccessGrantRequest struct to grant access to resource group

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"
)
// AccessRevokeRequest struct to revoke access

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"
)
// AffinityGroupComputesRequest struct to get list of all computes with their relationships

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"
)
// AffinityGroupsGetRequest struct to get list computes from affinity group

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"
)
// AffinityGroupsListRequest struct to get list of affinity groups from resource group

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"
)
// AuditsRequest struct to get audit

View File

@@ -5,7 +5,8 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// CreateRequest struct to create resource group
@@ -22,6 +23,10 @@ type CreateRequest struct {
// Required: true
Name string `url:"name" json:"name" validate:"required,min=2"`
// Storage policies
// Required: false
StoragePolicies []StoragePolicy `url:"storage_policies" json:"storage_policies"`
// Max size of memory in MB
// Required: false
MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
@@ -71,6 +76,15 @@ type CreateRequest struct {
// External IP address
// Required: false
ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"`
// SDN access group id
// Required: false
SDNAccessGroupID string `url:"sdn_access_group_id,omitempty" json:"sdn_access_group_id,omitempty"`
}
type StoragePolicy struct {
ID uint64 `url:"id" json:"id"`
Limit int `url:"limit" json:"limit"`
}
// Create creates resource group
@@ -82,7 +96,7 @@ func (r RG) Create(ctx context.Context, req CreateRequest) (uint64, error) {
url := "/cloudapi/rg/create"
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
res, err := r.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return 0, err
}

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 resource group

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"
)
// DisableRequest struct to disable resource group

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"
)
// EnableRequest struct to enable resource group

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 resource group

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"
)
// GetResourceConsumptionRequest struct to get detailed information about resource consumption for ResGroup

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 resource groups

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"
)
// ListComputesRequest struct to get list of computes

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 deleted resource groups

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"
)
// ListLBRequest struct to get list of load balancers

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"
)
// ListPFWRequest struct to get list of port forward rules

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"
)
// ListVINSRequest struct to get list of VINSes

View File

@@ -134,6 +134,12 @@ type RecordResourceGroup struct {
// List of resource types
ResTypes []string `json:"resourceTypes"`
// Storage policy ids
StoragePolicyIDs []uint64 `json:"storage_policy_ids"`
// SDN access group id
SDNAccessGroupID string `json:"sdn_access_group_id"`
// Secret
Secret string `json:"secret"`
@@ -227,6 +233,12 @@ type ItemResourceGroup struct {
// List of resource types
ResTypes []string `json:"resourceTypes"`
// SDN access group id
SDNAccessGroupID string `json:"sdn_access_group_id"`
// Storage policy ids
StoragePolicyIDs []uint64 `json:"storage_policy_ids"`
// Secret
Secret string `json:"secret"`
@@ -302,6 +314,9 @@ type ResourceLimits struct {
// GPU units
GPUUnits float64 `json:"gpu_units"`
// Storage policies
StoragePolicies []StoragePolicy `json:"storage_policy"`
}
// Main information about affinity group

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"
)
// RemoveDefNetRequest struct to remove default network

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 resource group

View File

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

View File

@@ -3,7 +3,7 @@ package rg
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"
)
// SetDefNetRequest struct to set default network

View File

@@ -5,7 +5,8 @@ import (
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// UpdateRequest struct to update resource group
@@ -50,6 +51,10 @@ type UpdateRequest struct {
// Default: false
// Required: false
ClearUniqPools bool `url:"clearUniqPools" json:"clearUniqPools"`
// Storage policies
// Required: false
StoragePolicies []StoragePolicy `url:"-" json:"storage_policies,omitempty"`
}
// Update updates resource group
@@ -61,7 +66,7 @@ func (r RG) Update(ctx context.Context, req UpdateRequest) (bool, error) {
url := "/cloudapi/rg/update"
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
res, err := r.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}

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"
)
// UsageRequest struct to get report of resource usage