Merge pull request #4 from freym/dynamic-zones

Implement Provider.list_zones for dynamic zone config support
This commit is contained in:
Ivan Schaller 2024-07-07 18:18:31 +02:00 committed by GitHub
commit c1b21bf093
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -430,3 +430,13 @@ class NetBoxDNSProvider(octodns.provider.base.BaseProvider):
value=record,
disable_ptr=self.disable_ptr,
)
def list_zones(self) -> list[str]:
"""get all zones from netbox
@return: a list with all active zones
"""
query_params = {"status": "active", **self.nb_view}
zones = self.api.plugins.netbox_dns.zones.filter(**query_params)
return sorted([self._make_absolute(z.name) for z in zones])