octodns.record.loc
Classes
|
|
|
|
|
Validates LOC rdata per RFC 1876: latitude/longitude degrees and minutes are integers in their respective ranges, the seconds, altitude, size, and precision fields are floats in range, and the |
- class octodns.record.loc.LocValueValidator(id, sets=None)[source]
Bases:
ValueValidatorValidates LOC rdata per RFC 1876: latitude/longitude degrees and minutes are integers in their respective ranges, the seconds, altitude, size, and precision fields are floats in range, and the
lat_direction(N/S) andlong_direction(E/W) are valid cardinal directions.- validate(value_cls, data, _type)[source]
Validate a record’s rdata values.
- Parameters:
value_cls (type) – The concrete value class being validated (e.g.
MxValue,_Ipv4Value). Validators that need access to value class-level attributes (e.g.VALID_ALGORITHMS,_address_type) should read them fromvalue_cls. Per-instance configuration should live onself, not onvalue_cls.data (list | tuple | str | dict) – The rdata to validate. For multi-value record types this is a list/tuple of value dicts or strings; for single-value types it may be a bare value. Most validators iterate
datadirectly — when a validator needs to accept either form it should normalize withif not isinstance(data, (list, tuple)): data = (data,)._type (str) – The record type string (e.g.
'MX','A'). Passed through to helpers like_check_target_formatwhich format it into their reason strings.
- Returns:
A list of human-readable reason strings describing validation failures. Must return an empty list when the values are valid. Reasons from multiple validators are concatenated by the caller, so each reason must stand alone without context from the others.
- Return type:
Notes
Implementations must not raise on invalid input — all failures are reported via the returned list. Reason strings are surfaced verbatim in
ValidationErrormessages, so phrasing and punctuation should be stable across releases.
- class octodns.record.loc.LocValue(value)[source]
Bases:
EqualityTupleMixin,dict- VALIDATORS = [<octodns.record.loc.LocValueValidator object>]
- property lat_degrees
- property lat_minutes
- property lat_seconds
- property lat_direction
- property long_degrees
- property long_minutes
- property long_seconds
- property long_direction
- property altitude
- property size
- property precision_horz
- property precision_vert
- property data
- property rdata_text