This commit is contained in:
2023-10-25 17:37:18 +03:00
parent b666789c7d
commit 4120cd2b1a
639 changed files with 2010 additions and 3224 deletions

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request for allocating VGPU
// AllocateRequest struct for allocating VGPU
type AllocateRequest struct {
// Virtual GPU ID
// Required: true
@@ -18,9 +18,7 @@ type AllocateRequest struct {
func (v VGPU) Allocate(ctx context.Context, req AllocateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return false, validators.ValidationError(validationError)
}
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/vgpu/allocate"

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request struct for creating VGPU
// CreateRequest struct for creating VGPU
type CreateRequest struct {
// ID of pGPU
// Required: true
@@ -30,9 +30,7 @@ type CreateRequest struct {
func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return 0, validators.ValidationError(validationError)
}
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/vgpu/create"

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request for deallocating VGPU
// DeallocateRequest struct for deallocating VGPU
type DeallocateRequest struct {
// Virtual GPU ID
// Required: true
@@ -22,9 +22,7 @@ type DeallocateRequest struct {
func (v VGPU) Deallocate(ctx context.Context, req DeallocateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return false, validators.ValidationError(validationError)
}
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/vgpu/deallocate"

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request for destroying VGPU
// DestroyRequest struct for destroying VGPU
type DestroyRequest struct {
// Virtual GPU ID
// Required: true
@@ -22,9 +22,7 @@ type DestroyRequest struct {
func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return false, validators.ValidationError(validationError)
}
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/vgpu/destroy"