commit cab1692ea57fedc54a2633330c442d2acebba1e8 Author: Jeffrey C. Ollie Date: Sun May 1 21:23:21 2022 -0500 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bee8a64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ebd3b7d --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +Copyright 2017 DigitalOcean \ No newline at end of file diff --git a/octodns_netbox_dns/__init__.py b/octodns_netbox_dns/__init__.py new file mode 100644 index 0000000..daeff1f --- /dev/null +++ b/octodns_netbox_dns/__init__.py @@ -0,0 +1,320 @@ +"""OctoDNS provider for NetboxDNS.""" +import logging +from pprint import pprint + +import dns.rdata +import octodns.provider.base +import octodns.provider.plan +import octodns.record +import octodns.zone +import pynetbox.core.api +import pynetbox.core.response + + +class NetBoxDNSSource(octodns.provider.base.BaseProvider): + """NetBoxDNS source for OctoDNS.""" + + SUPPORTS_GEO: bool = False + SUPPORTS_DYNAMIC: bool = False + SUPPORTS: set[str] = { + "A", + "AAAA", + "AFSDB", + "APL", + "CAA", + "CDNSKEY", + "CERT", + "CNAME", + "DCHID", + "DNAME", + "DNSKEY", + "DS", + "HIP", + "IPSECKEY", + "LOC", + "MX", + "NAPTR", + "NS", + "NSEC", + "PTR", + "RP", + "RRSIG", + "SOA", + "SPF", + "SRV", + "SSHFP", + "TLSA", + "TXT", + } + + _api: pynetbox.core.api.Api + _log: logging.Logger + _nb_view: pynetbox.core.response.Record | None + _ttl: int + + def __init__(self, id: int, url: str, token: str, view: str | None, ttl=3600): + """Initialize the NetboxDNSSource.""" + self._log = logging.getLogger(f"NetboxDNSSource[{id}]") + self._log.debug(f"__init__: id={id}, url={url}, view={view}") + super(NetBoxDNSSource, self).__init__(id) + self._api = pynetbox.core.api.Api(url, token) + self._nb_view = None + if view is not None: + self._nb_view = self._api.plugins.netbox_dns.views.get(name=view) + if self._nb_view is None: + raise ValueError + self._log.debug(f"found {self._nb_view.name} {self._nb_view.id}") + self._ttl = ttl + + def _get_nb_zone(self, name: str) -> pynetbox.core.response.Record: + """Given a zone name, look it up in NetBox.""" + if self._nb_view is None: + nb_zones = self._api.plugins.netbox_dns.zones.filter(name=name[:-1]) + if len(nb_zones) > 1: + raise ValueError + if len(nb_zones) == 0: + raise ValueError + return next(nb_zones) + + nb_zones = self._api.plugins.netbox_dns.zones.filter( + view_id=self._nb_view.id, name=name[:-1] + ) + for nb_zone in nb_zones: + self._log.debug(f"{nb_zone.name} {nb_zone.view.id}") + if nb_zone.name == name[:-1] and nb_zone.view.id == self._nb_view.id: + return nb_zone + + raise ValueError + + def populate( + self, zone: octodns.zone.Zone, target: bool = False, lenient: bool = False + ): + """Get all of the records of a zone from NetBox and add them to the OctoDNS zone.""" + self._log.debug( + f"populate: name={zone.name}, target={target}, lenient={lenient}" + ) + + records = {} + + nb_zone = self._get_nb_zone(zone.name) + + nb_records = self._api.plugins.netbox_dns.records.filter(zone_id=nb_zone.id) + for nb_record in nb_records: + self._log.debug( + f"{nb_record.name!r} {nb_record.type!r} {nb_record.value!r}" + ) + name = nb_record.name + if name == "@": + name = "" + data = { + "name": name, + "type": nb_record.type, + "ttl": nb_record.ttl, + "values": [], + } + rdata = dns.rdata.from_text("IN", nb_record.type, nb_record.value) + match rdata.rdtype.name: + case "A" | "AAAA": + value = rdata.address + + case "CNAME" | "DNAME" | "NS" | "PTR": + value = rdata.target.to_text() + + case "CAA": + value = { + "flags": rdata.flags, + "tag": rdata.tag, + "value": rdata.value, + } + + case "LOC": + value = { + "lat_direction": "N" if rdata.latitude[4] >= 0 else "S", + "lat_degrees": rdata.latitude[0], + "lat_minutes": rdata.latitude[1], + "lat_seconds": rdata.latitude[2] + rdata.latitude[3] / 1000, + "long_direction": "W" if rdata.latitude[4] >= 0 else "E", + "long_degrees": rdata.longitude[0], + "long_minutes": rdata.longitude[1], + "long_seconds": rdata.longitude[2] + rdata.longitude[3] / 1000, + "altitude": rdata.altitude / 100, + "size": rdata.size / 100, + "precision_horz": rdata.horizontal_precision / 100, + "precision_vert": rdata.veritical_precision / 100, + } + + case "MX": + value = { + "preference": rdata.preference, + "exchange": rdata.exchange.to_text(), + } + + case "NAPTR": + value = { + "order": rdata.order, + "preference": rdata.preference, + "flags": rdata.flags, + "service": rdata.service, + "regexp": rdata.regexp, + "replacement": rdata.replacement.to_text(), + } + + case "SSHFP": + value = { + "algorithm": rdata.algorithm, + "fingerprint_type": rdata.fp_type, + "fingerprint": rdata.fingerprint, + } + + case "SOA": + self._log.debug("SOA") + continue + + case "SPF" | "TXT": + value = nb_record.value + + case "SRV": + value = { + "priority": rdata.priority, + "weight": rdata.weight, + "port": rdata.port, + "target": rdata.target.to_text(), + } + + case _: + raise ValueError + + if (name, nb_record.type) not in records: + records[(name, nb_record.type)] = data + records[(name, nb_record.type)]["values"].append(value) + + for data in records.values(): + if len(data["values"]) == 1: + data["value"] = data.pop("values")[0] + pprint(data) + record = octodns.record.Record.new( + zone=zone, + name=data["name"], + data=data, + source=self, + lenient=lenient, + ) + zone.add_record(record, lenient=lenient) + + def _apply(self, plan: octodns.provider.plan.Plan): + """Apply the changes to the NetBox DNS zone.""" + self._log.debug( + f"_apply: zone={plan.desired.name}, len(changes)={len(plan.changes)}" + ) + + nb_zone = self._get_nb_zone(plan.desired.name) + + for change in plan.changes: + match change: + + case octodns.record.Create(): + name = change.new.name + if name == "": + name = "@" + + match change.new: + case octodns.record.ValueMixin(): + new = {repr(change.new.value)[1:-1]} + case octodns.record.ValuesMixin(): + new = set(map(lambda v: repr(v)[1:-1], change.new.values)) + case _: + raise ValueError + + for value in new: + nb_record = self._api.plugins.netbox_dns.records.create( + zone=nb_zone.id, + name=name, + type=change.new._type, + ttl=change.new.ttl, + value=value, + disable_ptr=True, + ) + self._log.debug(f"{nb_record!r}") + + case octodns.record.Delete(): + name = change.existing.name + if name == "": + name = "@" + + nb_records = self._api.plugins.netbox_dns.records.filter( + zone_id=nb_zone.id, + name=change.existing.name, + type=change.existing._type, + ) + + match change.existing: + case octodns.record.ValueMixin(): + existing = {repr(change.existing.value)[1:-1]} + case octodns.record.ValuesMixin(): + existing = set( + map(lambda v: repr(v)[1:-1], change.existing.values) + ) + case _: + raise ValueError + + for nb_record in nb_records: + for value in existing: + if nb_record.value == value: + self._log.debug( + f"{nb_record.id} {nb_record.name} {nb_record.type} {nb_record.value} {value}" + ) + self._log.debug( + f"{nb_record.url} {nb_record.endpoint.url}" + ) + nb_record.delete() + + case octodns.record.Update(): + + name = change.existing.name + if name == "": + name = "@" + + nb_records = self._api.plugins.netbox_dns.records.filter( + zone_id=nb_zone.id, + name=name, + type=change.existing._type, + ) + + match change.existing: + case octodns.record.ValueMixin(): + existing = {repr(change.existing.value)[1:-1]} + case octodns.record.ValuesMixin(): + existing = set( + map(lambda v: repr(v)[1:-1], change.existing.values) + ) + case _: + raise ValueError + + match change.new: + case octodns.record.ValueMixin(): + new = {repr(change.new.value)[1:-1]} + case octodns.record.ValuesMixin(): + new = set(map(lambda v: repr(v)[1:-1], change.new.values)) + case _: + raise ValueError + + delete = existing.difference(new) + update = existing.intersection(new) + create = new.difference(existing) + + for nb_record in nb_records: + if nb_record.value in delete: + nb_record.delete() + if nb_record.value in update: + nb_record.ttl = change.new.ttl + nb_record.save() + + for value in create: + nb_record = self._api.plugins.netbox_dns.records.create( + zone=nb_zone.id, + name=name, + type=change.new._type, + ttl=change.new.ttl, + value=value, + disable_ptr=True, + ) diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..030a127 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,244 @@ +[[package]] +name = "certifi" +version = "2021.10.8" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "charset-normalizer" +version = "2.0.12" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = false +python-versions = ">=3.5.0" + +[package.extras] +unicode_backport = ["unicodedata2"] + +[[package]] +name = "dnspython" +version = "2.2.1" +description = "DNS toolkit" +category = "main" +optional = false +python-versions = ">=3.6,<4.0" + +[package.extras] +dnssec = ["cryptography (>=2.6,<37.0)"] +curio = ["curio (>=1.2,<2.0)", "sniffio (>=1.1,<2.0)"] +doh = ["h2 (>=4.1.0)", "httpx (>=0.21.1)", "requests (>=2.23.0,<3.0.0)", "requests-toolbelt (>=0.9.1,<0.10.0)"] +idna = ["idna (>=2.1,<4.0)"] +trio = ["trio (>=0.14,<0.20)"] +wmi = ["wmi (>=1.5.1,<2.0.0)"] + +[[package]] +name = "fqdn" +version = "1.5.1" +description = "Validates fully-qualified domain names against RFC 1123, so that they are acceptable to modern bowsers" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, !=3.4, <4" + +[[package]] +name = "idna" +version = "3.3" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "natsort" +version = "8.1.0" +description = "Simple yet flexible natural sorting in Python." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +fast = ["fastnumbers (>=2.0.0)"] +icu = ["PyICU (>=1.0.0)"] + +[[package]] +name = "octodns" +version = "0.9.17" +description = "OctoDNS: DNS as code - Tools for managing DNS across multiple providers" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +dnspython = ">=1.15.0" +fqdn = ">=1.5.0" +natsort = ">=5.5.0" +python-dateutil = ">=2.8.1" +PyYaml = ">=4.2b1" + +[package.extras] +dev = ["pytest (>=6.2.5)", "pytest-cov (>=3.0.0)", "pytest-network (>=0.0.1)", "build (>=0.7.0)", "pycodestyle (>=2.6.0)", "pycountry (>=19.8.18)", "pycountry-convert (>=0.7.2)", "pyflakes (>=2.2.0)", "readme-renderer[md] (>=26.0)", "twine (>=3.4.2)"] + +[[package]] +name = "pynetbox" +version = "6.6.3.dev1+g35449e0" +description = "NetBox API client library" +category = "main" +optional = false +python-versions = "*" +develop = false + +[package.dependencies] +requests = ">=2.20.0,<3.0" +six = ">=1.0.0,<2.0.0" + +[package.source] +type = "git" +url = "https://github.com/jcollie/pynetbox.git" +reference = "35449e0e87105d9a6170bcc333d6a1882c945cd0" +resolved_reference = "35449e0e87105d9a6170bcc333d6a1882c945cd0" + +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "main" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "requests" +version = "2.27.1" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} +idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "urllib3" +version = "1.26.9" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.extras] +brotli = ["brotlicffi (>=0.8.0)", "brotli (>=1.0.9)", "brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.10" +content-hash = "e07320a890e7853587f5517b7e53ab4a632db308c630ee927a79e851836af165" + +[metadata.files] +certifi = [ + {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, + {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"}, +] +charset-normalizer = [ + {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, + {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, +] +dnspython = [ + {file = "dnspython-2.2.1-py3-none-any.whl", hash = "sha256:a851e51367fb93e9e1361732c1d60dab63eff98712e503ea7d92e6eccb109b4f"}, + {file = "dnspython-2.2.1.tar.gz", hash = "sha256:0f7569a4a6ff151958b64304071d370daa3243d15941a7beedf0c9fe5105603e"}, +] +fqdn = [ + {file = "fqdn-1.5.1-py3-none-any.whl", hash = "sha256:3a179af3761e4df6eb2e026ff9e1a3033d3587bf980a0b1b2e1e5d08d7358014"}, + {file = "fqdn-1.5.1.tar.gz", hash = "sha256:105ed3677e767fb5ca086a0c1f4bb66ebc3c100be518f0e0d755d9eae164d89f"}, +] +idna = [ + {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, + {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, +] +natsort = [ + {file = "natsort-8.1.0-py3-none-any.whl", hash = "sha256:f59988d2f24e77b6b56f8a8f882d5df6b3b637e09e075abc67b486d59fba1a4b"}, + {file = "natsort-8.1.0.tar.gz", hash = "sha256:c7c1f3f27c375719a4dfcab353909fe39f26c2032a062a8c80cc844eaaca0445"}, +] +octodns = [ + {file = "octodns-0.9.17-py3-none-any.whl", hash = "sha256:b35480dfcc8f78f636f869daa42fda5d47afd6dab5373ba44acde6eef87546db"}, + {file = "octodns-0.9.17.tar.gz", hash = "sha256:3b7a4d6b0c938d96ec77202d5fedbbe5426761450f912354ad16bb87e99930f1"}, +] +pynetbox = [] +python-dateutil = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] +pyyaml = [ + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, +] +requests = [ + {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, + {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, +] +six = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] +urllib3 = [ + {file = "urllib3-1.26.9-py2.py3-none-any.whl", hash = "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14"}, + {file = "urllib3-1.26.9.tar.gz", hash = "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..12b0164 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[tool.poetry] +name = "octodns-netbox-dns" +version = "0.1.0" +description = "" +authors = ["Jeffrey C. Ollie "] + +[tool.poetry.dependencies] +python = "^3.10" +octodns = "^0.9.17" + +# There's a bug in pynetbox that prevents update & delete operations on plugin REST API endpoints. +# Until pull request #426 is merged I recommend using my fork of pynetbox which has #426 applied to +# the version 6.6.2 of pynetbox (the original pull request is against an older version). +# +# pynetbox = "^6.6.2" +# +pynetbox = { git = "https://github.com/jcollie/pynetbox.git", rev = "35449e0e87105d9a6170bcc333d6a1882c945cd0" } + +dnspython = "^2.2.1" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api"