This commit is contained in:
2026-07-17 16:55:08 +04:00
parent 3e2edf53a5
commit fe413c7182
26 changed files with 54 additions and 40 deletions

View File

@@ -8,8 +8,8 @@ type Audit struct {
}
// Builder for audit endpoint
func New(client interfaces.Caller) *Audit{
func New(client interfaces.Caller) *Audit {
return &Audit{
client: client,
}
}
}

View File

@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)

View File

@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)

View File

@@ -3,8 +3,9 @@ package compute
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// ChangeLinkStateRequest struct to change link state

View File

@@ -2,6 +2,7 @@ package pcidevice
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
)

View File

@@ -3,8 +3,9 @@ package account
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter

View File

@@ -8,8 +8,8 @@ type Audit struct {
}
// Builder for audit endpoint
func New(client interfaces.Caller) *Audit{
func New(client interfaces.Caller) *Audit {
return &Audit{
client: client,
}
}
}

View File

@@ -3,8 +3,9 @@ package compute
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// ChangeLinkStateRequest struct for changing link state

View File

@@ -3,8 +3,9 @@ package disks
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// DepresentRequest struct to depresent disk from node

View File

@@ -3,8 +3,9 @@ package disks
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// PresentRequest struct to present disk to node

View File

@@ -3,8 +3,9 @@ package grid
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// SetCPUAllocationParameterRequest for setting CPU allocation parameter

View File

@@ -3,8 +3,9 @@ package grid
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes

View File

@@ -19,7 +19,7 @@ type AccessAddRequest struct {
}
// Add accountId to sharedWith access list for k8ci.
func (k K8CI) AccessAdd (ctx context.Context, req AccessAddRequest) (string, error) {
func (k K8CI) AccessAdd(ctx context.Context, req AccessAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))

View File

@@ -19,7 +19,7 @@ type AccessRemoveRequest struct {
}
// Remove accountId from sharedWith access list for k8ci.
func (k K8CI) AccessRemove (ctx context.Context, req AccessRemoveRequest) (string, error) {
func (k K8CI) AccessRemove(ctx context.Context, req AccessRemoveRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))

View File

@@ -3,8 +3,9 @@ package pcidevice
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// DeleteRequest struct to deleting PCI device

View File

@@ -3,8 +3,9 @@ package pcidevice
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// DisableRequest struct for disabling PCI device

View File

@@ -3,8 +3,9 @@ package pcidevice
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// EnableRequest struct for enabling PCI device

View File

@@ -2,6 +2,7 @@ package pcidevice
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
)

View File

@@ -3,8 +3,9 @@ package rg
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter

View File

@@ -3,8 +3,9 @@ package rg
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio

View File

@@ -2,8 +2,8 @@ package sep
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
@@ -20,23 +20,24 @@ type AddConsumerNodesRequest struct {
}
// AddConsumerNodes adds consumer nodes to SEP parameters
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) {
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) ([]uint64, error) {
err := validators.ValidateRequest(req)
list := []uint64{}
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
return list, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/addConsumerNodes"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return 0, err
return list, err
}
result, err := strconv.ParseUint(string(res), 10, 64)
err = json.Unmarshal(res, &list)
if err != nil {
return 0, err
return nil, err
}
return result, nil
return list, nil
}

View File

@@ -3,8 +3,9 @@ package vgpu
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// AllocateRequest struct for allocating VGPU

View File

@@ -3,8 +3,9 @@ package vgpu
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// CreateRequest struct for creating VGPU

View File

@@ -3,8 +3,9 @@ package vgpu
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// DeallocateRequest struct for deallocating VGPU

View File

@@ -3,8 +3,9 @@ package vgpu
import (
"context"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
)
// DestroyRequest struct for destroying VGPU