v1.6.7
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user