2019-12-29 23:57:39 -07:00
|
|
|
"""Validate error message configuration variables."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
# Third Party Imports
|
|
|
|
from pydantic import StrictStr
|
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
# Project Imports
|
|
|
|
from hyperglass.configuration.models._utils import HyperglassModel
|
2019-09-11 01:35:31 -07:00
|
|
|
|
|
|
|
|
2019-10-04 16:54:32 -07:00
|
|
|
class Messages(HyperglassModel):
|
2019-12-29 23:57:39 -07:00
|
|
|
"""Validation model for params.messages."""
|
2019-09-11 01:35:31 -07:00
|
|
|
|
2019-12-31 18:29:43 -07:00
|
|
|
no_input: StrictStr = "{field} must be specified."
|
|
|
|
acl_denied: StrictStr = "{target} is a member of {denied_network}, which is not allowed."
|
|
|
|
acl_not_allowed: StrictStr = "{target} is not allowed."
|
|
|
|
max_prefix: StrictStr = (
|
2019-09-11 01:35:31 -07:00
|
|
|
"Prefix length must be shorter than /{max_length}. {target} is too specific."
|
|
|
|
)
|
2019-12-31 18:29:43 -07:00
|
|
|
requires_ipv6_cidr: StrictStr = (
|
2019-09-11 01:35:31 -07:00
|
|
|
"{device_name} requires IPv6 BGP lookups to be in CIDR notation."
|
|
|
|
)
|
2019-12-31 18:29:43 -07:00
|
|
|
feature_not_enabled: StrictStr = "{feature} is not enabled for {device_name}."
|
|
|
|
invalid_input: StrictStr = "{target} is not a valid {query_type} target."
|
|
|
|
invalid_field: StrictStr = "{input} is an invalid {field}."
|
|
|
|
general: StrictStr = "Something went wrong."
|
|
|
|
directed_cidr: StrictStr = "{query_type} queries can not be in CIDR format."
|
|
|
|
request_timeout: StrictStr = "Request timed out."
|
|
|
|
connection_error: StrictStr = "Error connecting to {device_name}: {error}"
|
|
|
|
authentication_error: StrictStr = "Authentication error occurred."
|
|
|
|
noresponse_error: StrictStr = "No response."
|
|
|
|
vrf_not_associated: StrictStr = "VRF {vrf_name} is not associated with {device_name}."
|
|
|
|
no_matching_vrfs: StrictStr = "No VRFs in Common"
|
|
|
|
no_output: StrictStr = "No output."
|