summaryrefslogtreecommitdiffstats
path: root/python/knot_resolver/datamodel/stub_zone_schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/knot_resolver/datamodel/stub_zone_schema.py')
-rw-r--r--python/knot_resolver/datamodel/stub_zone_schema.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/python/knot_resolver/datamodel/stub_zone_schema.py b/python/knot_resolver/datamodel/stub_zone_schema.py
new file mode 100644
index 00000000..afd1cc79
--- /dev/null
+++ b/python/knot_resolver/datamodel/stub_zone_schema.py
@@ -0,0 +1,32 @@
+from typing import List, Optional, Union
+
+from knot_resolver.datamodel.types import DomainName, IPAddressOptionalPort, PolicyFlagEnum
+from knot_resolver.utils.modeling import ConfigSchema
+
+
+class StubServerSchema(ConfigSchema):
+ """
+ Configuration of Stub server.
+
+ ---
+ address: IP address of Stub server.
+ """
+
+ address: IPAddressOptionalPort
+
+
+class StubZoneSchema(ConfigSchema):
+ """
+ Configuration of Stub Zone.
+
+ ---
+ subtree: Domain name of the zone.
+ servers: IP address of Stub server.
+ views: Use this Stub Zone only for clients defined by views.
+ options: Configuration flags for Stub Zone.
+ """
+
+ subtree: DomainName
+ servers: Union[List[IPAddressOptionalPort], List[StubServerSchema]]
+ views: Optional[List[str]] = None
+ options: Optional[List[PolicyFlagEnum]] = None