This commit is contained in:
2026-08-21 18:12:55 +04:00
parent f34fa6055c
commit c296c62a0c
1285 changed files with 3959 additions and 3249 deletions

View File

@@ -1,43 +0,0 @@
package sep
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// AccessGrantRequest struct to grant access to SEP
type AccessGrantRequest struct {
// Storage endpoint provider ID
// Required: true
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Account ID to grant access to the specified SEP. If 0,
// the SEP will be available for all accounts with no exceptions
// Required: true
AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
}
// AccessGrant grants access to SEP
func (s SEP) AccessGrant(ctx context.Context, req AccessGrantRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/accessGrant"
res, err := s.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

@@ -1,50 +0,0 @@
package sep
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// AccessGrantToPoolRequest struct to grant access to pool SEP
type AccessGrantToPoolRequest struct {
// Storage endpoint provider ID
// Required: true
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Pool name
// Required: true
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
// Account ID to grant access to the specified pool SEP
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
// Resource group to grant access to the specified pool SEP
// Required: false
RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
}
// AccessGrantToPool grants access to pool SEP
func (s SEP) AccessGrantToPool(ctx context.Context, req AccessGrantToPoolRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/accessGrantToPool"
res, err := s.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

@@ -1,42 +0,0 @@
package sep
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// AccessRevokeRequest struct to revoke access to SEP
type AccessRevokeRequest struct {
// Storage endpoint provider ID
// Required: true
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Account ID to revoke access to the specified SEP
// Required: true
AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
}
// AccessRevoke revokes access to SEP
func (s SEP) AccessRevoke(ctx context.Context, req AccessRevokeRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/accessRevoke"
res, err := s.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

@@ -1,50 +0,0 @@
package sep
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// AccessRevokeToPoolRequest struct to revoke access to pool SEP
type AccessRevokeToPoolRequest struct {
// Storage endpoint provider ID
// Required: true
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Pool name
// Required: true
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
// Account ID to grant access to the specified pool SEP
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
// Resource group ID to grant access to the specified pool SEP
// Required: false
RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
}
// AccessRevokeToPool revokes access to pool SEP
func (s SEP) AccessRevokeToPool(ctx context.Context, req AccessRevokeToPoolRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/accessRevokeToPool"
res, err := s.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

@@ -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"
)
// AddConsumerNodesRequest struct to add consumer nodes

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// AddPoolRequest struct to add pool to storage endpoint (SEP)

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"
)
// AddProviderNodesRequest struct to add provider nodes

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"
)
// ConfigFieldEditRequest struct to edit config fields

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"
)
// ConfigInsertRequest struct to insert config

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"
)
// ConfigValidateRequest struct to validate config

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"
)
// ConsumptionRequest struct to get consumption info

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"
)
// CreateRequest struct to create SEP object

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"
)
// DecommissionRequest struct for decommission

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"
)
// DelConsumerNodesRequest struct to exclude consumer nodes

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"
)
// DelPoolRequest struct to delete pool from storage endpoint (SEP)

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"
)
// DeleteRequest struct to delete SEP

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

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"
)
// DiskListRequest struct to get list of disk IDs

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

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 SEP parameters

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"
)
// GetConfigRequest struct to get SEP config

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"
)
// GetPoolRequest struct to get SEP pool config by name

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"
)
// GetTemplateRequest struct to get template of SEP

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 SEPs

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"
)
// ListAvailableSEPAndPoolsRequest struct to get dict with entry count and list of dict with SEPs and pools details accessible by the Account and RG

View File

@@ -2,7 +2,7 @@
package sep
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/interfaces"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/interfaces"
)
// Structure for creating request to storage endpoint provider

View File

@@ -3,7 +3,7 @@ package sep
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.

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SharedLockStartRequest struct to start shared locks

View File

@@ -6,7 +6,7 @@ import (
"strconv"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// SharedLockStopRequest struct to stop shared locks

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"
)
// UpdateRequest struct to update SEP object