// Validates the NMS config.
// Returns an error if any are found or nil if the config is valid.
Validates the NMS config.
Returns an error if any are found or nil if the config is valid.
// Validates the NMS config . // Returns an error if any are found or nil if the config is valid .
func ValidateNmsConfigs(nmsList avian.NmsApplyRequests) error {
	for _, nms := range nmsList.Nms {
		if nms.Port == 0 {
			return errors.New("Port either not specified or set to 0. Neither is permitted.")
		} else if nms.Port > 65535 {
			return fmt.Errorf("Invalid port value %d. Port must not be higher than 65535", nms.Port)
		}
	}
	return nil
}
func ValidateNmsConfigs ( nmsList avian . NmsApplyRequests ) error { for _ , nms := range nmsList . Nms { if nms . Port == 0 { return errors . New ( " " ) } else if nms . Port > 65535 { return fmt . Errorf ( " " , nms . Port ) } } return nil }
Validates the NMS config.
Validates the NMS config .
// Must loop through all NMS's here because of the different structure of NMS's in config. // Ensure valid port.