v1.6.7
This commit is contained in:
@@ -7,20 +7,18 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request struct for enabling PCI device
|
||||
// EnableRequest struct for enabling PCI device
|
||||
type EnableRequest struct {
|
||||
// PCI device ID
|
||||
// Required: true
|
||||
DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"`
|
||||
}
|
||||
|
||||
// Enable PCI device
|
||||
// Enable enables PCI device
|
||||
func (p PCIDevice) Enable(ctx context.Context, req EnableRequest) (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/pcidevice/enable"
|
||||
|
||||
Reference in New Issue
Block a user