Baseline modular DNS sync
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class DesiredRecord:
|
||||
hostname: str
|
||||
ip: str
|
||||
record_type: str = "A"
|
||||
wildcard: bool = False
|
||||
source: str = ""
|
||||
source_id: str | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProviderRecord:
|
||||
hostname: str
|
||||
ip: str
|
||||
record_type: str = "A"
|
||||
metadata: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ProviderCapabilities:
|
||||
record_types: frozenset[str] = frozenset({"A"})
|
||||
wildcard_records: bool = False
|
||||
supports_create: bool = True
|
||||
supports_update: bool = True
|
||||
supports_delete: bool = False
|
||||
max_records: int | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class SyncAction:
|
||||
action: str
|
||||
desired: DesiredRecord
|
||||
current: ProviderRecord | None = None
|
||||
reason: str | None = None
|
||||
Reference in New Issue
Block a user