v1.12.9
This commit is contained in:
@@ -165,11 +165,11 @@ func flipgroupClientTypeValidator(fe validator.FieldLevel) bool {
|
||||
return IsInSlice(fieldValue, flipgroupClientTypeValues)
|
||||
}
|
||||
|
||||
// kvmNetTypeValidator is used to validate NetType field.
|
||||
func kvmNetTypeValidator(fe validator.FieldLevel) bool {
|
||||
// massCreateTypeValidator is used to validate net type field when mass creating kvm
|
||||
func massCreateTypeValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
|
||||
return IsInSlice(fieldValue, kvmNetTypeValues)
|
||||
return IsInSlice(fieldValue, massCreateNetTypeValues)
|
||||
}
|
||||
|
||||
// lbAlgorithmValidator is used to validate Algorithm field.
|
||||
@@ -426,6 +426,13 @@ func deviceValidator(fe validator.FieldLevel) bool {
|
||||
return IsInSlice(fieldValue, deviceValues)
|
||||
}
|
||||
|
||||
// ipTypesValidator is used to validate ip types version fields
|
||||
func ipTypesValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
|
||||
return IsInSlice(fieldValue, ipTypeValues)
|
||||
}
|
||||
|
||||
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
|
||||
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
|
||||
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
|
||||
@@ -457,3 +464,10 @@ func trunkTagsValidator(fe validator.FieldLevel) bool {
|
||||
}
|
||||
return uint64(numFieldValue) >= uint64(trunkTagsMin) && uint64(numFieldValue) <= uint64(trunkTagsMax)
|
||||
}
|
||||
|
||||
// addressPoolNetTypeValidator is used to validate NetAddressType fields
|
||||
func addressPoolNetTypeValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
|
||||
return IsInSlice(fieldValue, addressPoolNetTypeValues)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user