Skip to content

Commit

Permalink
Implement Provider.list_zones for dynamic zone config support
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Frey committed Jun 18, 2024
1 parent 77ac5fb commit 0051c30
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/octodns_netbox_dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,12 @@ def _apply(self, plan: octodns.provider.plan.Plan) -> None:
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([z.name + ("." if z.name[-1] != "." else "") for z in zones])

0 comments on commit 0051c30

Please sign in to comment.