netbox-plugin-dns 1.2.7b3__tar.gz → 1.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of netbox-plugin-dns might be problematic. Click here for more details.

Files changed (190) hide show
  1. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/PKG-INFO +4 -3
  2. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/__init__.py +56 -29
  3. netbox_plugin_dns-1.2.9/netbox_dns/api/field_serializers.py +25 -0
  4. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/dnssec_key_template.py +2 -0
  5. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/dnssec_policy.py +13 -0
  6. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/record.py +2 -0
  7. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/record_template.py +2 -0
  8. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/zone.py +11 -1
  9. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/choices/dnssec_key_template.py +2 -2
  10. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/choices/dnssec_policy.py +2 -2
  11. netbox_plugin_dns-1.2.9/netbox_dns/choices/record.py +104 -0
  12. netbox_plugin_dns-1.2.9/netbox_dns/choices/utilities.py +4 -0
  13. netbox_plugin_dns-1.2.9/netbox_dns/choices/zone.py +119 -0
  14. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/timeperiod.py +6 -12
  15. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/dnssec_key_template.py +2 -2
  16. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/dnssec_policy.py +7 -6
  17. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/zone.py +25 -2
  18. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/zone_template.py +2 -2
  19. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/dnssec_key_template.py +3 -2
  20. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/dnssec_policy.py +39 -37
  21. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/nameserver.py +2 -0
  22. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/record_template.py +1 -0
  23. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/zone.py +99 -15
  24. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/zone_template.py +9 -0
  25. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/graphql/types.py +1 -0
  26. netbox_plugin_dns-1.2.9/netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  27. netbox_plugin_dns-1.2.9/netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
  28. netbox_plugin_dns-1.2.9/netbox_dns/migrations/0018_zone_domain_status_zone_expiration_date.py +23 -0
  29. netbox_plugin_dns-1.2.9/netbox_dns/migrations/0019_dnssecpolicy_parental_agents.py +25 -0
  30. netbox_plugin_dns-1.2.9/netbox_dns/migrations/0020_remove_dnssecpolicy_parental_agents_and_more.py +29 -0
  31. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/record.py +4 -1
  32. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/zone.py +74 -4
  33. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/zone_template.py +1 -1
  34. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/zone.py +6 -1
  35. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/template_content.py +2 -1
  36. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/registration.html +19 -0
  37. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone.html +10 -0
  38. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/urls.py +7 -0
  39. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/utilities/conversions.py +13 -0
  40. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/validators/dns_value.py +3 -0
  41. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/zone.py +11 -1
  42. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_plugin_dns.egg-info/PKG-INFO +4 -3
  43. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_plugin_dns.egg-info/SOURCES.txt +4 -0
  44. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/pyproject.toml +2 -2
  45. netbox_plugin_dns-1.2.7b3/netbox_dns/choices/record.py +0 -57
  46. netbox_plugin_dns-1.2.7b3/netbox_dns/choices/utilities.py +0 -26
  47. netbox_plugin_dns-1.2.7b3/netbox_dns/choices/zone.py +0 -24
  48. netbox_plugin_dns-1.2.7b3/netbox_dns/locale/de/LC_MESSAGES/django.mo +0 -0
  49. netbox_plugin_dns-1.2.7b3/netbox_dns/locale/fr/LC_MESSAGES/django.mo +0 -0
  50. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/LICENSE +0 -0
  51. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/README.md +0 -0
  52. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/nested_serializers.py +0 -0
  53. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers.py +0 -0
  54. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/__init__.py +0 -0
  55. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/nameserver.py +0 -0
  56. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/prefix.py +0 -0
  57. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/registrar.py +0 -0
  58. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/registration_contact.py +0 -0
  59. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/view.py +0 -0
  60. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/serializers_/zone_template.py +0 -0
  61. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/urls.py +0 -0
  62. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/api/views.py +0 -0
  63. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/apps.py +0 -0
  64. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/choices/__init__.py +0 -0
  65. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/__init__.py +0 -0
  66. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/address.py +0 -0
  67. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/choice_array.py +0 -0
  68. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/ipam.py +0 -0
  69. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/network.py +0 -0
  70. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/fields/rfc2317.py +0 -0
  71. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/__init__.py +0 -0
  72. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/nameserver.py +0 -0
  73. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/record.py +0 -0
  74. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/record_template.py +0 -0
  75. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/registrar.py +0 -0
  76. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/registration_contact.py +0 -0
  77. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/filtersets/view.py +0 -0
  78. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/__init__.py +0 -0
  79. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/record.py +0 -0
  80. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/registrar.py +0 -0
  81. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/registration_contact.py +0 -0
  82. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/forms/view.py +0 -0
  83. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/graphql/__init__.py +0 -0
  84. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/graphql/filters.py +0 -0
  85. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/graphql/schema.py +0 -0
  86. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/locale/en/LC_MESSAGES/django.mo +0 -0
  87. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/management/commands/cleanup_database.py +0 -0
  88. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/management/commands/cleanup_rrset_ttl.py +0 -0
  89. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/management/commands/rebuild_dnssync.py +0 -0
  90. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/management/commands/setup_dnssync.py +0 -0
  91. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/management/commands/update_soa.py +0 -0
  92. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0001_squashed_netbox_dns_0_15.py +0 -0
  93. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0001_squashed_netbox_dns_0_22.py +0 -0
  94. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0002_contact_description_registrar_description.py +0 -0
  95. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0003_default_view.py +0 -0
  96. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0004_create_and_assign_default_view.py +0 -0
  97. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0005_alter_zone_view_not_null.py +0 -0
  98. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0006_templating.py +0 -0
  99. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0007_alter_ordering_options.py +0 -0
  100. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0008_view_prefixes.py +0 -0
  101. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0009_rename_contact_registrationcontact.py +0 -0
  102. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0010_view_ip_address_filter.py +0 -0
  103. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0011_rename_related_fields.py +0 -0
  104. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0012_natural_ordering.py +0 -0
  105. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0013_zonetemplate_soa_mname_zonetemplate_soa_rname.py +0 -0
  106. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0014_alter_unique_constraints_lowercase.py +0 -0
  107. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0015_dnssec.py +0 -0
  108. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0016_dnssec_policy_status.py +0 -0
  109. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0017_dnssec_policy_zone_zone_template.py +0 -0
  110. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0020_netbox_3_4.py +0 -0
  111. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0021_record_ip_address.py +0 -0
  112. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0022_search.py +0 -0
  113. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0023_alter_record_value.py +0 -0
  114. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0024_tenancy.py +0 -0
  115. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0025_ipam_coupling_cf.py +0 -0
  116. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0026_domain_registration.py +0 -0
  117. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0027_alter_registrar_iana_id.py +0 -0
  118. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0028_rfc2317_fields.py +0 -0
  119. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/0029_record_fqdn.py +0 -0
  120. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/migrations/__init__.py +0 -0
  121. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/mixins/__init__.py +0 -0
  122. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/mixins/object_modification.py +0 -0
  123. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/__init__.py +0 -0
  124. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/dnssec_key_template.py +0 -0
  125. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/dnssec_policy.py +0 -0
  126. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/nameserver.py +0 -0
  127. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/record_template.py +0 -0
  128. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/registrar.py +0 -0
  129. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/registration_contact.py +0 -0
  130. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/models/view.py +0 -0
  131. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/navigation.py +0 -0
  132. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/signals/__init__.py +0 -0
  133. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/signals/dnssec.py +0 -0
  134. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/signals/ipam_dnssync.py +0 -0
  135. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/__init__.py +0 -0
  136. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/dnssec_key_template.py +0 -0
  137. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/dnssec_policy.py +0 -0
  138. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/ipam_dnssync.py +0 -0
  139. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/nameserver.py +0 -0
  140. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/record.py +0 -0
  141. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/record_template.py +0 -0
  142. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/registrar.py +0 -0
  143. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/registration_contact.py +0 -0
  144. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/view.py +0 -0
  145. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/tables/zone_template.py +0 -0
  146. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/dnsseckeytemplate.html +0 -0
  147. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/dnssecpolicy.html +0 -0
  148. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/nameserver.html +0 -0
  149. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/record/managed.html +0 -0
  150. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/record/related.html +0 -0
  151. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/record.html +0 -0
  152. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/recordtemplate.html +0 -0
  153. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/registrar.html +0 -0
  154. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/registrationcontact.html +0 -0
  155. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/view/button.html +0 -0
  156. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/view/prefix.html +0 -0
  157. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/view/related.html +0 -0
  158. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/view.html +0 -0
  159. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/base.html +0 -0
  160. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/child.html +0 -0
  161. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/child_zone.html +0 -0
  162. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/delegation_record.html +0 -0
  163. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/managed_record.html +0 -0
  164. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/record.html +0 -0
  165. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zone/rfc2317_child_zone.html +0 -0
  166. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zonetemplate/child.html +0 -0
  167. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templates/netbox_dns/zonetemplate.html +0 -0
  168. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templatetags/__init__.py +0 -0
  169. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/templatetags/netbox_dns.py +0 -0
  170. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/utilities/__init__.py +0 -0
  171. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/utilities/dns.py +0 -0
  172. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/utilities/ipam_dnssync.py +0 -0
  173. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/validators/__init__.py +0 -0
  174. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/validators/dns_name.py +0 -0
  175. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/validators/dnssec.py +0 -0
  176. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/validators/rfc2317.py +0 -0
  177. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/__init__.py +0 -0
  178. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/dnssec_key_template.py +0 -0
  179. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/dnssec_policy.py +0 -0
  180. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/nameserver.py +0 -0
  181. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/record.py +0 -0
  182. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/record_template.py +0 -0
  183. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/registrar.py +0 -0
  184. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/registration_contact.py +0 -0
  185. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/view.py +0 -0
  186. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_dns/views/zone_template.py +0 -0
  187. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_plugin_dns.egg-info/dependency_links.txt +0 -0
  188. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_plugin_dns.egg-info/requires.txt +0 -0
  189. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/netbox_plugin_dns.egg-info/top_level.txt +0 -0
  190. {netbox_plugin_dns-1.2.7b3 → netbox_plugin_dns-1.2.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: netbox-plugin-dns
3
- Version: 1.2.7b3
3
+ Version: 1.2.9
4
4
  Summary: NetBox DNS is a NetBox plugin for managing DNS data.
5
5
  Author-email: Peter Eckel <pete@netbox-dns.org>
6
6
  Project-URL: Homepage, https://github.com/peteeckel/netbox-plugin-dns
@@ -8,11 +8,12 @@ Project-URL: Documentation, https://github.com/peteeckel/netbox-plugin-dns/blob/
8
8
  Project-URL: Repository, https://github.com/peteeckel/netbox-plugin-dns
9
9
  Project-URL: Issues, https://github.com/peteeckel/netbox-plugin-dns/issues
10
10
  Keywords: netbox,netbox-plugin,dns
11
- Classifier: Development Status :: 4 - Beta
11
+ Classifier: Development Status :: 5 - Production/Stable
12
12
  Requires-Python: >=3.10
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: dnspython
16
+ Dynamic: license-file
16
17
 
17
18
  # NetBox DNS
18
19
  The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, up-to-date and compliant with to the relevant RFCs.
@@ -3,11 +3,8 @@ from django.core.exceptions import ImproperlyConfigured
3
3
 
4
4
  from netbox.plugins import PluginConfig
5
5
  from netbox.plugins.utils import get_plugin_config
6
- from ipam.choices import IPAddressStatusChoices
7
6
 
8
- from netbox_dns.choices import RecordTypeChoices, RecordStatusChoices, ZoneStatusChoices
9
-
10
- __version__ = "1.2.7-beta3"
7
+ __version__ = "1.2.9"
11
8
 
12
9
 
13
10
  def _check_list(setting):
@@ -32,31 +29,65 @@ class DNSConfig(PluginConfig):
32
29
  "zone_soa_retry": 7200,
33
30
  "zone_soa_expire": 2419200,
34
31
  "zone_soa_minimum": 3600,
35
- "zone_active_status": [
36
- ZoneStatusChoices.STATUS_ACTIVE,
37
- ZoneStatusChoices.STATUS_DYNAMIC,
38
- ],
39
- "filter_record_types": [],
40
- "record_active_status": [
41
- RecordStatusChoices.STATUS_ACTIVE,
32
+ "zone_active_status": ["active", "dynamic"],
33
+ "zone_expiration_warning_days": 30,
34
+ "filter_record_types": [
35
+ # Obsolete or experimental RRTypes
36
+ "A6", # RFC 6563: Historic
37
+ "AFSDB", # RFC 5864: Obsolete
38
+ "APL", # RFC 3123: Experimental
39
+ "AVC", # https://www.iana.org/assignments/dns-parameters/AVC/avc-completed-template
40
+ "GPOS", # RFC 1712: Experimental
41
+ "KEY", # RFC 3755: Obsolete
42
+ "L32", # RFC 6742: Experimental
43
+ "L64", # RFC 6742: Experimental
44
+ "LP", # RFC 6742: Experimental
45
+ "MB", # RFC 2505: Unlikely to ever be adopted
46
+ "MD", # RFC 973: Obsolete
47
+ "MF", # RFC 973: Obsolete
48
+ "MG", # RFC 2505: Unlikely to ever be adopted
49
+ "MINFO", # RFC 2505: Unlikely to ever be adopted
50
+ "MR", # RFC 2505: Unlikely to ever be adopted
51
+ "NID", # RFC 6742: Experimental
52
+ "NINFO", # Application expired
53
+ "NULL", # RFC 1035: Obsolete
54
+ "NXT", # RFC 3755: Obsolete
55
+ "SIG", # RFC 3755: Obsolete
56
+ "SPF", # RFC 7208: Obsolete
57
+ "WKS", # RFC 1127: Not recommended
58
+ # RRTypes with no current use by any notable application
59
+ # (see https://en.wikipedia.org/wiki/List_of_DNS_record_types)
60
+ "RP",
61
+ "ISDN",
62
+ "RT",
63
+ "X25",
64
+ "NSAP",
65
+ "NSAP_PTR",
66
+ "PX",
67
+ "TYPE0", # Reserved
68
+ "UNSPEC", # Reserved
69
+ # DNSSEC RRTypes that are usually not manually maintained
70
+ "NSEC",
71
+ "NSEC3",
72
+ "RRSIG",
42
73
  ],
74
+ "filter_record_types+": [],
75
+ "filter_record_types-": [],
76
+ "custom_record_types": [],
77
+ "record_active_status": ["active"],
43
78
  "dnssync_disabled": False,
44
- "dnssync_ipaddress_active_status": [
45
- IPAddressStatusChoices.STATUS_ACTIVE,
46
- IPAddressStatusChoices.STATUS_DHCP,
47
- IPAddressStatusChoices.STATUS_SLAAC,
48
- ],
79
+ "dnssync_ipaddress_active_status": ["active", "dhcp", "slaac"],
49
80
  "dnssync_conflict_deactivate": False,
50
81
  "dnssync_minimum_zone_labels": 2,
51
82
  "tolerate_characters_in_zone_labels": "",
52
83
  "tolerate_underscores_in_labels": False,
53
84
  "tolerate_leading_underscore_types": [
54
- RecordTypeChoices.CNAME,
55
- RecordTypeChoices.DNAME,
56
- RecordTypeChoices.SRV,
57
- RecordTypeChoices.SVCB,
58
- RecordTypeChoices.TLSA,
59
- RecordTypeChoices.TXT,
85
+ "CNAME",
86
+ "DNAME",
87
+ "SRV",
88
+ "SVCB",
89
+ "TLSA",
90
+ "TXT",
60
91
  ],
61
92
  "tolerate_non_rfc1035_types": [],
62
93
  "enable_root_zones": False,
@@ -94,16 +125,12 @@ class DNSConfig(PluginConfig):
94
125
  "record_active_status",
95
126
  "dnssync_ipaddress_active_status",
96
127
  "tolerate_leading_underscore_types",
128
+ "filter_record_types",
129
+ "filter_record_types+",
130
+ "custom_record_types",
97
131
  ):
98
132
  _check_list(setting)
99
133
 
100
- # +
101
- # TODO: Remove this workaround as soon as it's no longer required
102
- #
103
- # Force loading views so the register_model_view is run for all views
104
- # -
105
- import netbox_dns.views # noqa: F401
106
-
107
134
 
108
135
  #
109
136
  # Initialize plugin config
@@ -0,0 +1,25 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+ from rest_framework import serializers
3
+
4
+ from netbox_dns.utilities import iso8601_to_int
5
+
6
+ __all__ = ("TimePeriodField",)
7
+
8
+
9
+ class TimePeriodField(serializers.IntegerField):
10
+ default_error_messages = {
11
+ "invalid": _(
12
+ "Enter a positive integer or an ISO8601 duration (W, M and Y are not supported)."
13
+ ),
14
+ }
15
+
16
+ def to_internal_value(self, data):
17
+ try:
18
+ return iso8601_to_int(data)
19
+ except TypeError:
20
+ raise serializers.ValidationError(
21
+ "Enter a valid integer or ISO 8601 duration (W, M and Y are not supported)."
22
+ )
23
+
24
+ def to_representation(self, value):
25
+ return value
@@ -7,6 +7,7 @@ from tenancy.api.serializers_.tenants import TenantSerializer
7
7
  from netbox_dns.models import DNSSECKeyTemplate
8
8
 
9
9
  from ..nested_serializers import NestedDNSSECPolicySerializer
10
+ from ..field_serializers import TimePeriodField
10
11
 
11
12
 
12
13
  __all__ = ("DNSSECKeyTemplateSerializer",)
@@ -16,6 +17,7 @@ class DNSSECKeyTemplateSerializer(NetBoxModelSerializer):
16
17
  url = serializers.HyperlinkedIdentityField(
17
18
  view_name="plugins-api:netbox_dns-api:dnsseckeytemplate-detail"
18
19
  )
20
+ lifetime = TimePeriodField(required=False, allow_null=True)
19
21
  policies = NestedDNSSECPolicySerializer(
20
22
  many=True,
21
23
  read_only=True,
@@ -8,6 +8,7 @@ from netbox_dns.models import DNSSECPolicy
8
8
 
9
9
  from .dnssec_key_template import DNSSECKeyTemplateSerializer
10
10
  from ..nested_serializers import NestedZoneSerializer, NestedZoneTemplateSerializer
11
+ from ..field_serializers import TimePeriodField
11
12
 
12
13
 
13
14
  __all__ = ("DNSSECPolicySerializer",)
@@ -25,6 +26,18 @@ class DNSSECPolicySerializer(NetBoxModelSerializer):
25
26
  default=None,
26
27
  help_text=_("Key templates assigned to the policy"),
27
28
  )
29
+ dnskey_ttl = TimePeriodField(required=False, allow_null=True)
30
+ purge_keys = TimePeriodField(required=False, allow_null=True)
31
+ publish_safety = TimePeriodField(required=False, allow_null=True)
32
+ retire_safety = TimePeriodField(required=False, allow_null=True)
33
+ signatures_jitter = TimePeriodField(required=False, allow_null=True)
34
+ signatures_refresh = TimePeriodField(required=False, allow_null=True)
35
+ signatures_validity = TimePeriodField(required=False, allow_null=True)
36
+ signatures_validity_dnskey = TimePeriodField(required=False, allow_null=True)
37
+ max_zone_ttl = TimePeriodField(required=False, allow_null=True)
38
+ zone_propagation_delay = TimePeriodField(required=False, allow_null=True)
39
+ parent_ds_ttl = TimePeriodField(required=False, allow_null=True)
40
+ parent_propagation_delay = TimePeriodField(required=False, allow_null=True)
28
41
  zones = NestedZoneSerializer(
29
42
  many=True,
30
43
  read_only=True,
@@ -8,6 +8,7 @@ from tenancy.api.serializers import TenantSerializer
8
8
  from netbox_dns.models import Record
9
9
 
10
10
  from ..nested_serializers import NestedZoneSerializer, NestedRecordSerializer
11
+ from ..field_serializers import TimePeriodField
11
12
 
12
13
 
13
14
  __all__ = ("RecordSerializer",)
@@ -17,6 +18,7 @@ class RecordSerializer(NetBoxModelSerializer):
17
18
  url = serializers.HyperlinkedIdentityField(
18
19
  view_name="plugins-api:netbox_dns-api:record-detail"
19
20
  )
21
+ ttl = TimePeriodField(required=False, allow_null=True)
20
22
  ptr_record = NestedRecordSerializer(
21
23
  many=False,
22
24
  read_only=True,
@@ -7,6 +7,7 @@ from tenancy.api.serializers import TenantSerializer
7
7
  from netbox_dns.models import RecordTemplate
8
8
 
9
9
  from ..nested_serializers import NestedZoneTemplateSerializer
10
+ from ..field_serializers import TimePeriodField
10
11
 
11
12
 
12
13
  __all__ = ("RecordTemplateSerializer",)
@@ -16,6 +17,7 @@ class RecordTemplateSerializer(NetBoxModelSerializer):
16
17
  url = serializers.HyperlinkedIdentityField(
17
18
  view_name="plugins-api:netbox_dns-api:recordtemplate-detail"
18
19
  )
20
+ ttl = TimePeriodField(required=False, allow_null=True)
19
21
  tenant = TenantSerializer(nested=True, required=False, allow_null=True)
20
22
  zone_templates = NestedZoneTemplateSerializer(
21
23
  many=True,
@@ -12,6 +12,7 @@ from .zone_template import ZoneTemplateSerializer
12
12
  from .dnssec_policy import DNSSECPolicySerializer
13
13
 
14
14
  from ..nested_serializers import NestedZoneSerializer
15
+ from ..field_serializers import TimePeriodField
15
16
 
16
17
  from netbox_dns.models import Zone
17
18
 
@@ -38,6 +39,8 @@ class ZoneSerializer(NetBoxModelSerializer):
38
39
  required=False,
39
40
  help_text=_("Nameservers for the zone"),
40
41
  )
42
+ default_ttl = TimePeriodField(required=False, allow_null=True)
43
+ soa_ttl = TimePeriodField(required=False, allow_null=True)
41
44
  soa_mname = NameServerSerializer(
42
45
  nested=True,
43
46
  many=False,
@@ -51,6 +54,10 @@ class ZoneSerializer(NetBoxModelSerializer):
51
54
  required=False,
52
55
  help_text=_("Contact email for the zone"),
53
56
  )
57
+ soa_refresh = TimePeriodField(required=False, allow_null=True)
58
+ soa_retry = TimePeriodField(required=False, allow_null=True)
59
+ soa_expire = TimePeriodField(required=False, allow_null=True)
60
+ soa_minimum = TimePeriodField(required=False, allow_null=True)
54
61
  rfc2317_parent_zone = NestedZoneSerializer(
55
62
  many=False,
56
63
  read_only=True,
@@ -120,7 +127,7 @@ class ZoneSerializer(NetBoxModelSerializer):
120
127
  tenant = TenantSerializer(nested=True, required=False, allow_null=True)
121
128
 
122
129
  def validate(self, data):
123
- if (template := data.get("template")) is not None:
130
+ if isinstance(data, dict) and (template := data.get("template")) is not None:
124
131
  template.apply_to_zone_data(data)
125
132
 
126
133
  return super().validate(data)
@@ -183,8 +190,11 @@ class ZoneSerializer(NetBoxModelSerializer):
183
190
  "rfc2317_child_zones",
184
191
  "dnssec_policy",
185
192
  "inline_signing",
193
+ "parental_agents",
186
194
  "registrar",
187
195
  "registry_domain_id",
196
+ "expiration_date",
197
+ "domain_status",
188
198
  "registrant",
189
199
  "tech_c",
190
200
  "admin_c",
@@ -4,7 +4,7 @@ from django.utils.translation import gettext_lazy as _
4
4
 
5
5
  from utilities.choices import ChoiceSet
6
6
 
7
- from .utilities import define_choice_attributes
7
+ from .utilities import initialize_choice_names
8
8
 
9
9
  DEPRECATED_ALGORITHMS = (
10
10
  Algorithm.RSAMD5,
@@ -54,7 +54,7 @@ class DNSSECKeyTemplateKeySizeChoices(ChoiceSet):
54
54
  ]
55
55
 
56
56
 
57
- @define_choice_attributes()
57
+ @initialize_choice_names
58
58
  class DNSSECKeyTemplateAlgorithmChoices(ChoiceSet):
59
59
  CHOICES = [
60
60
  (algorithm.name, f"{algorithm.name} ({algorithm.value})")
@@ -4,7 +4,7 @@ from django.utils.translation import gettext_lazy as _
4
4
 
5
5
  from utilities.choices import ChoiceSet
6
6
 
7
- from .utilities import define_choice_attributes
7
+ from .utilities import initialize_choice_names
8
8
 
9
9
  DEPRECATED_DIGESTS = (
10
10
  DSDigest.NULL,
@@ -19,7 +19,7 @@ __all__ = (
19
19
  )
20
20
 
21
21
 
22
- @define_choice_attributes()
22
+ @initialize_choice_names
23
23
  class DNSSECPolicyDigestChoices(ChoiceSet):
24
24
  CHOICES = [
25
25
  (digest.name, digest.name)
@@ -0,0 +1,104 @@
1
+ from dns import rdatatype, rdataclass
2
+
3
+ from django.utils.translation import gettext_lazy as _
4
+
5
+ from utilities.choices import ChoiceSet
6
+ from netbox.plugins.utils import get_plugin_config
7
+
8
+ from .utilities import initialize_choice_names
9
+
10
+
11
+ __all__ = (
12
+ "RecordTypeChoices",
13
+ "RecordSelectableTypeChoices",
14
+ "RecordClassChoices",
15
+ "RecordStatusChoices",
16
+ )
17
+
18
+
19
+ def _get_config_option(option_name):
20
+ return list(
21
+ set(get_plugin_config("netbox_dns", option_name, []))
22
+ | set(get_plugin_config("netbox_dns", f"{option_name}+", []))
23
+ - set(get_plugin_config("netbox_dns", f"{option_name}-", []))
24
+ )
25
+
26
+
27
+ class RecordTypeNames:
28
+ def __init__(self):
29
+ self.record_type_names = sorted(
30
+ [
31
+ rdtype.name
32
+ for rdtype in rdatatype.RdataType
33
+ if not rdatatype.is_metatype(rdtype)
34
+ ]
35
+ + _get_config_option("custom_record_types")
36
+ )
37
+
38
+ def __iter__(self):
39
+ for rdtype_name in self.record_type_names:
40
+ yield rdtype_name
41
+
42
+
43
+ class RecordSelectableTypeNames:
44
+ def __init__(self, exclude_types=[]):
45
+ self.record_type_names = sorted(
46
+ [
47
+ rdtype.name
48
+ for rdtype in rdatatype.RdataType
49
+ if not rdatatype.is_metatype(rdtype)
50
+ and rdtype.name not in _get_config_option("filter_record_types")
51
+ ]
52
+ + _get_config_option("custom_record_types")
53
+ )
54
+
55
+ def __iter__(self):
56
+ for rdtype_name in self.record_type_names:
57
+ yield rdtype_name
58
+
59
+
60
+ class RecordClassNames:
61
+ def __iter__(self):
62
+ for rdclass in rdataclass.RdataClass:
63
+ yield rdclass.name
64
+
65
+
66
+ @initialize_choice_names
67
+ class RecordTypeChoices(ChoiceSet):
68
+ def choices():
69
+ return RecordTypeNames()
70
+
71
+ CHOICES = [(name, name) for name in choices()]
72
+
73
+ SINGLETONS = [
74
+ rdtype.name for rdtype in rdatatype.RdataType if rdatatype.is_singleton(rdtype)
75
+ ]
76
+ CUSTOM_TYPES = _get_config_option("custom_record_types")
77
+
78
+
79
+ @initialize_choice_names
80
+ class RecordSelectableTypeChoices(ChoiceSet):
81
+ def choices():
82
+ return RecordSelectableTypeNames()
83
+
84
+ CHOICES = [(name, name) for name in choices()]
85
+
86
+
87
+ @initialize_choice_names
88
+ class RecordClassChoices(ChoiceSet):
89
+ def choices():
90
+ return RecordClassNames()
91
+
92
+ CHOICES = [(name, name) for name in choices()]
93
+
94
+
95
+ class RecordStatusChoices(ChoiceSet):
96
+ key = "Record.status"
97
+
98
+ STATUS_ACTIVE = "active"
99
+ STATUS_INACTIVE = "inactive"
100
+
101
+ CHOICES = [
102
+ (STATUS_ACTIVE, _("Active"), "blue"),
103
+ (STATUS_INACTIVE, _("Inactive"), "red"),
104
+ ]
@@ -0,0 +1,4 @@
1
+ def initialize_choice_names(cls):
2
+ for choice in cls.CHOICES:
3
+ setattr(cls, choice[0], choice[0])
4
+ return cls
@@ -0,0 +1,119 @@
1
+ from django.utils.translation import gettext_lazy as _
2
+
3
+ from utilities.choices import ChoiceSet
4
+
5
+
6
+ __all__ = (
7
+ "ZoneStatusChoices",
8
+ "ZoneEPPStatusChoices",
9
+ )
10
+
11
+
12
+ class ZoneStatusChoices(ChoiceSet):
13
+ key = "Zone.status"
14
+
15
+ STATUS_ACTIVE = "active"
16
+ STATUS_RESERVED = "reserved"
17
+ STATUS_DEPRECATED = "deprecated"
18
+ STATUS_PARKED = "parked"
19
+ STATUS_DYNAMIC = "dynamic"
20
+
21
+ CHOICES = [
22
+ (STATUS_ACTIVE, _("Active"), "blue"),
23
+ (STATUS_RESERVED, _("Reserved"), "cyan"),
24
+ (STATUS_DEPRECATED, _("Deprecated"), "red"),
25
+ (STATUS_PARKED, _("Parked"), "gray"),
26
+ (STATUS_DYNAMIC, _("Dynamic"), "orange"),
27
+ ]
28
+
29
+
30
+ class ZoneEPPStatusChoices(ChoiceSet):
31
+ """
32
+ Reflects the EPP status of a zone registered as a domain. See
33
+ https://www.icann.org/resources/pages/epp-status-codes-2014-06-16-en
34
+ for details.
35
+ """
36
+
37
+ key = "Zone.epp_status"
38
+
39
+ EPP_STATUS_ADD_PERIOD = "addPeriod"
40
+ EPP_STATUS_AUTO_RENEW_PERIOD = "autoRenewPeriod"
41
+ EPP_STATUS_INACTIVE = "inactive"
42
+ EPP_STATUS_OK = "ok"
43
+ EPP_STATUS_PENDING_CREATE = "pendingCreate"
44
+ EPP_STATUS_PENDING_DELETE = "pendingDelete"
45
+ EPP_STATUS_PENDING_RENEW = "pendingRenew"
46
+ EPP_STATUS_PENDING_RESTORE = "pendingRestore"
47
+ EPP_STATUS_PENDING_TRANSFER = "pendingTransfer"
48
+ EPP_STATUS_PENDING_UPDATE = "pendingUpdate"
49
+ EPP_STATUS_REDEMPTION_PERIOD = "redemptionPeriod"
50
+ EPP_STATUS_RENEW_PERIOD = "renewPeriod"
51
+ EPP_STATUS_SERVER_DELETE_PROHIBITED = "serverDeleteProhibited"
52
+ EPP_STATUS_SERVER_HOLD = "serverHold"
53
+ EPP_STATUS_SERVER_RENER_PROHIBITED = "serverRenewProhibited"
54
+ EPP_STATUS_SERVER_TRANSFER_PROHIBITED = "serverTransferProhibited"
55
+ EPP_STATUS_SERVER_UPDATE_PROHIBITED = "serverUpdateProhibited"
56
+ EPP_STATUS_TRANSFER_PERIOD = "transferPeriod"
57
+ EPP_STATUS_CLIENT_DELETE_PROHIBITED = "clientDeleteProhibited"
58
+ EPP_STATUS_CLIENT_HOLD = "clientHold"
59
+ EPP_STATUS_CLIENT_RENEW_PROHIBITED = "clientRenewProhibited"
60
+ EPP_STATUS_CLIENT_TRANSFER_PROHIBITED = "clientTransferProhibited"
61
+ EPP_STATUS_CLIENT_UPDATE_PROHIBITED = "clientUpdateProhibited"
62
+
63
+ CHOICES = [
64
+ (EPP_STATUS_ADD_PERIOD, EPP_STATUS_ADD_PERIOD, "blue"),
65
+ (EPP_STATUS_AUTO_RENEW_PERIOD, EPP_STATUS_AUTO_RENEW_PERIOD, "blue"),
66
+ (EPP_STATUS_INACTIVE, EPP_STATUS_INACTIVE, "blue"),
67
+ (EPP_STATUS_OK, EPP_STATUS_OK, "blue"),
68
+ (EPP_STATUS_PENDING_CREATE, EPP_STATUS_PENDING_CREATE, "blue"),
69
+ (EPP_STATUS_PENDING_DELETE, EPP_STATUS_PENDING_DELETE, "blue"),
70
+ (EPP_STATUS_PENDING_RENEW, EPP_STATUS_PENDING_RENEW, "blue"),
71
+ (EPP_STATUS_PENDING_RESTORE, EPP_STATUS_PENDING_RESTORE, "blue"),
72
+ (EPP_STATUS_PENDING_TRANSFER, EPP_STATUS_PENDING_TRANSFER, "blue"),
73
+ (EPP_STATUS_PENDING_UPDATE, EPP_STATUS_PENDING_UPDATE, "blue"),
74
+ (EPP_STATUS_REDEMPTION_PERIOD, EPP_STATUS_REDEMPTION_PERIOD, "blue"),
75
+ (EPP_STATUS_RENEW_PERIOD, EPP_STATUS_RENEW_PERIOD, "blue"),
76
+ (
77
+ EPP_STATUS_SERVER_DELETE_PROHIBITED,
78
+ EPP_STATUS_SERVER_DELETE_PROHIBITED,
79
+ "blue",
80
+ ),
81
+ (EPP_STATUS_SERVER_HOLD, EPP_STATUS_SERVER_HOLD, "blue"),
82
+ (
83
+ EPP_STATUS_SERVER_RENER_PROHIBITED,
84
+ EPP_STATUS_SERVER_RENER_PROHIBITED,
85
+ "blue",
86
+ ),
87
+ (
88
+ EPP_STATUS_SERVER_TRANSFER_PROHIBITED,
89
+ EPP_STATUS_SERVER_TRANSFER_PROHIBITED,
90
+ "blue",
91
+ ),
92
+ (
93
+ EPP_STATUS_SERVER_UPDATE_PROHIBITED,
94
+ EPP_STATUS_SERVER_UPDATE_PROHIBITED,
95
+ "blue",
96
+ ),
97
+ (EPP_STATUS_TRANSFER_PERIOD, EPP_STATUS_TRANSFER_PERIOD, "blue"),
98
+ (
99
+ EPP_STATUS_CLIENT_DELETE_PROHIBITED,
100
+ EPP_STATUS_CLIENT_DELETE_PROHIBITED,
101
+ "cyan",
102
+ ),
103
+ (EPP_STATUS_CLIENT_HOLD, EPP_STATUS_CLIENT_HOLD, "cyan"),
104
+ (
105
+ EPP_STATUS_CLIENT_RENEW_PROHIBITED,
106
+ EPP_STATUS_CLIENT_RENEW_PROHIBITED,
107
+ "cyan",
108
+ ),
109
+ (
110
+ EPP_STATUS_CLIENT_TRANSFER_PROHIBITED,
111
+ EPP_STATUS_CLIENT_TRANSFER_PROHIBITED,
112
+ "cyan",
113
+ ),
114
+ (
115
+ EPP_STATUS_CLIENT_UPDATE_PROHIBITED,
116
+ EPP_STATUS_CLIENT_UPDATE_PROHIBITED,
117
+ "cyan",
118
+ ),
119
+ ]
@@ -1,7 +1,7 @@
1
1
  from django.forms import Field, TextInput
2
- from django.utils.dateparse import parse_duration
3
2
  from django.core.exceptions import ValidationError
4
3
 
4
+ from netbox_dns.utilities import iso8601_to_int
5
5
 
6
6
  __all__ = ("TimePeriodField",)
7
7
 
@@ -20,17 +20,11 @@ class TimePeriodField(Field):
20
20
  return None
21
21
 
22
22
  try:
23
- return int(value)
24
- except ValueError:
25
- try:
26
- duration = parse_duration(value)
27
- if duration is None:
28
- raise TypeError
29
- return int(duration.total_seconds())
30
- except TypeError:
31
- raise ValidationError(
32
- "Enter a valid integer or ISO 8601 duration (W, M and Y are not supported)"
33
- )
23
+ return iso8601_to_int(value)
24
+ except TypeError:
25
+ raise ValidationError(
26
+ "Enter a valid integer or ISO 8601 duration (W, M and Y are not supported)"
27
+ )
34
28
 
35
29
  def validate(self, value):
36
30
  super().validate(value)
@@ -27,13 +27,13 @@ class DNSSECKeyTemplateFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
27
27
  choices=DNSSECKeyTemplateKeySizeChoices,
28
28
  )
29
29
 
30
- policies_id = django_filters.ModelMultipleChoiceFilter(
30
+ policy_id = django_filters.ModelMultipleChoiceFilter(
31
31
  field_name="policies",
32
32
  queryset=DNSSECPolicy.objects.all(),
33
33
  to_field_name="id",
34
34
  label=_("DNSSEC Policy IDs"),
35
35
  )
36
- policies = django_filters.ModelMultipleChoiceFilter(
36
+ policy = django_filters.ModelMultipleChoiceFilter(
37
37
  field_name="policies__name",
38
38
  queryset=DNSSECPolicy.objects.all(),
39
39
  to_field_name="name",
@@ -10,6 +10,7 @@ from utilities.filters import MultiValueCharFilter
10
10
  from netbox_dns.models import DNSSECPolicy, DNSSECKeyTemplate, Zone, ZoneTemplate
11
11
  from netbox_dns.choices import DNSSECPolicyStatusChoices
12
12
 
13
+
13
14
  __all__ = ("DNSSECPolicyFilterSet",)
14
15
 
15
16
 
@@ -47,37 +48,37 @@ class DNSSECPolicyFilterSet(TenancyFilterSet, NetBoxModelFilterSet):
47
48
  method="filter_cds_digest_types",
48
49
  label=_("CDS Digest Types"),
49
50
  )
50
- key_templates = django_filters.ModelMultipleChoiceFilter(
51
+ key_template = django_filters.ModelMultipleChoiceFilter(
51
52
  field_name="key_templates__name",
52
53
  queryset=DNSSECKeyTemplate.objects.all(),
53
54
  to_field_name="name",
54
55
  label=_("DNSSEC Key Templates"),
55
56
  )
56
- key_templates_id = django_filters.ModelMultipleChoiceFilter(
57
+ key_template_id = django_filters.ModelMultipleChoiceFilter(
57
58
  field_name="key_templates",
58
59
  queryset=DNSSECKeyTemplate.objects.all(),
59
60
  to_field_name="id",
60
61
  label=_("DNSSEC Key Template IDs"),
61
62
  )
62
- zones = django_filters.ModelMultipleChoiceFilter(
63
+ zone = django_filters.ModelMultipleChoiceFilter(
63
64
  field_name="zones__name",
64
65
  queryset=Zone.objects.all(),
65
66
  to_field_name="name",
66
67
  label=_("Zones"),
67
68
  )
68
- zones_id = django_filters.ModelMultipleChoiceFilter(
69
+ zone_id = django_filters.ModelMultipleChoiceFilter(
69
70
  field_name="zones",
70
71
  queryset=Zone.objects.all(),
71
72
  to_field_name="id",
72
73
  label=_("Zone IDs"),
73
74
  )
74
- zone_templates = django_filters.ModelMultipleChoiceFilter(
75
+ zone_template = django_filters.ModelMultipleChoiceFilter(
75
76
  field_name="zone_templates__name",
76
77
  queryset=ZoneTemplate.objects.all(),
77
78
  to_field_name="name",
78
79
  label=_("Zone Templates"),
79
80
  )
80
- zone_templates_id = django_filters.ModelMultipleChoiceFilter(
81
+ zone_template_id = django_filters.ModelMultipleChoiceFilter(
81
82
  field_name="zone_templates",
82
83
  queryset=ZoneTemplate.objects.all(),
83
84
  to_field_name="id",