nautobot 2.4.3__py3-none-any.whl → 2.4.4__py3-none-any.whl

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.
Files changed (175) hide show
  1. nautobot/apps/filters.py +2 -0
  2. nautobot/circuits/filters.py +1 -1
  3. nautobot/circuits/tests/test_models.py +5 -3
  4. nautobot/cloud/filters.py +3 -6
  5. nautobot/cloud/tests/test_filters.py +21 -0
  6. nautobot/core/admin.py +2 -0
  7. nautobot/core/jobs/__init__.py +2 -1
  8. nautobot/core/management/commands/generate_performance_test_endpoints.py +9 -6
  9. nautobot/core/models/utils.py +6 -1
  10. nautobot/core/templates/inc/javascript.html +1 -0
  11. nautobot/core/templatetags/ui_framework.py +20 -4
  12. nautobot/core/testing/forms.py +1 -1
  13. nautobot/core/tests/test_api.py +1 -1
  14. nautobot/core/tests/test_graphql.py +3 -3
  15. nautobot/core/tests/test_jobs.py +4 -1
  16. nautobot/core/ui/object_detail.py +1 -1
  17. nautobot/dcim/api/serializers.py +36 -0
  18. nautobot/dcim/api/views.py +1 -1
  19. nautobot/dcim/elevations.py +17 -4
  20. nautobot/dcim/factory.py +9 -1
  21. nautobot/dcim/filters/__init__.py +27 -1
  22. nautobot/dcim/forms.py +13 -1
  23. nautobot/dcim/models/devices.py +11 -5
  24. nautobot/dcim/signals.py +26 -0
  25. nautobot/dcim/templates/dcim/virtualdevicecontext_retrieve.html +0 -62
  26. nautobot/dcim/templates/dcim/virtualdevicecontext_update.html +6 -0
  27. nautobot/dcim/tests/test_api.py +176 -0
  28. nautobot/dcim/tests/test_filters.py +56 -3
  29. nautobot/dcim/tests/test_models.py +40 -0
  30. nautobot/dcim/views.py +24 -14
  31. nautobot/extras/api/mixins.py +1 -1
  32. nautobot/extras/api/views.py +2 -2
  33. nautobot/extras/filters/__init__.py +4 -0
  34. nautobot/extras/models/datasources.py +7 -3
  35. nautobot/extras/plugins/__init__.py +26 -1
  36. nautobot/extras/templates/extras/inc/jobresult.html +12 -13
  37. nautobot/extras/templates/extras/objectchange.html +28 -12
  38. nautobot/extras/tests/test_api.py +16 -15
  39. nautobot/extras/tests/test_filters.py +2 -0
  40. nautobot/extras/tests/test_plugins.py +32 -1
  41. nautobot/extras/tests/test_views.py +12 -2
  42. nautobot/extras/views.py +3 -0
  43. nautobot/ipam/api/serializers.py +7 -8
  44. nautobot/ipam/api/views.py +2 -2
  45. nautobot/ipam/factory.py +27 -8
  46. nautobot/ipam/filters.py +67 -29
  47. nautobot/ipam/formfields.py +51 -0
  48. nautobot/ipam/forms.py +13 -1
  49. nautobot/ipam/migrations/0051_added_optional_vrf_relationship_to_vdc.py +41 -0
  50. nautobot/ipam/models.py +63 -5
  51. nautobot/ipam/tables.py +21 -7
  52. nautobot/ipam/tests/test_api.py +107 -66
  53. nautobot/ipam/tests/test_filters.py +145 -5
  54. nautobot/ipam/tests/test_views.py +15 -2
  55. nautobot/project-static/css/base.css +11 -0
  56. nautobot/project-static/css/dark.css +2 -1
  57. nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +62 -0
  58. nautobot/project-static/docs/development/apps/api/configuration-view.html +0 -3
  59. nautobot/project-static/docs/development/apps/api/models/graphql.html +0 -4
  60. nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +94 -1
  61. nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +0 -3
  62. nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +0 -3
  63. nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +0 -3
  64. nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +0 -3
  65. nautobot/project-static/docs/development/apps/api/prometheus.html +0 -3
  66. nautobot/project-static/docs/development/apps/api/testing.html +0 -6
  67. nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +0 -3
  68. nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +0 -3
  69. nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +0 -3
  70. nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +0 -3
  71. nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +1 -7
  72. nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +0 -7
  73. nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +0 -4
  74. nautobot/project-static/docs/development/apps/api/views/notes.html +0 -3
  75. nautobot/project-static/docs/development/apps/index.html +2 -35
  76. nautobot/project-static/docs/development/apps/migration/code-updates.html +1 -1
  77. nautobot/project-static/docs/development/core/application-registry.html +0 -6
  78. nautobot/project-static/docs/development/core/best-practices.html +0 -27
  79. nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +58 -4
  80. nautobot/project-static/docs/development/core/getting-started.html +12 -16
  81. nautobot/project-static/docs/development/core/homepage.html +0 -3
  82. nautobot/project-static/docs/development/core/style-guide.html +0 -5
  83. nautobot/project-static/docs/development/core/templates.html +0 -3
  84. nautobot/project-static/docs/development/core/testing.html +0 -9
  85. nautobot/project-static/docs/development/jobs/index.html +3 -29
  86. nautobot/project-static/docs/objects.inv +0 -0
  87. nautobot/project-static/docs/overview/application_stack.html +0 -18
  88. nautobot/project-static/docs/release-notes/version-2.4.html +191 -0
  89. nautobot/project-static/docs/requirements.txt +1 -1
  90. nautobot/project-static/docs/search/search_index.json +1 -1
  91. nautobot/project-static/docs/sitemap.xml +290 -290
  92. nautobot/project-static/docs/sitemap.xml.gz +0 -0
  93. nautobot/project-static/docs/user-guide/administration/configuration/settings.html +0 -10
  94. nautobot/project-static/docs/user-guide/administration/guides/docker.html +0 -15
  95. nautobot/project-static/docs/user-guide/administration/installation/index.html +0 -16
  96. nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +1 -4
  97. nautobot/project-static/docs/user-guide/administration/installation/services.html +0 -11
  98. nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +3 -3
  99. nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +5 -35
  100. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/tables/v2-code-location-changes.yaml +1 -1
  101. nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +1 -1
  102. nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +0 -4
  103. nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +0 -3
  104. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +0 -4
  105. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +0 -4
  106. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +0 -4
  107. nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +0 -4
  108. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +0 -4
  109. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +0 -4
  110. nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +0 -3
  111. nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +0 -4
  112. nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +0 -4
  113. nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +0 -4
  114. nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +1 -17
  115. nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +0 -3
  116. nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +0 -4
  117. nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +0 -4
  118. nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +0 -3
  119. nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +1 -7
  120. nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +0 -4
  121. nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +0 -4
  122. nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +0 -4
  123. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +0 -4
  124. nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +0 -4
  125. nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +0 -4
  126. nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +0 -4
  127. nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +0 -6
  128. nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +0 -3
  129. nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +0 -4
  130. nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +0 -4
  131. nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +0 -8
  132. nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +3 -3
  133. nautobot/project-static/docs/user-guide/feature-guides/graphql.html +0 -6
  134. nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +0 -3
  135. nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +3 -15
  136. nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +0 -26
  137. nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +0 -8
  138. nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +0 -3
  139. nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +0 -8
  140. nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +0 -7
  141. nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +0 -3
  142. nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +0 -3
  143. nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +0 -14
  144. nautobot/project-static/docs/user-guide/platform-functionality/note.html +0 -3
  145. nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +1 -10
  146. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +0 -3
  147. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +0 -14
  148. nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +0 -19
  149. nautobot/project-static/docs/user-guide/platform-functionality/secret.html +3 -9
  150. nautobot/project-static/docs/user-guide/platform-functionality/status.html +0 -8
  151. nautobot/project-static/docs/user-guide/platform-functionality/tag.html +0 -4
  152. nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +1 -13
  153. nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +0 -5
  154. nautobot/project-static/js/editor.js +292 -0
  155. nautobot/project-static/monaco-editor-0.52.2/README.md +81 -0
  156. nautobot/project-static/monaco-editor-0.52.2/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  157. nautobot/project-static/monaco-editor-0.52.2/vs/base/worker/workerMain.js +31 -0
  158. nautobot/project-static/monaco-editor-0.52.2/vs/basic-languages/xml/xml.js +10 -0
  159. nautobot/project-static/monaco-editor-0.52.2/vs/basic-languages/yaml/yaml.js +10 -0
  160. nautobot/project-static/monaco-editor-0.52.2/vs/editor/editor.main.css +8 -0
  161. nautobot/project-static/monaco-editor-0.52.2/vs/editor/editor.main.js +798 -0
  162. nautobot/project-static/monaco-editor-0.52.2/vs/language/json/jsonMode.js +19 -0
  163. nautobot/project-static/monaco-editor-0.52.2/vs/language/json/jsonWorker.js +42 -0
  164. nautobot/project-static/monaco-editor-0.52.2/vs/loader.js +11 -0
  165. nautobot/tenancy/filters/__init__.py +3 -5
  166. nautobot/tenancy/tests/test_filters.py +10 -0
  167. nautobot/virtualization/views.py +0 -1
  168. nautobot/wireless/tables.py +9 -4
  169. nautobot/wireless/tests/test_api.py +0 -9
  170. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/METADATA +2 -2
  171. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/RECORD +175 -163
  172. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/LICENSE.txt +0 -0
  173. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/NOTICE +0 -0
  174. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/WHEEL +0 -0
  175. {nautobot-2.4.3.dist-info → nautobot-2.4.4.dist-info}/entry_points.txt +0 -0
@@ -8333,15 +8333,6 @@
8333
8333
  </ul>
8334
8334
  </nav>
8335
8335
 
8336
- </li>
8337
-
8338
- <li class="md-nav__item">
8339
- <a href="#using-nautobotuiviewset-for-app-development" class="md-nav__link">
8340
- <span class="md-ellipsis">
8341
- Using NautobotUIViewSet for App Development
8342
- </span>
8343
- </a>
8344
-
8345
8336
  </li>
8346
8337
 
8347
8338
  </ul>
@@ -9578,15 +9569,6 @@
9578
9569
  </ul>
9579
9570
  </nav>
9580
9571
 
9581
- </li>
9582
-
9583
- <li class="md-nav__item">
9584
- <a href="#using-nautobotuiviewset-for-app-development" class="md-nav__link">
9585
- <span class="md-ellipsis">
9586
- Using NautobotUIViewSet for App Development
9587
- </span>
9588
- </a>
9589
-
9590
9572
  </li>
9591
9573
 
9592
9574
  </ul>
@@ -9761,10 +9743,6 @@ For most purposes, this is not the case you are intending to check!</p>
9761
9743
  <div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="kn">from</span> <span class="nn">nautobot.core.utils.lookup</span> <span class="kn">import</span> <span class="n">get_route_for_model</span>
9762
9744
  </code></pre></div>
9763
9745
  <p>This utility function supports both UI and API views for both Nautobot core apps and Nautobot Apps.</p>
9764
- <details class="version-added">
9765
- <summary>Added in version 1.4.3</summary>
9766
- <p>Support for generating API routes was added to <code>get_route_for_model()</code> by passing the argument <code>api=True</code>.</p>
9767
- </details>
9768
9746
  <h3 id="ui-routes">UI Routes<a class="headerlink" href="#ui-routes" title="Permanent link">&para;</a></h3>
9769
9747
  <p>Instead of:</p>
9770
9748
  <div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="n">route</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">model</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">app_label</span><span class="si">}</span><span class="s2">:</span><span class="si">{</span><span class="n">model</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">model_name</span><span class="si">}</span><span class="s2">_list&quot;</span>
@@ -10054,11 +10032,6 @@ For most purposes, this is not the case you are intending to check!</p>
10054
10032
  <li>For exceptions such as <code>DeviceFilterSet.has_primary_ip</code> where it checks for both <code>Device.primary_ip4</code> OR <code>Device.primary_ip6</code>, method filters may still be necessary, however, they would be <strong>the exception and not the norm.</strong></li>
10055
10033
  <li>The good news is that in the core there are not that many of these filter methods defined, but we also don’t want to see them continue to proliferate.</li>
10056
10034
  </ul>
10057
- <h2 id="using-nautobotuiviewset-for-app-development">Using NautobotUIViewSet for App Development<a class="headerlink" href="#using-nautobotuiviewset-for-app-development" title="Permanent link">&para;</a></h2>
10058
- <details class="version-added">
10059
- <summary>Added in version 1.4.0</summary>
10060
- <p>Using <code>NautobotUIViewSet</code> for <a href="../apps/api/views/nautobotuiviewset.html">App development</a> is strongly recommended.</p>
10061
- </details>
10062
10035
 
10063
10036
 
10064
10037
 
@@ -8208,6 +8208,30 @@
8208
8208
  </span>
8209
8209
  </a>
8210
8210
 
8211
+ <nav class="md-nav" aria-label="Remote Debugging Configuration">
8212
+ <ul class="md-nav__list">
8213
+
8214
+ <li class="md-nav__item">
8215
+ <a href="#running-inside-the-nautobot-workspace" class="md-nav__link">
8216
+ <span class="md-ellipsis">
8217
+ Running inside the Nautobot workspace
8218
+ </span>
8219
+ </a>
8220
+
8221
+ </li>
8222
+
8223
+ <li class="md-nav__item">
8224
+ <a href="#adding-nautobot-folder-to-an-existing-workspace" class="md-nav__link">
8225
+ <span class="md-ellipsis">
8226
+ Adding Nautobot folder to an existing workspace
8227
+ </span>
8228
+ </a>
8229
+
8230
+ </li>
8231
+
8232
+ </ul>
8233
+ </nav>
8234
+
8211
8235
  </li>
8212
8236
 
8213
8237
  </ul>
@@ -9450,6 +9474,30 @@
9450
9474
  </span>
9451
9475
  </a>
9452
9476
 
9477
+ <nav class="md-nav" aria-label="Remote Debugging Configuration">
9478
+ <ul class="md-nav__list">
9479
+
9480
+ <li class="md-nav__item">
9481
+ <a href="#running-inside-the-nautobot-workspace" class="md-nav__link">
9482
+ <span class="md-ellipsis">
9483
+ Running inside the Nautobot workspace
9484
+ </span>
9485
+ </a>
9486
+
9487
+ </li>
9488
+
9489
+ <li class="md-nav__item">
9490
+ <a href="#adding-nautobot-folder-to-an-existing-workspace" class="md-nav__link">
9491
+ <span class="md-ellipsis">
9492
+ Adding Nautobot folder to an existing workspace
9493
+ </span>
9494
+ </a>
9495
+
9496
+ </li>
9497
+
9498
+ </ul>
9499
+ </nav>
9500
+
9453
9501
  </li>
9454
9502
 
9455
9503
  </ul>
@@ -9486,6 +9534,7 @@
9486
9534
  <li><code>compose_dir</code>: the full path to the directory containing the Docker Compose YAML files (default: <code>"&lt;nautobot source directory&gt;/development"</code>)</li>
9487
9535
  <li><code>compose_files</code>: the Docker Compose YAML file(s) to use (default: <code>["docker-compose.yml", "docker-compose.postgres.yml", "docker-compose.dev.yml"]</code>)</li>
9488
9536
  <li><code>docker_image_names_main</code> and <code>docker_image_names_develop</code>: Used when <a href="release-checklist.html#publish-docker-images">building Docker images for publication</a>; you shouldn't generally need to change these.</li>
9537
+ <li><code>ephemeral_ports</code>: Setting this value to <code>True</code> will make all Nautobot containers with published ports expose themselves with dynamic ports. This is useful when running multiple Nautobot versions at the same time on the same machine so you won't experience system port conflicts.</li>
9489
9538
  </ul>
9490
9539
  <p>These setting may be overridden several different ways (from highest to lowest precedence):</p>
9491
9540
  <ul>
@@ -9621,8 +9670,13 @@
9621
9670
  <li>As a last step open the folder <code>/opt/nautobot</code> in VS Code.</li>
9622
9671
  </ul>
9623
9672
  <h3 id="remote-debugging-configuration">Remote Debugging Configuration<a class="headerlink" href="#remote-debugging-configuration" title="Permanent link">&para;</a></h3>
9624
- <p>Using the Remote-Attach functionality of VS Code debugger is an alternative to debugging in a development container. This allows a local VS Code instance to connect to a remote container and debug the code running in the container the same way as when debugging locally.</p>
9625
- <p>Follow the steps below to configure VS Code to debug Nautobot and Celery Worker running in a remote container:</p>
9673
+ <p>Using the <a href="https://code.visualstudio.com/docs/python/debugging#_debugging-by-attaching-over-a-network-connection">Remote-Attach functionality of VS Code</a> debugger is an alternative to debugging in a development container. This allows a local VS Code instance to connect to a remote container and debug the code running in the container the same way as when debugging locally. To learn more about debugging in VSCode, please <a href="https://code.visualstudio.com/docs/editor/debugging">follow the official docs</a>.</p>
9674
+ <p>Follow either of the options below to configure VS Code to debug Nautobot and Celery Worker running in a remote container:</p>
9675
+ <h4 id="running-inside-the-nautobot-workspace">Running inside the Nautobot workspace<a class="headerlink" href="#running-inside-the-nautobot-workspace" title="Permanent link">&para;</a></h4>
9676
+ <p>If you have opened the project via the workspace file <code>nautobot.code-workspace</code> then there are two debug configurations for remote debugging available. These can be run via one of the debug tasks:
9677
+ - <code>Python: Nautobot (Remote)</code> or
9678
+ - <code>Python: Nautobot-Celery (Remote)</code></p>
9679
+ <h4 id="adding-nautobot-folder-to-an-existing-workspace">Adding Nautobot folder to an existing workspace<a class="headerlink" href="#adding-nautobot-folder-to-an-existing-workspace" title="Permanent link">&para;</a></h4>
9626
9680
  <ol>
9627
9681
  <li>
9628
9682
  <p><strong>Configure <code>invoke.yml</code> to use the <code>docker-compose.vscode-rdb.yml</code> file.</strong></p>
@@ -9662,10 +9716,10 @@ then copy the <code>launch:</code> values to the <code>.vscode/launch.json</code
9662
9716
  <a id="__codelineno-9-12" name="__codelineno-9-12" href="#__codelineno-9-12"></a><span class="w"> </span><span class="p">]</span>
9663
9717
  <a id="__codelineno-9-13" name="__codelineno-9-13" href="#__codelineno-9-13"></a><span class="p">}</span>
9664
9718
  </code></pre></div>
9665
- </li>
9666
- </ol>
9667
9719
  <p>It is now possible to debug the containerized Nautobot and Celery Worker using the VS Code debugger.</p>
9668
9720
  <p>After restarting the Celery-Worker container you need to restart the debug session.</p>
9721
+ </li>
9722
+ </ol>
9669
9723
 
9670
9724
 
9671
9725
 
@@ -10359,10 +10359,6 @@
10359
10359
  <p>You may install Poetry in your user environment by running:</p>
10360
10360
  <div class="highlight"><pre><span></span><code><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a>curl -sSL https://install.python-poetry.org | python3 -
10361
10361
  </code></pre></div>
10362
- <details class="version-changed">
10363
- <summary>Changed in version 1.5.6</summary>
10364
- <p>Poetry 1.3+ is required to be able to install packages against the latest lockfile.</p>
10365
- </details>
10366
10362
  <div class="admonition danger">
10367
10363
  <p class="admonition-title">Danger</p>
10368
10364
  <p>Always utilize this documented method to install Poetry for use when developing Nautobot.</p>
@@ -10549,7 +10545,7 @@
10549
10545
  <p>Do not use <code>poetry run nautobot-server runserver</code> as it will crash unless you also pass the <code>--noreload</code> flag, which somewhat defeats the purpose of using the development server. It is recommended to use <code>nautobot-server runserver</code> from within an active virtualenv (e.g. <code>poetry shell</code>). This is a <a href="https://github.com/python-poetry/poetry/issues/2435">known issue with Django and Poetry</a>.</p>
10550
10546
  </div>
10551
10547
  <p>Please see the <a href="https://docs.djangoproject.com/en/stable/ref/django-admin/#runserver">official Django documentation on <code>runserver</code></a> for more information.</p>
10552
- <p>You can connect to the development server at <code>localhost:8080</code>.</p>
10548
+ <p>You can connect to the development server in your local web browser at <code>http://localhost:8080</code>. If you are using the ephemeral ports feature (disabled by default), you can make use of the command, <code>invoke open-nautobot-web</code>. This will open up the default web-browser on your system pointing to the correct Nautobot admin port. Note that this command can be used regardless of ephemeral port mode.</p>
10553
10549
  <h3 id="starting-the-worker-server">Starting the Worker Server<a class="headerlink" href="#starting-the-worker-server" title="Permanent link">&para;</a></h3>
10554
10550
  <p>In order to run Nautobot Jobs or anything that requires a worker you must start a Celery worker.</p>
10555
10551
  <p>The worker is started in Docker Workflow with <a href="https://pythonhosted.org/watchdog/">watchdog</a> and can be setup to be started with watchdog in the Virtual Environment Workflow. Watchdog provides a similar experience to the Django lightweight HTTP/WSGI for restarting your application automatically. Watchdog can watch for changes on your filesystem, this is helpful when adjusting existing Python files to not have to restart the Celery worker when testing jobs.</p>
@@ -10752,10 +10748,10 @@
10752
10748
  <p class="admonition-title">Tip</p>
10753
10749
  <p>You may also use <code>invoke integration-test</code> in the Virtual Environment workflow given that the <code>selenium</code> container is running, and that the <code>INVOKE_NAUTOBOT_LOCAL=True</code> environment variable has been set.</p>
10754
10750
  </div>
10755
- <details class="version-changed">
10756
- <summary>Changed in version 1.5.11</summary>
10751
+ <div class="admonition tip">
10752
+ <p class="admonition-title">Tip</p>
10757
10753
  <p>The <code>--cache-test-fixtures</code> argument was added to the <code>invoke integration-test</code> and <code>nautobot-server test</code> commands to allow for caching of test factory data between test runs. See the <a href="testing.html#factory-caching">factories documentation</a> for more information.</p>
10758
- </details>
10754
+ </div>
10759
10755
  <h5 id="customizing-integration-test-executions">Customizing Integration Test Executions<a class="headerlink" href="#customizing-integration-test-executions" title="Permanent link">&para;</a></h5>
10760
10756
  <p>The following environment variables can be provided when running tests to customize where Nautobot looks for Selenium and where Selenium looks for Nautobot. If using the default setup documented above, there is no need to customize these.</p>
10761
10757
  <ul>
@@ -10845,27 +10841,27 @@
10845
10841
  <p>Some features require documentation updates or new documentation to be written. The documentation files can be found in the <code>docs</code> directory. To preview these changes locally, you can use <code>mkdocs</code>.</p>
10846
10842
  <p>For substantial changes to the code (including new features, removal of existing features, or significant changes in behavior) you should always make corresponding documentation updates. Nautobot's documentation pipeline includes a custom plugin for <code>mkdocs</code> that adds a few useful macros for annotating such changes:</p>
10847
10843
  <ul>
10848
- <li><code>+++ 1.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-added "Added in version 1.4.3"</code></li>
10849
- <li><code>+/- 1.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-changed "Changed in version 1.4.3"</code></li>
10850
- <li><code>--- 1.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-removed "Removed in version 1.4.3"</code></li>
10844
+ <li><code>+++ 2.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-added "Added in version 2.4.3"</code></li>
10845
+ <li><code>+/- 2.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-changed "Changed in version 2.4.3"</code></li>
10846
+ <li><code>--- 2.4.3</code>, on a line by itself, is a shorthand for <code>!!! version-removed "Removed in version 2.4.3"</code></li>
10851
10847
  </ul>
10852
10848
  <p>These admonitions in turn appear in the rendered documentation as follows:</p>
10853
10849
  <details class="version-added">
10854
- <summary>Added in version 1.4.3</summary>
10850
+ <summary>Added in version 2.4.3</summary>
10855
10851
  </details>
10856
10852
  <details class="version-changed">
10857
- <summary>Changed in version 1.4.3</summary>
10853
+ <summary>Changed in version 2.4.3</summary>
10858
10854
  </details>
10859
10855
  <details class="version-removed">
10860
- <summary>Removed in version 1.4.3</summary>
10856
+ <summary>Removed in version 2.4.3</summary>
10861
10857
  </details>
10862
10858
  <p>You can also add text to any of these admonitions for further clarity, for example:</p>
10863
- <div class="highlight"><pre><span></span><code>??? version-added &quot;Added in version 1.4.3&quot;
10859
+ <div class="highlight"><pre><span></span><code>??? version-added &quot;Added in version 2.4.3&quot;
10864
10860
  The custom `mkdocs` plugin was added.
10865
10861
  </code></pre></div>
10866
10862
  <p>will render as:</p>
10867
10863
  <details class="version-added">
10868
- <summary>Added in version 1.4.3</summary>
10864
+ <summary>Added in version 2.4.3</summary>
10869
10865
  <p>The custom <code>mkdocs</code> plugin was added.</p>
10870
10866
  </details>
10871
10867
  <div class="admonition caution">
@@ -9176,9 +9176,6 @@
9176
9176
 
9177
9177
 
9178
9178
  <h1 id="populating-the-home-page">Populating the Home Page<a class="headerlink" href="#populating-the-home-page" title="Permanent link">&para;</a></h1>
9179
- <details class="version-added">
9180
- <summary>Added in version 1.2.0</summary>
9181
- </details>
9182
9179
  <p>Both core applications and Apps can contribute items to the Nautobot home page by defining <code>layout</code> inside of their app's <code>homepage.py</code>. Using a key and weight system, a developer can integrate amongst existing home page panels or can create entirely new panels as desired.</p>
9183
9180
  <h2 id="adding-a-new-home-page-panel">Adding a new Home Page Panel<a class="headerlink" href="#adding-a-new-home-page-panel" title="Permanent link">&para;</a></h2>
9184
9181
  <p>Each panel on the home page is defined by a <code>HomePagePanel</code> object. A <code>HomePagePanel</code> may contain either or both of <code>HomePageItem</code> and/or <code>HomePageGroup</code> objects, or may define custom content via a referenced Django template. A <code>HomePageGroup</code> may itself contain <code>HomePageItem</code> objects as well, and individual <code>HomePageItem</code> objects may also reference custom Django templates.</p>
@@ -9471,10 +9471,6 @@
9471
9471
  <li>
9472
9472
  <p>The combination of <code>nautobot.core.forms.BootstrapMixin</code>, <code>nautobot.extras.forms.CustomFieldModelFormMixin</code>, <code>nautobot.extras.forms.RelationshipModelFormMixin</code> and <code>nautobot.extras.forms.NoteModelFormMixin</code> is such a common use case throughout the code base that they have a helper class which combines all of these at <code>nautobot.extras.forms.NautobotModelForm</code>. Use this helper class if you need the functionality from these classes.</p>
9473
9473
  </li>
9474
- </ul>
9475
- <details class="version-added">
9476
- <summary>Added in version 1.4.0</summary>
9477
- <ul>
9478
9474
  <li>
9479
9475
  <p>Similarly, for filter forms, <code>nautobot.extras.forms.NautobotFilterForm</code> combines <code>nautobot.core.forms.BootstrapMixin</code>, <code>nautobot.extras.forms.ContactTeamModelFilterFormMixin</code> (since Nautobot 2.3.0), <code>nautobot.extras.forms.CustomFieldModelFilterFormMixin</code>, and <code>nautobot.extras.forms.RelationshipModelFilterFormMixin</code>, and should be used where appropriate.</p>
9480
9476
  </li>
@@ -9491,7 +9487,6 @@
9491
9487
  <p>API Views for most models should inherit from <code>nautobot.extras.api.views.NautobotModelViewSet</code>. Only use more abstract base classes such as <code>ModelViewSet</code> where absolutely required.</p>
9492
9488
  </li>
9493
9489
  </ul>
9494
- </details>
9495
9490
  <h2 id="branding">Branding<a class="headerlink" href="#branding" title="Permanent link">&para;</a></h2>
9496
9491
  <ul>
9497
9492
  <li>When referring to Nautobot in writing, use the proper form "<code>Nautobot</code>," with the letter N. The lowercase form "<code>nautobot</code>" should be used in code, filenames, etc.</li>
@@ -9308,9 +9308,6 @@ This document presents these templates and their features.</p>
9308
9308
  <p>You can use these templates as the basis for your templates by calling <code>{% extends '&lt;template_name&gt;' %}</code>
9309
9309
  at the top of your template file.</p>
9310
9310
  <h2 id="object-detail">Object Detail<a class="headerlink" href="#object-detail" title="Permanent link">&para;</a></h2>
9311
- <details class="version-added">
9312
- <summary>Added in version 1.2.0</summary>
9313
- </details>
9314
9311
  <p>The most customizable template is <code>generic/object_retrieve.html</code>, as object detail views have a wide range of specific requirements to be accommodated. It provides the following blocks:</p>
9315
9312
  <ul>
9316
9313
  <li><code>header</code>: overloading this block allows for changing the entire top row of
@@ -9549,9 +9549,6 @@
9549
9549
  <h3 id="troubleshooting-integration-tests">Troubleshooting Integration Tests<a class="headerlink" href="#troubleshooting-integration-tests" title="Permanent link">&para;</a></h3>
9550
9550
  <p>Because integration tests normally involve interacting with Nautobot through a browser via <a href="https://www.selenium.dev/selenium/docs/api/py/index.html">Selenium</a> and the <a href="https://splinter.readthedocs.io/en/latest/">Splinter</a> wrapper library, they can be difficult to troubleshoot directly from the Python code when a failure occurs. A common troubleshooting technique is to add a <code>breakpoint()</code> at the appropriate place in the Python test code (i.e., immediately prior to the observed failure). When the breakpoint is hit and the test pauses, you can then use a VNC viewer application (such as macOS's "Screen Sharing" app) to connect to the running Selenium instance (<code>localhost:15900</code> if using the Docker development environment; the default password if prompted is simply "<code>secret</code>"). This will allow you to interact live with the testing web browser in its current state and can often provide invaluable insight into the nature of any test failure.</p>
9551
9551
  <h2 id="factories">Factories<a class="headerlink" href="#factories" title="Permanent link">&para;</a></h2>
9552
- <details class="version-added">
9553
- <summary>Added in version 1.5.0</summary>
9554
- </details>
9555
9552
  <p>Nautobot uses the <a href="https://factoryboy.readthedocs.io/en/stable/"><code>factory_boy</code></a> library as a way to generate randomized but plausible database data for use in unit and integration tests, or for convenience in populating a local development instance.</p>
9556
9553
  <p>Factories for each Nautobot app's models are defined in the corresponding <code>nautobot/APPNAME/factory.py</code> files. Helper classes and functions for certain common patterns are defined in <code>nautobot/core/factory.py</code>. Factories can be used directly from <code>nautobot-server nbshell</code> so long as you have <code>factory_boy</code> installed. Examples:</p>
9557
9554
  <div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">nautobot.tenancy.factory</span> <span class="kn">import</span> <span class="n">TenantFactory</span><span class="p">,</span> <span class="n">TenantGroupFactory</span>
@@ -9580,9 +9577,6 @@
9580
9577
  <p>In short, we should only have one place in our tests where factories are called, and that's the <code>generate_test_data</code> management command. Individual tests should use standard <code>create()</code> or <code>save()</code> model methods, never factories.</p>
9581
9578
  </div>
9582
9579
  <h3 id="factory-caching">Factory Caching<a class="headerlink" href="#factory-caching" title="Permanent link">&para;</a></h3>
9583
- <details class="version-added">
9584
- <summary>Added in version 1.5.11</summary>
9585
- </details>
9586
9580
  <p>To reduce the time taken between multiple test runs, a new argument has been added to the <code>nautobot-server test</code> command: <code>--cache-test-fixtures</code>. When running tests with <code>--cache-test-fixtures</code> for the first time, after the factory data has been generated it will be saved to a <code>factory_dump.json</code> file in the <code>development</code> directory. On subsequent runs of unit or integration tests, if <code>--cache-test-fixtures</code> is again specified (hint: it is included by default when running <code>invoke unittest</code> or <code>invoke integration-test</code>), the factory data will be loaded from the file instead of being generated again. This can significantly reduce the time taken to run tests.</p>
9587
9581
  <details class="version-changed">
9588
9582
  <summary>Changed in version 2.2.7 — Hashing of migrations in the factory dump</summary>
@@ -9601,9 +9595,6 @@
9601
9595
  </ol>
9602
9596
  </div>
9603
9597
  <h2 id="performance-tests">Performance Tests<a class="headerlink" href="#performance-tests" title="Permanent link">&para;</a></h2>
9604
- <details class="version-added">
9605
- <summary>Added in version 1.5.0</summary>
9606
- </details>
9607
9598
  <h3 id="running-performance-tests">Running Performance Tests<a class="headerlink" href="#running-performance-tests" title="Permanent link">&para;</a></h3>
9608
9599
  <p>Nautobot uses <a href="https://pypi.org/project/django-slowtests/"><code>django-slowtests</code></a> to run performance tests. To run performance tests, you need to install the <code>django-slowtests</code> package.
9609
9600
  Once you install the package, you can do <code>invoke performance-test</code> or <code>invoke unittest --performance-test</code> to run unit tests with <code>NautobotPerformanceTestRunner</code>. The invoke commands will automatically add <code>--testrunner nautobot.core.tests.runner.NautobotPerformanceTestRunner</code> to the <code>coverage run</code> command and this flag will replace the default <code>NautobotTestRunner</code> while retaining all its functionalities with the addition of performance evaluation after test runs.</p>
@@ -10100,9 +10100,6 @@ The checkbox to enable dryrun when executing a Job is unchecked by default in th
10100
10100
  <p>Default: <code>[]</code></p>
10101
10101
  <p>A list of strings (field names) representing the order your Job <a href="#variables">variables</a> should be rendered as form fields in the Job submission UI. If not defined, the variables will be listed in order of their definition in the code. If variables are defined on a parent class and no field order is defined, the parent class variables will appear before the subclass variables.</p>
10102
10102
  <h4 id="has_sensitive_variables"><code>has_sensitive_variables</code><a class="headerlink" href="#has_sensitive_variables" title="Permanent link">&para;</a></h4>
10103
- <details class="version-added">
10104
- <summary>Added in version 1.3.10</summary>
10105
- </details>
10106
10103
  <p>Default: <code>True</code></p>
10107
10104
  <p>Unless set to False, it prevents the Job's input parameters from being saved to the database. This defaults to True so as to protect against inadvertent database exposure of input parameters that may include sensitive data such as passwords or other user credentials. Review whether each Job's inputs contain any such variables before setting this to False; if a Job <em>does</em> contain sensitive inputs, if possible you should consider whether the Job could be re-implemented using Nautobot's <a href="../../user-guide/platform-functionality/secret.html"><code>Secrets</code></a> feature as a way to ensure that the sensitive data is not directly provided as a Job variable at all.</p>
10108
10105
  <p>Important notes about Jobs with sensitive variables:</p>
@@ -10138,9 +10135,6 @@ A Boolean that if set to <code>True</code> prevents the job from running twice s
10138
10135
  <li>A checkbox on the job run form makes it possible to force the singleton lock to be overridden. This makes it possible to recover from failure scenarios such as the original singleton job being stopped before it can unset the lock.</li>
10139
10136
  </ul>
10140
10137
  <h4 id="read_only"><code>read_only</code><a class="headerlink" href="#read_only" title="Permanent link">&para;</a></h4>
10141
- <details class="version-added">
10142
- <summary>Added in version 1.1.0</summary>
10143
- </details>
10144
10138
  <details class="version-changed">
10145
10139
  <summary>Changed in version 2.0.0 — No automatic functionality</summary>
10146
10140
  <p>The <code>read_only</code> flag no longer changes the behavior of Nautobot core and is up to the Job author to decide whether their Job should be considered read only.</p>
@@ -10148,9 +10142,6 @@ A Boolean that if set to <code>True</code> prevents the job from running twice s
10148
10142
  <p>Default: <code>False</code></p>
10149
10143
  <p>A boolean that can be set by the Job author to indicate that the Job does not make any changes to the environment. What behavior makes each Job "read only" is up to the individual Job author to decide. Note that user input may still be optionally collected with read-only Jobs via Job variables, as described below.</p>
10150
10144
  <h4 id="soft_time_limit"><code>soft_time_limit</code><a class="headerlink" href="#soft_time_limit" title="Permanent link">&para;</a></h4>
10151
- <details class="version-added">
10152
- <summary>Added in version 1.3.0</summary>
10153
- </details>
10154
10145
  <p>An int or float value, in seconds, which can be used to override the default <a href="../../user-guide/administration/configuration/settings.html#celery_task_soft_time_limit">soft time limit</a> for a Job task to complete.</p>
10155
10146
  <p>The <code>celery.exceptions.SoftTimeLimitExceeded</code> exception will be raised when this soft time limit is exceeded. The Job task can catch this to clean up before the <a href="../../user-guide/administration/configuration/settings.html#celery_task_time_limit">hard time limit</a> (10 minutes by default) is reached:</p>
10156
10147
  <div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a><span class="kn">from</span> <span class="nn">celery.exceptions</span> <span class="kn">import</span> <span class="n">SoftTimeLimitExceeded</span>
@@ -10171,9 +10162,6 @@ A Boolean that if set to <code>True</code> prevents the job from running twice s
10171
10162
  <a id="__codelineno-7-16" name="__codelineno-7-16" href="#__codelineno-7-16"></a> <span class="n">cleanup_in_a_hurry</span><span class="p">()</span>
10172
10163
  </code></pre></div>
10173
10164
  <h4 id="task_queues"><code>task_queues</code><a class="headerlink" href="#task_queues" title="Permanent link">&para;</a></h4>
10174
- <details class="version-added">
10175
- <summary>Added in version 1.5.0</summary>
10176
- </details>
10177
10165
  <p>Default: <code>[]</code></p>
10178
10166
  <p>A list of Job Queue names that the Job can be routed to. An empty list will default to only allowing the user to select the <a href="../../user-guide/administration/configuration/settings.html#celery_task_default_queue">default Celery queue</a> (<code>default</code> unless changed by an administrator). The queue specified in the Job's <code>default_job_queue</code> will be used if a queue is not specified in a Job run API call.</p>
10179
10167
  <details class="version-changed">
@@ -10185,9 +10173,6 @@ A Boolean that if set to <code>True</code> prevents the job from running twice s
10185
10173
  <p>A worker must be listening on the requested queue or the Job will not run. See the documentation on <a href="../../user-guide/administration/guides/celery-queues.html">task queues</a> for more information.</p>
10186
10174
  </div>
10187
10175
  <h4 id="template_name"><code>template_name</code><a class="headerlink" href="#template_name" title="Permanent link">&para;</a></h4>
10188
- <details class="version-added">
10189
- <summary>Added in version 1.4.0</summary>
10190
- </details>
10191
10176
  <p>A path relative to the Job source code containing a Django template which provides additional code to customize the Job's submission form. This template should extend the existing Job template, <code>extras/job.html</code>, otherwise the base form and functionality may not be available.</p>
10192
10177
  <p>A template can provide additional JavaScript, CSS, or even display HTML. A good starting template would be:</p>
10193
10178
  <div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>{% extends &#39;extras/job.html&#39; %}
@@ -10211,9 +10196,6 @@ A Boolean that if set to <code>True</code> prevents the job from running twice s
10211
10196
  </details>
10212
10197
  <p>For another example checkout <a href="https://github.com/nautobot/nautobot/blob/main/examples/example_app/example_app/templates/example_app/example_with_custom_template.html">the template used in the Example App</a> in the GitHub repo.</p>
10213
10198
  <h4 id="time_limit"><code>time_limit</code><a class="headerlink" href="#time_limit" title="Permanent link">&para;</a></h4>
10214
- <details class="version-added">
10215
- <summary>Added in version 1.3.0</summary>
10216
- </details>
10217
10199
  <p>An int or float value, in seconds, which can be used to override the
10218
10200
  default <a href="../../user-guide/administration/configuration/settings.html#celery_task_time_limit">hard time limit</a> (10 minutes by default) for a Job task to complete.</p>
10219
10201
  <p>Unlike the <code>soft_time_limit</code> above, no exceptions are raised when a <code>time_limit</code> is exceeded. The task will just terminate silently:</p>
@@ -10449,10 +10431,10 @@ Another example of using the nested reference would be to access <a href="../../
10449
10431
  </code></pre></div>
10450
10432
  </div>
10451
10433
  <p>Markdown rendering is supported for log messages, as well as <a href="../../user-guide/platform-functionality/template-filters.html#render_markdown">a limited subset of HTML</a>.</p>
10452
- <details class="version-changed">
10453
- <summary>Changed in version 1.3.4 — Log entry sanitization</summary>
10434
+ <div class="admonition warning">
10435
+ <p class="admonition-title">Warning</p>
10454
10436
  <p>As a security measure, the <code>message</code> passed to any of these methods will be passed through the <code>nautobot.core.utils.logging.sanitize()</code> function in an attempt to strip out information such as usernames/passwords that should not be saved to the logs. This is of course best-effort only, and Job authors should take pains to ensure that such information is not passed to the logging APIs in the first place. The set of redaction rules used by the <code>sanitize()</code> function can be configured as <a href="../../user-guide/administration/configuration/settings.html#sanitizer_patterns"><code>settings.SANITIZER_PATTERNS</code></a>.</p>
10455
- </details>
10437
+ </div>
10456
10438
  <details class="version-changed">
10457
10439
  <summary>Changed in version 2.0.0 — Significant API changes</summary>
10458
10440
  <p>The Job class logging functions (example: <code>self.log(message)</code>, <code>self.log_success(obj=None, message=message)</code>, etc) have been removed. Also, the convenience method to mark a Job as failed, <code>log_failure()</code>, has been removed. To replace the functionality of this method, you can log an error message with <code>self.logger.error()</code> and then raise an exception to fail the Job. Note that it is no longer possible to manually set the Job Result status as failed without raising an exception in the Job.</p>
@@ -10512,11 +10494,6 @@ Another example of using the nested reference would be to access <a href="../../
10512
10494
  <h2 id="testing-jobs">Testing Jobs<a class="headerlink" href="#testing-jobs" title="Permanent link">&para;</a></h2>
10513
10495
  <p>Jobs are Python code and can be tested as such, usually via <a href="https://docs.djangoproject.com/en/stable/topics/testing/">Django unit-test features</a>. That said, there are a few useful tricks specific to testing Jobs.</p>
10514
10496
  <p>While individual methods within your Job can and should be tested in isolation, you'll likely also want to test the entire execution of the Job.</p>
10515
- <details class="version-added">
10516
- <summary>Added in version 1.3.3</summary>
10517
- <p>Entire Job execution testing was only introduced in 1.3.3 and newer.
10518
- However the import paths used in the examples requires 1.5.2 and newer.</p>
10519
- </details>
10520
10497
  <p>The simplest way to test the entire execution of Jobs is via calling the <code>nautobot.apps.testing.run_job_for_testing()</code> method, which is a helper wrapper around the <code>JobResult.enqueue_job</code> function used to execute a Job via Nautobot's Celery worker process.</p>
10521
10498
  <p>Because of the way <code>run_job_for_testing</code> and more specifically Celery tasks work, which is somewhat complex behind the scenes, you need to inherit from <code>nautobot.apps.testing.TransactionTestCase</code> instead of <code>django.test.TestCase</code> (Refer to the <a href="https://docs.djangoproject.com/en/stable/topics/testing/tools/#provided-test-case-classes">Django documentation</a> if you're interested in the differences between these classes - <code>TransactionTestCase</code> from Nautobot is a small wrapper around Django's <code>TransactionTestCase</code>).</p>
10522
10499
  <p>When using <code>TransactionTestCase</code> (whether from Django or from Nautobot) each tests runs on a completely empty database. Furthermore, Nautobot requires new Jobs to be enabled before they can run. Therefore, we need to make sure the Job is enabled before each run which <code>run_job_for_testing</code> handles for us.</p>
@@ -10547,9 +10524,6 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
10547
10524
  <p>For more advanced examples refer to the Nautobot source code, specifically <code>nautobot/extras/tests/test_jobs.py</code>.</p>
10548
10525
  </div>
10549
10526
  <h2 id="debugging-job-performance">Debugging Job Performance<a class="headerlink" href="#debugging-job-performance" title="Permanent link">&para;</a></h2>
10550
- <details class="version-added">
10551
- <summary>Added in version 1.5.17</summary>
10552
- </details>
10553
10527
  <p>Debugging the performance of Nautobot Jobs can be tricky, because they are executed in the worker context. In order to gain extra visibility, <a href="https://docs.python.org/3/library/profile.html">cProfile</a> can be used to profile the Job execution.</p>
10554
10528
  <p>The 'profile' form field on Jobs is automatically available when the <code>DEBUG</code> settings is <code>True</code>. When you select that checkbox, a profiling report in the pstats format will be written to the file system of the environment where the Job runs. Normally, this is on the file system of the worker process, but if you are using the <code>nautobot-server runjob</code> command with <code>--local</code>, it will end up in the file system of the web application itself. The path of the written file will be logged in the Job.</p>
10555
10529
  <div class="admonition note">
Binary file
@@ -9293,24 +9293,6 @@
9293
9293
  <h2 id="getting-started">Getting Started<a class="headerlink" href="#getting-started" title="Permanent link">&para;</a></h2>
9294
9294
  <p>See the <a href="../user-guide/administration/installation/index.html">installation guide</a> for help getting Nautobot up and running quickly.</p>
9295
9295
  <h2 id="dependency-history">Dependency History<a class="headerlink" href="#dependency-history" title="Permanent link">&para;</a></h2>
9296
- <details class="version-added">
9297
- <summary>Added in version 1.1.0 — MySQL support</summary>
9298
- <p>MySQL support was added.</p>
9299
- </details>
9300
- <details class="version-changed">
9301
- <summary>Changed in version 1.3.0 — Python 3.6, Python 3.10</summary>
9302
- <ul>
9303
- <li>Python 3.6 support was removed.</li>
9304
- <li>Python 3.10 support was added.</li>
9305
- </ul>
9306
- </details>
9307
- <details class="version-changed">
9308
- <summary>Changed in version 1.6.0 — Python 3.7, Python 3.11</summary>
9309
- <ul>
9310
- <li>Python 3.7 support was removed.</li>
9311
- <li>Python 3.11 support was added.</li>
9312
- </ul>
9313
- </details>
9314
9296
  <details class="version-removed">
9315
9297
  <summary>Removed in version 2.0.0 — <code>django-rq</code> and <code>django-cacheops</code></summary>
9316
9298
  <ul>