nautobot 2.3.16__py3-none-any.whl → 2.4.0b1__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.
Potentially problematic release.
This version of nautobot might be problematic. Click here for more details.
- nautobot/__init__.py +15 -0
- nautobot/apps/api.py +0 -2
- nautobot/apps/config.py +32 -3
- nautobot/apps/events.py +19 -0
- nautobot/apps/exceptions.py +0 -2
- nautobot/apps/ui.py +44 -9
- nautobot/apps/utils.py +0 -8
- nautobot/apps/views.py +2 -0
- nautobot/circuits/navigation.py +0 -57
- nautobot/circuits/tables.py +1 -2
- nautobot/circuits/templates/circuits/circuit_retrieve.html +0 -71
- nautobot/circuits/templates/circuits/inc/circuit_termination.html +6 -64
- nautobot/circuits/templates/circuits/inc/circuit_termination_cable_fragment.html +40 -0
- nautobot/circuits/templates/circuits/inc/circuit_termination_header_extra_content.html +26 -0
- nautobot/circuits/templates/circuits/provider_retrieve.html +0 -76
- nautobot/circuits/tests/integration/test_relationships.py +33 -24
- nautobot/circuits/tests/test_filters.py +4 -8
- nautobot/circuits/views.py +143 -26
- nautobot/cloud/factory.py +4 -1
- nautobot/cloud/models.py +1 -1
- nautobot/cloud/tests/test_filters.py +5 -4
- nautobot/core/api/fields.py +5 -5
- nautobot/core/api/metadata.py +28 -256
- nautobot/core/api/pagination.py +3 -2
- nautobot/core/api/renderers.py +3 -0
- nautobot/core/api/serializers.py +24 -244
- nautobot/core/api/urls.py +3 -4
- nautobot/core/api/utils.py +0 -62
- nautobot/core/api/views.py +48 -158
- nautobot/core/apps/__init__.py +22 -578
- nautobot/core/celery/__init__.py +13 -0
- nautobot/core/celery/log.py +4 -4
- nautobot/core/celery/schedulers.py +48 -3
- nautobot/core/cli/__init__.py +8 -0
- nautobot/core/constants.py +7 -0
- nautobot/core/events/__init__.py +116 -0
- nautobot/core/events/base.py +27 -0
- nautobot/core/events/exceptions.py +10 -0
- nautobot/core/events/redis_broker.py +48 -0
- nautobot/core/events/syslog_broker.py +19 -0
- nautobot/core/exceptions.py +0 -6
- nautobot/core/filters.py +16 -21
- nautobot/core/fixtures/user-data.json +59 -0
- nautobot/core/forms/fields.py +53 -8
- nautobot/core/forms/utils.py +2 -1
- nautobot/core/graphql/schema.py +3 -1
- nautobot/core/graphql/types.py +1 -1
- nautobot/core/jobs/__init__.py +4 -4
- nautobot/core/jobs/cleanup.py +13 -49
- nautobot/core/jobs/groups.py +1 -1
- nautobot/core/management/commands/generate_test_data.py +21 -0
- nautobot/core/management/commands/validate_models.py +1 -1
- nautobot/core/middleware.py +16 -0
- nautobot/core/models/__init__.py +1 -1
- nautobot/core/models/fields.py +11 -7
- nautobot/core/models/query_functions.py +2 -2
- nautobot/core/models/tree_queries.py +3 -6
- nautobot/core/settings.py +44 -7
- nautobot/core/settings.yaml +86 -8
- nautobot/core/tables.py +15 -65
- nautobot/core/tasks.py +1 -1
- nautobot/core/templates/components/button/default.html +7 -0
- nautobot/core/templates/components/button/dropdown.html +20 -0
- nautobot/core/templates/components/layout/one_over_two.html +19 -0
- nautobot/core/templates/components/layout/two_over_one.html +19 -0
- nautobot/core/templates/components/panel/body_content_data_table.html +27 -0
- nautobot/core/templates/components/panel/body_content_objects_table.html +4 -0
- nautobot/core/templates/components/panel/body_content_tags.html +6 -0
- nautobot/core/templates/components/panel/body_content_text.html +12 -0
- nautobot/core/templates/components/panel/body_wrapper_generic.html +3 -0
- nautobot/core/templates/components/panel/body_wrapper_key_value_table.html +3 -0
- nautobot/core/templates/components/panel/body_wrapper_table.html +3 -0
- nautobot/core/templates/components/panel/footer_contacts_table.html +20 -0
- nautobot/core/templates/components/panel/footer_content_table.html +14 -0
- nautobot/core/templates/components/panel/grouping_toggle.html +14 -0
- nautobot/core/templates/components/panel/header_extra_content_table.html +3 -0
- nautobot/core/templates/components/panel/panel.html +16 -0
- nautobot/core/templates/components/panel/stats_panel_body.html +8 -0
- nautobot/core/templates/components/tab/content_wrapper.html +3 -0
- nautobot/core/templates/components/tab/label_wrapper.html +5 -0
- nautobot/core/templates/components/tab/label_wrapper_distinct_view.html +3 -0
- nautobot/core/templates/generic/object_retrieve.html +28 -17
- nautobot/core/templates/inc/computed_fields/panel_data.html +4 -7
- nautobot/core/templates/inc/custom_fields/panel.html +2 -2
- nautobot/core/templates/inc/custom_fields/panel_data.html +4 -7
- nautobot/core/templates/inc/footer.html +1 -0
- nautobot/core/templates/inc/media.html +0 -3
- nautobot/core/templates/inc/nav_menu.html +1 -1
- nautobot/core/templates/inc/relationships_panel.html +1 -1
- nautobot/core/templates/nautobot_config.py.j2 +3 -3
- nautobot/core/templates/panel_table.html +12 -0
- nautobot/core/templates/search.html +0 -7
- nautobot/core/templates/utilities/render_jinja2.html +117 -0
- nautobot/core/templatetags/helpers.py +101 -12
- nautobot/core/templatetags/ui_framework.py +40 -0
- nautobot/core/testing/api.py +23 -128
- nautobot/core/testing/context.py +18 -0
- nautobot/core/testing/filters.py +41 -58
- nautobot/core/testing/mixins.py +2 -7
- nautobot/core/testing/views.py +25 -123
- nautobot/core/tests/integration/test_app_home.py +1 -0
- nautobot/core/tests/integration/test_app_navbar.py +1 -0
- nautobot/core/tests/integration/test_filters.py +2 -0
- nautobot/core/tests/integration/test_home.py +1 -0
- nautobot/core/tests/integration/test_navbar.py +1 -0
- nautobot/core/tests/integration/test_view_authentication.py +1 -2
- nautobot/core/tests/nautobot_config.py +198 -0
- nautobot/core/tests/runner.py +3 -3
- nautobot/core/tests/test_api.py +82 -201
- nautobot/core/tests/test_csv.py +3 -25
- nautobot/core/tests/test_events.py +214 -0
- nautobot/core/tests/test_jinja_filters.py +1 -0
- nautobot/core/tests/test_jobs.py +84 -13
- nautobot/core/tests/test_navigations.py +7 -241
- nautobot/core/tests/test_templatetags_helpers.py +16 -0
- nautobot/core/tests/test_ui.py +150 -0
- nautobot/core/tests/test_utils.py +0 -25
- nautobot/core/tests/test_views.py +123 -31
- nautobot/core/ui/__init__.py +0 -0
- nautobot/core/ui/base.py +11 -0
- nautobot/core/ui/choices.py +44 -0
- nautobot/core/ui/homepage.py +167 -0
- nautobot/core/ui/nav.py +279 -0
- nautobot/core/ui/object_detail.py +1841 -0
- nautobot/core/ui/utils.py +36 -0
- nautobot/core/urls.py +4 -9
- nautobot/core/utils/config.py +30 -3
- nautobot/core/utils/lookup.py +20 -13
- nautobot/core/views/__init__.py +6 -1
- nautobot/core/views/generic.py +47 -52
- nautobot/core/views/mixins.py +15 -25
- nautobot/core/views/paginator.py +8 -5
- nautobot/core/views/renderers.py +3 -3
- nautobot/core/views/utils.py +11 -0
- nautobot/core/wsgi.py +3 -3
- nautobot/dcim/api/serializers.py +80 -179
- nautobot/dcim/api/urls.py +5 -0
- nautobot/dcim/api/views.py +17 -4
- nautobot/dcim/apps.py +1 -0
- nautobot/dcim/choices.py +28 -0
- nautobot/dcim/factory.py +58 -0
- nautobot/dcim/filters/__init__.py +197 -24
- nautobot/dcim/forms.py +203 -12
- nautobot/dcim/graphql/types.py +2 -2
- nautobot/dcim/migrations/0063_interfacevdcassignment_virtualdevicecontext_and_more.py +165 -0
- nautobot/dcim/migrations/0064_virtualdevicecontext_status_data_migration.py +28 -0
- nautobot/dcim/migrations/0065_controller_capabilities_and_more.py +29 -0
- nautobot/dcim/migrations/0066_controllermanageddevicegroup_radio_profiles_and_more.py +33 -0
- nautobot/dcim/models/__init__.py +4 -0
- nautobot/dcim/models/device_component_templates.py +2 -2
- nautobot/dcim/models/device_components.py +20 -22
- nautobot/dcim/models/devices.py +173 -4
- nautobot/dcim/models/locations.py +3 -3
- nautobot/dcim/models/power.py +5 -6
- nautobot/dcim/models/racks.py +6 -6
- nautobot/dcim/navigation.py +25 -224
- nautobot/dcim/signals.py +44 -0
- nautobot/dcim/tables/__init__.py +5 -3
- nautobot/dcim/tables/devices.py +96 -2
- nautobot/dcim/tables/devicetypes.py +2 -2
- nautobot/dcim/templates/dcim/controller/base.html +10 -0
- nautobot/dcim/templates/dcim/controller_create.html +1 -0
- nautobot/dcim/templates/dcim/controller_retrieve.html +5 -1
- nautobot/dcim/templates/dcim/controller_wirelessnetworks.html +25 -0
- nautobot/dcim/templates/dcim/controllermanageddevicegroup_create.html +66 -0
- nautobot/dcim/templates/dcim/controllermanageddevicegroup_retrieve.html +46 -0
- nautobot/dcim/templates/dcim/device/base.html +6 -42
- nautobot/dcim/templates/dcim/device/wireless.html +73 -0
- nautobot/dcim/templates/dcim/device.html +3 -1
- nautobot/dcim/templates/dcim/interface.html +1 -0
- nautobot/dcim/templates/dcim/interface_edit.html +1 -0
- nautobot/dcim/templates/dcim/locationtype.html +0 -107
- nautobot/dcim/templates/dcim/locationtype_retrieve.html +8 -0
- nautobot/dcim/templates/dcim/virtualdevicecontext_retrieve.html +76 -0
- nautobot/dcim/templates/dcim/virtualdevicecontext_update.html +34 -0
- nautobot/dcim/tests/test_api.py +172 -61
- nautobot/dcim/tests/test_filters.py +171 -109
- nautobot/dcim/tests/test_forms.py +2 -51
- nautobot/dcim/tests/test_graphql.py +0 -52
- nautobot/dcim/tests/test_models.py +126 -4
- nautobot/dcim/tests/test_signals.py +1 -0
- nautobot/dcim/tests/test_views.py +103 -11
- nautobot/dcim/urls.py +72 -27
- nautobot/dcim/utils.py +2 -2
- nautobot/dcim/views.py +369 -62
- nautobot/extras/api/customfields.py +2 -2
- nautobot/extras/api/serializers.py +91 -75
- nautobot/extras/api/urls.py +4 -0
- nautobot/extras/api/views.py +78 -15
- nautobot/extras/choices.py +13 -0
- nautobot/extras/constants.py +0 -1
- nautobot/extras/context_managers.py +23 -6
- nautobot/extras/datasources/git.py +4 -1
- nautobot/extras/factory.py +27 -0
- nautobot/extras/filters/__init__.py +59 -0
- nautobot/extras/forms/forms.py +125 -30
- nautobot/extras/forms/mixins.py +3 -11
- nautobot/extras/graphql/types.py +25 -1
- nautobot/extras/group_sync.py +3 -3
- nautobot/extras/health_checks.py +2 -1
- nautobot/extras/jobs.py +62 -26
- nautobot/extras/management/__init__.py +1 -0
- nautobot/extras/management/commands/runjob.py +7 -79
- nautobot/extras/management/commands/runjob_with_job_result.py +46 -0
- nautobot/extras/management/utils.py +87 -0
- nautobot/extras/managers.py +1 -3
- nautobot/extras/migrations/0018_joblog_data_migration.py +9 -7
- nautobot/extras/migrations/0117_create_job_queue_model.py +129 -0
- nautobot/extras/migrations/0118_task_queue_to_job_queue_migration.py +78 -0
- nautobot/extras/migrations/0119_remove_task_queues_from_job_and_queue_from_scheduled_job.py +28 -0
- nautobot/extras/models/__init__.py +4 -0
- nautobot/extras/models/change_logging.py +7 -3
- nautobot/extras/models/customfields.py +11 -12
- nautobot/extras/models/groups.py +9 -13
- nautobot/extras/models/jobs.py +218 -37
- nautobot/extras/models/models.py +2 -2
- nautobot/extras/models/relationships.py +69 -1
- nautobot/extras/models/secrets.py +5 -0
- nautobot/extras/navigation.py +20 -262
- nautobot/extras/plugins/__init__.py +56 -32
- nautobot/extras/plugins/marketplace_manifest.yml +450 -0
- nautobot/extras/plugins/urls.py +1 -0
- nautobot/extras/plugins/views.py +48 -1
- nautobot/extras/signals.py +39 -1
- nautobot/extras/tables.py +40 -6
- nautobot/extras/templates/extras/externalintegration_retrieve.html +0 -47
- nautobot/extras/templates/extras/inc/tags_panel.html +1 -5
- nautobot/extras/templates/extras/job_bulk_edit.html +2 -1
- nautobot/extras/templates/extras/job_detail.html +36 -6
- nautobot/extras/templates/extras/job_edit.html +5 -2
- nautobot/extras/templates/extras/job_list.html +2 -7
- nautobot/extras/templates/extras/jobqueue_retrieve.html +44 -0
- nautobot/extras/templates/extras/marketplace.html +278 -0
- nautobot/extras/templates/extras/plugins_list.html +35 -1
- nautobot/extras/templates/extras/plugins_tiles.html +79 -0
- nautobot/extras/templates/extras/role_retrieve.html +16 -0
- nautobot/extras/templates/extras/secret.html +0 -65
- nautobot/extras/templates/extras/secret_check.js +16 -0
- nautobot/extras/templates/extras/secret_create.html +114 -0
- nautobot/extras/templates/extras/secret_edit.html +1 -114
- nautobot/extras/templates/extras/secretsgroup_edit.html +1 -1
- nautobot/extras/templates/extras/templatetags/plugin_object_detail_tabs.html +2 -0
- nautobot/extras/templatetags/job_buttons.py +5 -4
- nautobot/extras/templatetags/plugins.py +69 -6
- nautobot/extras/test_jobs/api_test_job.py +1 -1
- nautobot/extras/test_jobs/atomic_transaction.py +2 -2
- nautobot/extras/test_jobs/dry_run.py +1 -1
- nautobot/extras/test_jobs/fail.py +5 -5
- nautobot/extras/test_jobs/file_output.py +1 -1
- nautobot/extras/test_jobs/file_upload_fail.py +1 -1
- nautobot/extras/test_jobs/file_upload_pass.py +1 -1
- nautobot/extras/test_jobs/ipaddress_vars.py +1 -3
- nautobot/extras/test_jobs/jobs_module/jobs_submodule/jobs.py +1 -1
- nautobot/extras/test_jobs/location_with_custom_field.py +1 -1
- nautobot/extras/test_jobs/log_redaction.py +1 -1
- nautobot/extras/test_jobs/log_skip_db_logging.py +1 -1
- nautobot/extras/test_jobs/modify_db.py +1 -1
- nautobot/extras/test_jobs/object_var_optional.py +1 -1
- nautobot/extras/test_jobs/object_var_required.py +1 -1
- nautobot/extras/test_jobs/object_vars.py +1 -1
- nautobot/extras/test_jobs/pass.py +3 -3
- nautobot/extras/test_jobs/profiling.py +1 -1
- nautobot/extras/test_jobs/relative_import.py +3 -3
- nautobot/extras/test_jobs/soft_time_limit_greater_than_time_limit.py +1 -1
- nautobot/extras/test_jobs/task_queues.py +1 -1
- nautobot/extras/tests/integration/test_plugin_banner.py +2 -0
- nautobot/extras/tests/test_api.py +157 -55
- nautobot/extras/tests/test_context_managers.py +4 -1
- nautobot/extras/tests/test_customfields.py +1 -1
- nautobot/extras/tests/test_datasources.py +1 -2
- nautobot/extras/tests/test_dynamicgroups.py +1 -1
- nautobot/extras/tests/test_filters.py +219 -535
- nautobot/extras/tests/test_forms.py +1 -20
- nautobot/extras/tests/test_job_variables.py +73 -152
- nautobot/extras/tests/test_jobs.py +43 -54
- nautobot/extras/tests/test_models.py +71 -16
- nautobot/extras/tests/test_relationships.py +5 -2
- nautobot/extras/tests/test_utils.py +23 -2
- nautobot/extras/tests/test_views.py +183 -43
- nautobot/extras/tests/test_webhooks.py +2 -1
- nautobot/extras/urls.py +2 -20
- nautobot/extras/utils.py +118 -4
- nautobot/extras/views.py +203 -92
- nautobot/extras/webhooks.py +5 -2
- nautobot/ipam/api/fields.py +3 -3
- nautobot/ipam/api/serializers.py +36 -137
- nautobot/ipam/api/views.py +93 -62
- nautobot/ipam/lookups.py +62 -101
- nautobot/ipam/models.py +11 -63
- nautobot/ipam/navigation.py +0 -90
- nautobot/ipam/querysets.py +2 -2
- nautobot/ipam/tables.py +6 -20
- nautobot/ipam/templates/ipam/routetarget.html +0 -28
- nautobot/ipam/templates/ipam/vrf.html +0 -47
- nautobot/ipam/tests/test_api.py +8 -419
- nautobot/ipam/tests/test_filters.py +39 -119
- nautobot/ipam/tests/test_forms.py +47 -51
- nautobot/ipam/tests/test_migrations.py +30 -30
- nautobot/ipam/tests/test_models.py +0 -41
- nautobot/ipam/tests/test_querysets.py +1 -63
- nautobot/ipam/urls.py +3 -69
- nautobot/ipam/utils/__init__.py +0 -24
- nautobot/ipam/views.py +153 -198
- nautobot/project-static/css/base.css +38 -3
- nautobot/project-static/docs/404.html +421 -19
- nautobot/project-static/docs/apps/index.html +421 -19
- nautobot/project-static/docs/apps/nautobot-apps.html +421 -19
- nautobot/project-static/docs/assets/extra.css +5 -1
- nautobot/project-static/docs/assets/javascripts/{bundle.88dd0f4e.min.js → bundle.83f73b43.min.js} +2 -2
- nautobot/project-static/docs/assets/javascripts/{bundle.88dd0f4e.min.js.map → bundle.83f73b43.min.js.map} +2 -2
- nautobot/project-static/docs/code-reference/nautobot/apps/__init__.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/admin.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/api.html +421 -172
- nautobot/project-static/docs/code-reference/nautobot/apps/change_logging.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/choices.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/config.html +425 -21
- nautobot/project-static/docs/code-reference/nautobot/apps/constants.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/datasources.html +424 -22
- nautobot/project-static/docs/code-reference/nautobot/apps/events.html +9809 -0
- nautobot/project-static/docs/code-reference/nautobot/apps/exceptions.html +424 -63
- nautobot/project-static/docs/code-reference/nautobot/apps/factory.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/forms.html +457 -20
- nautobot/project-static/docs/code-reference/nautobot/apps/graphql.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/jobs.html +425 -25
- nautobot/project-static/docs/code-reference/nautobot/apps/models.html +457 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/querysets.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/tables.html +425 -215
- nautobot/project-static/docs/code-reference/nautobot/apps/testing.html +430 -342
- nautobot/project-static/docs/code-reference/nautobot/apps/ui.html +5799 -1054
- nautobot/project-static/docs/code-reference/nautobot/apps/urls.html +421 -19
- nautobot/project-static/docs/code-reference/nautobot/apps/utils.html +447 -176
- nautobot/project-static/docs/code-reference/nautobot/apps/views.html +460 -21
- nautobot/project-static/docs/development/apps/api/configuration-view.html +421 -19
- nautobot/project-static/docs/development/apps/api/database-backend-config.html +421 -19
- nautobot/project-static/docs/development/apps/api/models/django-admin.html +421 -19
- nautobot/project-static/docs/development/apps/api/models/global-search.html +421 -19
- nautobot/project-static/docs/development/apps/api/models/graphql.html +421 -19
- nautobot/project-static/docs/development/apps/api/models/index.html +421 -19
- nautobot/project-static/docs/development/apps/api/nautobot-app-config.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/git-repository-content.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/index.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/jobs.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +421 -19
- nautobot/project-static/docs/development/apps/api/platform-features/table-extensions.html +424 -41
- nautobot/project-static/docs/development/apps/api/platform-features/uniquely-identify-objects.html +421 -19
- nautobot/project-static/docs/development/apps/api/prometheus.html +421 -19
- nautobot/project-static/docs/development/apps/api/setup.html +425 -155
- nautobot/project-static/docs/development/apps/api/testing.html +421 -19
- nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +421 -19
- nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +421 -19
- nautobot/project-static/docs/development/apps/api/ui-extensions/index.html +421 -19
- nautobot/project-static/docs/development/apps/api/ui-extensions/navigation.html +421 -19
- nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +701 -130
- nautobot/project-static/docs/development/apps/api/views/base-template.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/django-generic-views.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/help-documentation.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/index.html +423 -20
- nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +425 -19
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +451 -19
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/notes.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/rest-api.html +421 -19
- nautobot/project-static/docs/development/apps/api/views/urls.html +421 -19
- nautobot/project-static/docs/development/apps/index.html +421 -19
- nautobot/project-static/docs/development/apps/migration/code-updates.html +422 -52
- nautobot/project-static/docs/development/apps/migration/dependency-updates.html +422 -20
- nautobot/project-static/docs/development/apps/migration/from-v1.html +421 -19
- nautobot/project-static/docs/development/apps/migration/model-updates/dcim.html +421 -19
- nautobot/project-static/docs/development/apps/migration/model-updates/extras.html +421 -19
- nautobot/project-static/docs/development/apps/migration/model-updates/global.html +421 -19
- nautobot/project-static/docs/development/apps/migration/model-updates/ipam.html +424 -22
- nautobot/project-static/docs/development/apps/migration/ui-component-framework/best-practices.html +9219 -0
- nautobot/project-static/docs/development/apps/migration/ui-component-framework/custom-content.html +9333 -0
- nautobot/project-static/docs/development/apps/migration/ui-component-framework/index.html +9474 -0
- nautobot/project-static/docs/development/apps/migration/ui-component-framework/migration-steps.html +9517 -0
- nautobot/project-static/docs/development/apps/porting-from-netbox.html +424 -22
- nautobot/project-static/docs/development/core/application-registry.html +421 -19
- nautobot/project-static/docs/development/core/best-practices.html +421 -19
- nautobot/project-static/docs/development/core/bootstrap-ui.html +421 -19
- nautobot/project-static/docs/development/core/caching.html +421 -19
- nautobot/project-static/docs/development/core/controllers.html +423 -19
- nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +490 -45
- nautobot/project-static/docs/development/core/generic-views.html +421 -19
- nautobot/project-static/docs/development/core/getting-started.html +566 -179
- nautobot/project-static/docs/development/core/homepage.html +432 -30
- nautobot/project-static/docs/development/core/index.html +421 -19
- nautobot/project-static/docs/development/core/local-k8s.html +9453 -0
- nautobot/project-static/docs/development/core/model-checklist.html +424 -22
- nautobot/project-static/docs/development/core/model-features.html +421 -19
- nautobot/project-static/docs/development/core/natural-keys.html +421 -19
- nautobot/project-static/docs/development/core/navigation-menu.html +438 -26
- nautobot/project-static/docs/development/core/release-checklist.html +435 -45
- nautobot/project-static/docs/development/core/role-internals.html +421 -19
- nautobot/project-static/docs/development/core/settings.html +421 -19
- nautobot/project-static/docs/development/core/style-guide.html +421 -19
- nautobot/project-static/docs/development/core/templates.html +431 -22
- nautobot/project-static/docs/development/core/testing.html +421 -19
- nautobot/project-static/docs/development/core/ui-component-framework.html +11020 -0
- nautobot/project-static/docs/development/core/user-preferences.html +424 -22
- nautobot/project-static/docs/development/index.html +421 -19
- nautobot/project-static/docs/development/jobs/index.html +546 -160
- nautobot/project-static/docs/development/jobs/migration/from-v1.html +421 -19
- nautobot/project-static/docs/index.html +421 -19
- nautobot/project-static/docs/media/development/core/ui-component-framework/basic-panel-layout.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/button-example.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/dropdown-button-example.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/grouped-key-value-table-panel-example-1.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/grouped-key-value-table-panel-example-2.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/object-fields-panel-example.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/stats-panel-example.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/table-panels-family.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/text-panels-family.png +0 -0
- nautobot/project-static/docs/media/development/core/ui-component-framework/ui-framework-example.png +0 -0
- nautobot/project-static/docs/media/models/virtual_device_context_overview.drawio +73 -0
- nautobot/project-static/docs/media/models/virtual_device_context_overview.png +0 -0
- nautobot/project-static/docs/models/dcim/virtualdevicecontext.html +14 -0
- nautobot/project-static/docs/models/extras/jobqueue.html +14 -0
- nautobot/project-static/docs/models/wireless/radioprofile.html +14 -0
- nautobot/project-static/docs/models/wireless/supporteddatarate.html +14 -0
- nautobot/project-static/docs/models/wireless/wirelessnetwork.html +14 -0
- nautobot/project-static/docs/objects.inv +0 -0
- nautobot/project-static/docs/overview/application_stack.html +426 -20
- nautobot/project-static/docs/overview/design_philosophy.html +421 -19
- nautobot/project-static/docs/release-notes/index.html +445 -22
- nautobot/project-static/docs/release-notes/version-1.0.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.1.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.2.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.3.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.4.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.5.html +421 -19
- nautobot/project-static/docs/release-notes/version-1.6.html +634 -667
- nautobot/project-static/docs/release-notes/version-2.0.html +421 -19
- nautobot/project-static/docs/release-notes/version-2.1.html +421 -19
- nautobot/project-static/docs/release-notes/version-2.2.html +421 -19
- nautobot/project-static/docs/release-notes/version-2.3.html +684 -886
- nautobot/project-static/docs/release-notes/version-2.4.html +10007 -0
- nautobot/project-static/docs/requirements.txt +2 -2
- nautobot/project-static/docs/search/search_index.json +1 -1
- nautobot/project-static/docs/sitemap.xml +334 -270
- nautobot/project-static/docs/sitemap.xml.gz +0 -0
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/ldap.html +421 -19
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/remote.html +421 -19
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/sso.html +423 -21
- nautobot/project-static/docs/user-guide/administration/configuration/index.html +433 -32
- nautobot/project-static/docs/user-guide/administration/configuration/redis.html +421 -19
- nautobot/project-static/docs/user-guide/administration/configuration/settings.html +765 -180
- nautobot/project-static/docs/user-guide/administration/configuration/time-zones.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/celery-queues.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/docker.html +434 -29
- nautobot/project-static/docs/user-guide/administration/guides/health-checks.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/permissions.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/prometheus-metrics.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/replicating-nautobot.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/request-profiling.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/s3-django-storage.html +421 -19
- nautobot/project-static/docs/user-guide/administration/guides/selinux-troubleshooting.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/app-install.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/external-authentication.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/http-server.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/index.html +426 -20
- nautobot/project-static/docs/user-guide/administration/installation/install_system.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +421 -19
- nautobot/project-static/docs/user-guide/administration/installation/services.html +421 -19
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-netbox.html +421 -19
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +442 -41
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +435 -66
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-shell.html +435 -66
- nautobot/project-static/docs/user-guide/administration/upgrading/database-backup.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/after-you-upgrade.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/before-you-upgrade.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/for-developers.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/index.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/whats-changed.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/region-and-site-data-migration-guide.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/tables/v2-code-nautobot-app-location.yaml +0 -16
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +421 -19
- nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +427 -21
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuit.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittermination.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/circuits/provider.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloud.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudaccount.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetwork.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetworkprefixassignment.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudresourcetype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservice.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservicenetworkassignment.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/cable.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controller.html +457 -20
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controllermanageddevicegroup.html +447 -22
- nautobot/project-static/docs/user-guide/core-data-model/dcim/device.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicefamily.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/manufacturer.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/module.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebay.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebaytemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/moduletype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerfeed.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerpanel.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rack.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackgroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackreservation.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareimagefile.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareversion.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualchassis.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualdevicecontext.html +9333 -0
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +424 -22
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/extras/contact.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/extras/team.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/namespace.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/prefix.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/rir.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/routetarget.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/service.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlangroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vrf.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/overview/introduction.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenant.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenantgroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/cluster.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustergroup.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustertype.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/virtualmachine.html +421 -19
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +424 -22
- nautobot/project-static/docs/user-guide/core-data-model/wireless/index.html +9271 -0
- nautobot/project-static/docs/user-guide/core-data-model/wireless/radioprofile.html +9175 -0
- nautobot/project-static/docs/user-guide/core-data-model/wireless/supporteddatarate.html +9169 -0
- nautobot/project-static/docs/user-guide/core-data-model/wireless/wirelessnetwork.html +9235 -0
- nautobot/project-static/docs/user-guide/feature-guides/contacts-and-teams.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-devices.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-location-types-and-locations.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/index.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/interfaces.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/ipam.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/platforms.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/search-bar.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/tenants.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/vlans-and-vlan-groups.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/git-data-source.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/graphql.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/ip-address-merge-tool.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/relationships.html +421 -19
- nautobot/project-static/docs/user-guide/feature-guides/software-image-files-and-versions.html +421 -19
- nautobot/project-static/docs/user-guide/index.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/change-logging.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/customlink.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/events.html +9575 -0
- nautobot/project-static/docs/user-guide/platform-functionality/exporttemplate.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/externalintegration.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/graphqlquery.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/imageattachment.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +426 -20
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobqueue.html +9182 -0
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/napalm.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/note.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/objectmetadata.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/rendering-jinja-templates.html +9250 -0
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/ui-related-endpoints.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/role.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/savedview.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/secret.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/staticgroupassociation.html +424 -22
- nautobot/project-static/docs/user-guide/platform-functionality/status.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/tag.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +489 -56
- nautobot/project-static/docs/user-guide/platform-functionality/users/objectpermission.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/users/token.html +421 -19
- nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +421 -19
- nautobot/project-static/img/jinja_logo.svg +97 -0
- nautobot/project-static/js/forms.js +5 -0
- nautobot/project-static/js/nav_menu.js +2 -1
- nautobot/tenancy/api/serializers.py +0 -2
- nautobot/tenancy/factory.py +1 -1
- nautobot/tenancy/navigation.py +0 -29
- nautobot/tenancy/templates/tenancy/tenant.html +4 -91
- nautobot/tenancy/tests/test_filters.py +29 -134
- nautobot/tenancy/views.py +32 -23
- nautobot/users/admin.py +3 -1
- nautobot/users/api/serializers.py +4 -5
- nautobot/users/api/views.py +1 -1
- nautobot/users/forms.py +19 -0
- nautobot/users/templates/users/preferences.html +22 -0
- nautobot/users/tests/test_filters.py +1 -19
- nautobot/users/tests/test_views.py +57 -0
- nautobot/users/utils.py +8 -0
- nautobot/users/views.py +48 -11
- nautobot/virtualization/api/serializers.py +4 -4
- nautobot/virtualization/filters.py +2 -20
- nautobot/virtualization/navigation.py +0 -48
- nautobot/virtualization/templates/virtualization/clustertype.html +0 -39
- nautobot/virtualization/tests/test_filters.py +57 -183
- nautobot/virtualization/views.py +18 -15
- nautobot/wireless/__init__.py +0 -0
- nautobot/wireless/api/__init__.py +0 -0
- nautobot/wireless/api/serializers.py +44 -0
- nautobot/wireless/api/urls.py +20 -0
- nautobot/wireless/api/views.py +34 -0
- nautobot/wireless/apps.py +8 -0
- nautobot/wireless/choices.py +345 -0
- nautobot/wireless/factory.py +138 -0
- nautobot/wireless/filters.py +167 -0
- nautobot/wireless/forms.py +283 -0
- nautobot/wireless/homepage.py +19 -0
- nautobot/wireless/migrations/0001_initial.py +223 -0
- nautobot/wireless/migrations/__init__.py +0 -0
- nautobot/wireless/models.py +207 -0
- nautobot/wireless/navigation.py +105 -0
- nautobot/wireless/tables.py +244 -0
- nautobot/wireless/templates/wireless/radioprofile_retrieve.html +81 -0
- nautobot/wireless/templates/wireless/supporteddatarate_retrieve.html +26 -0
- nautobot/wireless/templates/wireless/wirelessnetwork_create.html +88 -0
- nautobot/wireless/templates/wireless/wirelessnetwork_retrieve.html +64 -0
- nautobot/wireless/tests/__init__.py +0 -0
- nautobot/wireless/tests/test_api.py +247 -0
- nautobot/wireless/tests/test_filters.py +54 -0
- nautobot/wireless/tests/test_models.py +22 -0
- nautobot/wireless/tests/test_views.py +378 -0
- nautobot/wireless/urls.py +13 -0
- nautobot/wireless/views.py +129 -0
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/METADATA +11 -14
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/RECORD +674 -551
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/WHEEL +1 -1
- nautobot/core/utils/navigation.py +0 -54
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/LICENSE.txt +0 -0
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/NOTICE +0 -0
- {nautobot-2.3.16.dist-info → nautobot-2.4.0b1.dist-info}/entry_points.txt +0 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
<link rel="icon" href="../../assets/favicon.ico">
|
|
21
|
-
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.
|
|
21
|
+
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.46">
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -3944,6 +3944,27 @@
|
|
|
3944
3944
|
|
|
3945
3945
|
|
|
3946
3946
|
|
|
3947
|
+
|
|
3948
|
+
|
|
3949
|
+
|
|
3950
|
+
|
|
3951
|
+
|
|
3952
|
+
|
|
3953
|
+
<li class="md-nav__item">
|
|
3954
|
+
<a href="../../user-guide/core-data-model/dcim/virtualdevicecontext.html" class="md-nav__link">
|
|
3955
|
+
|
|
3956
|
+
|
|
3957
|
+
<span class="md-ellipsis">
|
|
3958
|
+
Virtual Device Context
|
|
3959
|
+
</span>
|
|
3960
|
+
|
|
3961
|
+
|
|
3962
|
+
</a>
|
|
3963
|
+
</li>
|
|
3964
|
+
|
|
3965
|
+
|
|
3966
|
+
|
|
3967
|
+
|
|
3947
3968
|
</ul>
|
|
3948
3969
|
</nav>
|
|
3949
3970
|
|
|
@@ -4556,6 +4577,123 @@
|
|
|
4556
4577
|
|
|
4557
4578
|
|
|
4558
4579
|
|
|
4580
|
+
|
|
4581
|
+
|
|
4582
|
+
|
|
4583
|
+
|
|
4584
|
+
|
|
4585
|
+
|
|
4586
|
+
|
|
4587
|
+
|
|
4588
|
+
|
|
4589
|
+
|
|
4590
|
+
|
|
4591
|
+
|
|
4592
|
+
|
|
4593
|
+
<li class="md-nav__item md-nav__item--nested">
|
|
4594
|
+
|
|
4595
|
+
|
|
4596
|
+
|
|
4597
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_3_9" >
|
|
4598
|
+
|
|
4599
|
+
|
|
4600
|
+
|
|
4601
|
+
<div class="md-nav__link md-nav__container">
|
|
4602
|
+
<a href="../../user-guide/core-data-model/wireless/index.html" class="md-nav__link ">
|
|
4603
|
+
|
|
4604
|
+
|
|
4605
|
+
<span class="md-ellipsis">
|
|
4606
|
+
Wireless
|
|
4607
|
+
</span>
|
|
4608
|
+
|
|
4609
|
+
|
|
4610
|
+
</a>
|
|
4611
|
+
|
|
4612
|
+
|
|
4613
|
+
<label class="md-nav__link " for="__nav_2_3_9" id="__nav_2_3_9_label" tabindex="0">
|
|
4614
|
+
<span class="md-nav__icon md-icon"></span>
|
|
4615
|
+
</label>
|
|
4616
|
+
|
|
4617
|
+
</div>
|
|
4618
|
+
|
|
4619
|
+
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_3_9_label" aria-expanded="false">
|
|
4620
|
+
<label class="md-nav__title" for="__nav_2_3_9">
|
|
4621
|
+
<span class="md-nav__icon md-icon"></span>
|
|
4622
|
+
Wireless
|
|
4623
|
+
</label>
|
|
4624
|
+
<ul class="md-nav__list" data-md-scrollfix>
|
|
4625
|
+
|
|
4626
|
+
|
|
4627
|
+
|
|
4628
|
+
|
|
4629
|
+
|
|
4630
|
+
|
|
4631
|
+
|
|
4632
|
+
<li class="md-nav__item">
|
|
4633
|
+
<a href="../../user-guide/core-data-model/wireless/supporteddatarate.html" class="md-nav__link">
|
|
4634
|
+
|
|
4635
|
+
|
|
4636
|
+
<span class="md-ellipsis">
|
|
4637
|
+
Supported Data Rate
|
|
4638
|
+
</span>
|
|
4639
|
+
|
|
4640
|
+
|
|
4641
|
+
</a>
|
|
4642
|
+
</li>
|
|
4643
|
+
|
|
4644
|
+
|
|
4645
|
+
|
|
4646
|
+
|
|
4647
|
+
|
|
4648
|
+
|
|
4649
|
+
|
|
4650
|
+
|
|
4651
|
+
|
|
4652
|
+
|
|
4653
|
+
<li class="md-nav__item">
|
|
4654
|
+
<a href="../../user-guide/core-data-model/wireless/radioprofile.html" class="md-nav__link">
|
|
4655
|
+
|
|
4656
|
+
|
|
4657
|
+
<span class="md-ellipsis">
|
|
4658
|
+
Radio Profile
|
|
4659
|
+
</span>
|
|
4660
|
+
|
|
4661
|
+
|
|
4662
|
+
</a>
|
|
4663
|
+
</li>
|
|
4664
|
+
|
|
4665
|
+
|
|
4666
|
+
|
|
4667
|
+
|
|
4668
|
+
|
|
4669
|
+
|
|
4670
|
+
|
|
4671
|
+
|
|
4672
|
+
|
|
4673
|
+
|
|
4674
|
+
<li class="md-nav__item">
|
|
4675
|
+
<a href="../../user-guide/core-data-model/wireless/wirelessnetwork.html" class="md-nav__link">
|
|
4676
|
+
|
|
4677
|
+
|
|
4678
|
+
<span class="md-ellipsis">
|
|
4679
|
+
Wireless Network
|
|
4680
|
+
</span>
|
|
4681
|
+
|
|
4682
|
+
|
|
4683
|
+
</a>
|
|
4684
|
+
</li>
|
|
4685
|
+
|
|
4686
|
+
|
|
4687
|
+
|
|
4688
|
+
|
|
4689
|
+
</ul>
|
|
4690
|
+
</nav>
|
|
4691
|
+
|
|
4692
|
+
</li>
|
|
4693
|
+
|
|
4694
|
+
|
|
4695
|
+
|
|
4696
|
+
|
|
4559
4697
|
</ul>
|
|
4560
4698
|
</nav>
|
|
4561
4699
|
|
|
@@ -4767,6 +4905,27 @@
|
|
|
4767
4905
|
|
|
4768
4906
|
|
|
4769
4907
|
|
|
4908
|
+
<li class="md-nav__item">
|
|
4909
|
+
<a href="../../user-guide/platform-functionality/events.html" class="md-nav__link">
|
|
4910
|
+
|
|
4911
|
+
|
|
4912
|
+
<span class="md-ellipsis">
|
|
4913
|
+
Event Notifications
|
|
4914
|
+
</span>
|
|
4915
|
+
|
|
4916
|
+
|
|
4917
|
+
</a>
|
|
4918
|
+
</li>
|
|
4919
|
+
|
|
4920
|
+
|
|
4921
|
+
|
|
4922
|
+
|
|
4923
|
+
|
|
4924
|
+
|
|
4925
|
+
|
|
4926
|
+
|
|
4927
|
+
|
|
4928
|
+
|
|
4770
4929
|
<li class="md-nav__item">
|
|
4771
4930
|
<a href="../../user-guide/platform-functionality/exporttemplate.html" class="md-nav__link">
|
|
4772
4931
|
|
|
@@ -4841,7 +5000,7 @@
|
|
|
4841
5000
|
|
|
4842
5001
|
|
|
4843
5002
|
|
|
4844
|
-
<input class="md-nav__toggle md-toggle " type="checkbox" id="
|
|
5003
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_10" >
|
|
4845
5004
|
|
|
4846
5005
|
|
|
4847
5006
|
|
|
@@ -4857,14 +5016,14 @@
|
|
|
4857
5016
|
</a>
|
|
4858
5017
|
|
|
4859
5018
|
|
|
4860
|
-
<label class="md-nav__link " for="
|
|
5019
|
+
<label class="md-nav__link " for="__nav_2_4_10" id="__nav_2_4_10_label" tabindex="0">
|
|
4861
5020
|
<span class="md-nav__icon md-icon"></span>
|
|
4862
5021
|
</label>
|
|
4863
5022
|
|
|
4864
5023
|
</div>
|
|
4865
5024
|
|
|
4866
|
-
<nav class="md-nav" data-md-level="3" aria-labelledby="
|
|
4867
|
-
<label class="md-nav__title" for="
|
|
5025
|
+
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_10_label" aria-expanded="false">
|
|
5026
|
+
<label class="md-nav__title" for="__nav_2_4_10">
|
|
4868
5027
|
<span class="md-nav__icon md-icon"></span>
|
|
4869
5028
|
GraphQL
|
|
4870
5029
|
</label>
|
|
@@ -4937,7 +5096,7 @@
|
|
|
4937
5096
|
|
|
4938
5097
|
|
|
4939
5098
|
|
|
4940
|
-
<input class="md-nav__toggle md-toggle " type="checkbox" id="
|
|
5099
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_12" >
|
|
4941
5100
|
|
|
4942
5101
|
|
|
4943
5102
|
|
|
@@ -4953,14 +5112,14 @@
|
|
|
4953
5112
|
</a>
|
|
4954
5113
|
|
|
4955
5114
|
|
|
4956
|
-
<label class="md-nav__link " for="
|
|
5115
|
+
<label class="md-nav__link " for="__nav_2_4_12" id="__nav_2_4_12_label" tabindex="0">
|
|
4957
5116
|
<span class="md-nav__icon md-icon"></span>
|
|
4958
5117
|
</label>
|
|
4959
5118
|
|
|
4960
5119
|
</div>
|
|
4961
5120
|
|
|
4962
|
-
<nav class="md-nav" data-md-level="3" aria-labelledby="
|
|
4963
|
-
<label class="md-nav__title" for="
|
|
5121
|
+
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_12_label" aria-expanded="false">
|
|
5122
|
+
<label class="md-nav__title" for="__nav_2_4_12">
|
|
4964
5123
|
<span class="md-nav__icon md-icon"></span>
|
|
4965
5124
|
Jobs
|
|
4966
5125
|
</label>
|
|
@@ -5035,6 +5194,27 @@
|
|
|
5035
5194
|
|
|
5036
5195
|
|
|
5037
5196
|
|
|
5197
|
+
<li class="md-nav__item">
|
|
5198
|
+
<a href="../../user-guide/platform-functionality/jobs/jobqueue.html" class="md-nav__link">
|
|
5199
|
+
|
|
5200
|
+
|
|
5201
|
+
<span class="md-ellipsis">
|
|
5202
|
+
Job Queues
|
|
5203
|
+
</span>
|
|
5204
|
+
|
|
5205
|
+
|
|
5206
|
+
</a>
|
|
5207
|
+
</li>
|
|
5208
|
+
|
|
5209
|
+
|
|
5210
|
+
|
|
5211
|
+
|
|
5212
|
+
|
|
5213
|
+
|
|
5214
|
+
|
|
5215
|
+
|
|
5216
|
+
|
|
5217
|
+
|
|
5038
5218
|
<li class="md-nav__item">
|
|
5039
5219
|
<a href="../../user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html" class="md-nav__link">
|
|
5040
5220
|
|
|
@@ -5148,6 +5328,27 @@
|
|
|
5148
5328
|
|
|
5149
5329
|
|
|
5150
5330
|
|
|
5331
|
+
<li class="md-nav__item">
|
|
5332
|
+
<a href="../../user-guide/platform-functionality/rendering-jinja-templates.html" class="md-nav__link">
|
|
5333
|
+
|
|
5334
|
+
|
|
5335
|
+
<span class="md-ellipsis">
|
|
5336
|
+
Rendering Jinja Templates
|
|
5337
|
+
</span>
|
|
5338
|
+
|
|
5339
|
+
|
|
5340
|
+
</a>
|
|
5341
|
+
</li>
|
|
5342
|
+
|
|
5343
|
+
|
|
5344
|
+
|
|
5345
|
+
|
|
5346
|
+
|
|
5347
|
+
|
|
5348
|
+
|
|
5349
|
+
|
|
5350
|
+
|
|
5351
|
+
|
|
5151
5352
|
|
|
5152
5353
|
|
|
5153
5354
|
|
|
@@ -5159,7 +5360,7 @@
|
|
|
5159
5360
|
|
|
5160
5361
|
|
|
5161
5362
|
|
|
5162
|
-
<input class="md-nav__toggle md-toggle " type="checkbox" id="
|
|
5363
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_18" >
|
|
5163
5364
|
|
|
5164
5365
|
|
|
5165
5366
|
|
|
@@ -5175,14 +5376,14 @@
|
|
|
5175
5376
|
</a>
|
|
5176
5377
|
|
|
5177
5378
|
|
|
5178
|
-
<label class="md-nav__link " for="
|
|
5379
|
+
<label class="md-nav__link " for="__nav_2_4_18" id="__nav_2_4_18_label" tabindex="0">
|
|
5179
5380
|
<span class="md-nav__icon md-icon"></span>
|
|
5180
5381
|
</label>
|
|
5181
5382
|
|
|
5182
5383
|
</div>
|
|
5183
5384
|
|
|
5184
|
-
<nav class="md-nav" data-md-level="3" aria-labelledby="
|
|
5185
|
-
<label class="md-nav__title" for="
|
|
5385
|
+
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_18_label" aria-expanded="false">
|
|
5386
|
+
<label class="md-nav__title" for="__nav_2_4_18">
|
|
5186
5387
|
<span class="md-nav__icon md-icon"></span>
|
|
5187
5388
|
REST API
|
|
5188
5389
|
</label>
|
|
@@ -5402,10 +5603,10 @@
|
|
|
5402
5603
|
|
|
5403
5604
|
|
|
5404
5605
|
|
|
5405
|
-
<input class="md-nav__toggle md-toggle " type="checkbox" id="
|
|
5606
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2_4_25" >
|
|
5406
5607
|
|
|
5407
5608
|
|
|
5408
|
-
<label class="md-nav__link" for="
|
|
5609
|
+
<label class="md-nav__link" for="__nav_2_4_25" id="__nav_2_4_25_label" tabindex="0">
|
|
5409
5610
|
|
|
5410
5611
|
|
|
5411
5612
|
<span class="md-ellipsis">
|
|
@@ -5416,8 +5617,8 @@
|
|
|
5416
5617
|
<span class="md-nav__icon md-icon"></span>
|
|
5417
5618
|
</label>
|
|
5418
5619
|
|
|
5419
|
-
<nav class="md-nav" data-md-level="3" aria-labelledby="
|
|
5420
|
-
<label class="md-nav__title" for="
|
|
5620
|
+
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_2_4_25_label" aria-expanded="false">
|
|
5621
|
+
<label class="md-nav__title" for="__nav_2_4_25">
|
|
5421
5622
|
<span class="md-nav__icon md-icon"></span>
|
|
5422
5623
|
Users
|
|
5423
5624
|
</label>
|
|
@@ -6829,6 +7030,27 @@
|
|
|
6829
7030
|
|
|
6830
7031
|
|
|
6831
7032
|
|
|
7033
|
+
<li class="md-nav__item">
|
|
7034
|
+
<a href="../../code-reference/nautobot/apps/events.html" class="md-nav__link">
|
|
7035
|
+
|
|
7036
|
+
|
|
7037
|
+
<span class="md-ellipsis">
|
|
7038
|
+
nautobot.apps.events
|
|
7039
|
+
</span>
|
|
7040
|
+
|
|
7041
|
+
|
|
7042
|
+
</a>
|
|
7043
|
+
</li>
|
|
7044
|
+
|
|
7045
|
+
|
|
7046
|
+
|
|
7047
|
+
|
|
7048
|
+
|
|
7049
|
+
|
|
7050
|
+
|
|
7051
|
+
|
|
7052
|
+
|
|
7053
|
+
|
|
6832
7054
|
<li class="md-nav__item">
|
|
6833
7055
|
<a href="../../code-reference/nautobot/apps/exceptions.html" class="md-nav__link">
|
|
6834
7056
|
|
|
@@ -7377,6 +7599,123 @@
|
|
|
7377
7599
|
|
|
7378
7600
|
|
|
7379
7601
|
|
|
7602
|
+
|
|
7603
|
+
|
|
7604
|
+
|
|
7605
|
+
|
|
7606
|
+
|
|
7607
|
+
|
|
7608
|
+
|
|
7609
|
+
|
|
7610
|
+
|
|
7611
|
+
|
|
7612
|
+
|
|
7613
|
+
|
|
7614
|
+
|
|
7615
|
+
<li class="md-nav__item md-nav__item--nested">
|
|
7616
|
+
|
|
7617
|
+
|
|
7618
|
+
|
|
7619
|
+
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3_2_9_5" >
|
|
7620
|
+
|
|
7621
|
+
|
|
7622
|
+
|
|
7623
|
+
<div class="md-nav__link md-nav__container">
|
|
7624
|
+
<a href="../apps/migration/ui-component-framework/index.html" class="md-nav__link ">
|
|
7625
|
+
|
|
7626
|
+
|
|
7627
|
+
<span class="md-ellipsis">
|
|
7628
|
+
UI Component Framework
|
|
7629
|
+
</span>
|
|
7630
|
+
|
|
7631
|
+
|
|
7632
|
+
</a>
|
|
7633
|
+
|
|
7634
|
+
|
|
7635
|
+
<label class="md-nav__link " for="__nav_3_2_9_5" id="__nav_3_2_9_5_label" tabindex="0">
|
|
7636
|
+
<span class="md-nav__icon md-icon"></span>
|
|
7637
|
+
</label>
|
|
7638
|
+
|
|
7639
|
+
</div>
|
|
7640
|
+
|
|
7641
|
+
<nav class="md-nav" data-md-level="4" aria-labelledby="__nav_3_2_9_5_label" aria-expanded="false">
|
|
7642
|
+
<label class="md-nav__title" for="__nav_3_2_9_5">
|
|
7643
|
+
<span class="md-nav__icon md-icon"></span>
|
|
7644
|
+
UI Component Framework
|
|
7645
|
+
</label>
|
|
7646
|
+
<ul class="md-nav__list" data-md-scrollfix>
|
|
7647
|
+
|
|
7648
|
+
|
|
7649
|
+
|
|
7650
|
+
|
|
7651
|
+
|
|
7652
|
+
|
|
7653
|
+
|
|
7654
|
+
<li class="md-nav__item">
|
|
7655
|
+
<a href="../apps/migration/ui-component-framework/migration-steps.html" class="md-nav__link">
|
|
7656
|
+
|
|
7657
|
+
|
|
7658
|
+
<span class="md-ellipsis">
|
|
7659
|
+
Migration steps
|
|
7660
|
+
</span>
|
|
7661
|
+
|
|
7662
|
+
|
|
7663
|
+
</a>
|
|
7664
|
+
</li>
|
|
7665
|
+
|
|
7666
|
+
|
|
7667
|
+
|
|
7668
|
+
|
|
7669
|
+
|
|
7670
|
+
|
|
7671
|
+
|
|
7672
|
+
|
|
7673
|
+
|
|
7674
|
+
|
|
7675
|
+
<li class="md-nav__item">
|
|
7676
|
+
<a href="../apps/migration/ui-component-framework/custom-content.html" class="md-nav__link">
|
|
7677
|
+
|
|
7678
|
+
|
|
7679
|
+
<span class="md-ellipsis">
|
|
7680
|
+
Custom content
|
|
7681
|
+
</span>
|
|
7682
|
+
|
|
7683
|
+
|
|
7684
|
+
</a>
|
|
7685
|
+
</li>
|
|
7686
|
+
|
|
7687
|
+
|
|
7688
|
+
|
|
7689
|
+
|
|
7690
|
+
|
|
7691
|
+
|
|
7692
|
+
|
|
7693
|
+
|
|
7694
|
+
|
|
7695
|
+
|
|
7696
|
+
<li class="md-nav__item">
|
|
7697
|
+
<a href="../apps/migration/ui-component-framework/best-practices.html" class="md-nav__link">
|
|
7698
|
+
|
|
7699
|
+
|
|
7700
|
+
<span class="md-ellipsis">
|
|
7701
|
+
Best practices
|
|
7702
|
+
</span>
|
|
7703
|
+
|
|
7704
|
+
|
|
7705
|
+
</a>
|
|
7706
|
+
</li>
|
|
7707
|
+
|
|
7708
|
+
|
|
7709
|
+
|
|
7710
|
+
|
|
7711
|
+
</ul>
|
|
7712
|
+
</nav>
|
|
7713
|
+
|
|
7714
|
+
</li>
|
|
7715
|
+
|
|
7716
|
+
|
|
7717
|
+
|
|
7718
|
+
|
|
7380
7719
|
</ul>
|
|
7381
7720
|
</nav>
|
|
7382
7721
|
|
|
@@ -7722,6 +8061,27 @@
|
|
|
7722
8061
|
|
|
7723
8062
|
|
|
7724
8063
|
|
|
8064
|
+
<li class="md-nav__item">
|
|
8065
|
+
<a href="../core/local-k8s.html" class="md-nav__link">
|
|
8066
|
+
|
|
8067
|
+
|
|
8068
|
+
<span class="md-ellipsis">
|
|
8069
|
+
Local Kubernetes Cluster
|
|
8070
|
+
</span>
|
|
8071
|
+
|
|
8072
|
+
|
|
8073
|
+
</a>
|
|
8074
|
+
</li>
|
|
8075
|
+
|
|
8076
|
+
|
|
8077
|
+
|
|
8078
|
+
|
|
8079
|
+
|
|
8080
|
+
|
|
8081
|
+
|
|
8082
|
+
|
|
8083
|
+
|
|
8084
|
+
|
|
7725
8085
|
<li class="md-nav__item">
|
|
7726
8086
|
<a href="../core/model-checklist.html" class="md-nav__link">
|
|
7727
8087
|
|
|
@@ -7911,6 +8271,27 @@
|
|
|
7911
8271
|
|
|
7912
8272
|
|
|
7913
8273
|
|
|
8274
|
+
<li class="md-nav__item">
|
|
8275
|
+
<a href="../core/ui-component-framework.html" class="md-nav__link">
|
|
8276
|
+
|
|
8277
|
+
|
|
8278
|
+
<span class="md-ellipsis">
|
|
8279
|
+
UI Component Framework
|
|
8280
|
+
</span>
|
|
8281
|
+
|
|
8282
|
+
|
|
8283
|
+
</a>
|
|
8284
|
+
</li>
|
|
8285
|
+
|
|
8286
|
+
|
|
8287
|
+
|
|
8288
|
+
|
|
8289
|
+
|
|
8290
|
+
|
|
8291
|
+
|
|
8292
|
+
|
|
8293
|
+
|
|
8294
|
+
|
|
7914
8295
|
<li class="md-nav__item">
|
|
7915
8296
|
<a href="../core/release-checklist.html" class="md-nav__link">
|
|
7916
8297
|
|
|
@@ -7993,6 +8374,27 @@
|
|
|
7993
8374
|
|
|
7994
8375
|
|
|
7995
8376
|
|
|
8377
|
+
<li class="md-nav__item">
|
|
8378
|
+
<a href="../../release-notes/version-2.4.html" class="md-nav__link">
|
|
8379
|
+
|
|
8380
|
+
|
|
8381
|
+
<span class="md-ellipsis">
|
|
8382
|
+
Version 2.4
|
|
8383
|
+
</span>
|
|
8384
|
+
|
|
8385
|
+
|
|
8386
|
+
</a>
|
|
8387
|
+
</li>
|
|
8388
|
+
|
|
8389
|
+
|
|
8390
|
+
|
|
8391
|
+
|
|
8392
|
+
|
|
8393
|
+
|
|
8394
|
+
|
|
8395
|
+
|
|
8396
|
+
|
|
8397
|
+
|
|
7996
8398
|
<li class="md-nav__item">
|
|
7997
8399
|
<a href="../../release-notes/version-2.3.html" class="md-nav__link">
|
|
7998
8400
|
|
|
@@ -8608,15 +9010,6 @@
|
|
|
8608
9010
|
<nav class="md-nav" aria-label="Writing Jobs">
|
|
8609
9011
|
<ul class="md-nav__list">
|
|
8610
9012
|
|
|
8611
|
-
<li class="md-nav__item">
|
|
8612
|
-
<a href="#introduction-to-writing-jobs" class="md-nav__link">
|
|
8613
|
-
<span class="md-ellipsis">
|
|
8614
|
-
Introduction to Writing Jobs
|
|
8615
|
-
</span>
|
|
8616
|
-
</a>
|
|
8617
|
-
|
|
8618
|
-
</li>
|
|
8619
|
-
|
|
8620
9013
|
<li class="md-nav__item">
|
|
8621
9014
|
<a href="#job-registration" class="md-nav__link">
|
|
8622
9015
|
<span class="md-ellipsis">
|
|
@@ -9078,11 +9471,11 @@
|
|
|
9078
9471
|
<li class="md-nav__item">
|
|
9079
9472
|
<a href="#debugging-job-performance" class="md-nav__link">
|
|
9080
9473
|
<span class="md-ellipsis">
|
|
9081
|
-
Debugging
|
|
9474
|
+
Debugging job performance
|
|
9082
9475
|
</span>
|
|
9083
9476
|
</a>
|
|
9084
9477
|
|
|
9085
|
-
<nav class="md-nav" aria-label="Debugging
|
|
9478
|
+
<nav class="md-nav" aria-label="Debugging job performance">
|
|
9086
9479
|
<ul class="md-nav__list">
|
|
9087
9480
|
|
|
9088
9481
|
<li class="md-nav__item">
|
|
@@ -9109,15 +9502,6 @@
|
|
|
9109
9502
|
<nav class="md-nav" aria-label="Example Jobs">
|
|
9110
9503
|
<ul class="md-nav__list">
|
|
9111
9504
|
|
|
9112
|
-
<li class="md-nav__item">
|
|
9113
|
-
<a href="#example-everything-job" class="md-nav__link">
|
|
9114
|
-
<span class="md-ellipsis">
|
|
9115
|
-
Example "Everything" Job
|
|
9116
|
-
</span>
|
|
9117
|
-
</a>
|
|
9118
|
-
|
|
9119
|
-
</li>
|
|
9120
|
-
|
|
9121
9505
|
<li class="md-nav__item">
|
|
9122
9506
|
<a href="#creating-objects-for-a-planned-location" class="md-nav__link">
|
|
9123
9507
|
<span class="md-ellipsis">
|
|
@@ -9236,24 +9620,30 @@
|
|
|
9236
9620
|
|
|
9237
9621
|
<h1 id="jobs">Jobs<a class="headerlink" href="#jobs" title="Permanent link">¶</a></h1>
|
|
9238
9622
|
<p>Familiarity with the basic concepts of <a href="../../user-guide/platform-functionality/jobs/index.html">Jobs</a>, especially the distinction between Job classes (Python code) and Job records (Nautobot database records), is recommended before authoring your first Job.</p>
|
|
9239
|
-
<
|
|
9240
|
-
<
|
|
9623
|
+
<div class="admonition tip">
|
|
9624
|
+
<p class="admonition-title">Tip</p>
|
|
9241
9625
|
<p>From a development standpoint, it's especially important to understand that the Job database record never stores the Job class code. It only describes the <strong>existence</strong> of a Job class. The actual Job class source code is loaded into memory only.</p>
|
|
9626
|
+
</div>
|
|
9627
|
+
<div class="admonition info">
|
|
9628
|
+
<p class="admonition-title">Info</p>
|
|
9242
9629
|
<p>As an implementation detail in Nautobot 2.2.3 and later, all known Job <strong>classes</strong> are cached in the <a href="../core/application-registry.html#jobs">application registry</a>, which is refreshed at various times including Nautobot application startup and immediately prior to actually executing any given Job by a worker. This implementation detail should not be relied on directly; instead you should always use the <code>get_job()</code> and/or <code>get_jobs()</code> APIs to obtain a Job class when needed.</p>
|
|
9243
|
-
</
|
|
9630
|
+
</div>
|
|
9244
9631
|
<h2 id="migrating-jobs-from-v1-to-v2">Migrating Jobs from v1 to v2<a class="headerlink" href="#migrating-jobs-from-v1-to-v2" title="Permanent link">¶</a></h2>
|
|
9245
|
-
<
|
|
9632
|
+
<details class="version-changed">
|
|
9633
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9634
|
+
<p>See <a href="migration/from-v1.html">Migrating Jobs From Nautobot v1</a> for more information on how to migrate your existing jobs to Nautobot v2.</p>
|
|
9635
|
+
</details>
|
|
9246
9636
|
<h2 id="installing-jobs">Installing Jobs<a class="headerlink" href="#installing-jobs" title="Permanent link">¶</a></h2>
|
|
9247
9637
|
<p>Jobs may be installed in one of three ways:</p>
|
|
9248
9638
|
<ul>
|
|
9249
9639
|
<li>Manually installed as files in the <a href="../../user-guide/administration/configuration/settings.html#jobs_root"><code>JOBS_ROOT</code></a> path (which defaults to <code>$NAUTOBOT_ROOT/jobs/</code>).<ul>
|
|
9250
|
-
<li>Python files and subdirectories containing Python files will be dynamically loaded at Nautobot startup in order to discover and register available Job classes. For example, a
|
|
9640
|
+
<li>Python files and subdirectories containing Python files will be dynamically loaded at Nautobot startup in order to discover and register available Job classes. For example, a job class named <code>MyJobClass</code> in <code>$JOBS_ROOT/my_job.py</code> will be loaded into Nautobot as <code>my_job.MyJobClass</code>.</li>
|
|
9251
9641
|
<li>All Python modules in this directory are imported by Nautobot and all worker processes at startup. If you have a <code>custom_jobs.py</code> and a <code>custom_jobs_module/__init__.py</code> file in your <code>JOBS_ROOT</code>, both of these files will be imported at startup.</li>
|
|
9252
9642
|
</ul>
|
|
9253
9643
|
</li>
|
|
9254
9644
|
<li>Imported from an external <a href="../../user-guide/platform-functionality/gitrepository.html#jobs">Git repository</a>.<ul>
|
|
9255
|
-
<li>Git repositories are loaded into the module namespace of the <code>GitRepository.slug</code> value at startup. For example, if your <code>slug</code> value is <code>my_git_jobs</code> your
|
|
9256
|
-
<li>All git repositories providing
|
|
9645
|
+
<li>Git repositories are loaded into the module namespace of the <code>GitRepository.slug</code> value at startup. For example, if your <code>slug</code> value is <code>my_git_jobs</code> your jobs will be loaded into Python as <code>my_git_jobs.jobs.MyJobClass</code>.</li>
|
|
9646
|
+
<li>All git repositories providing jobs must include a <code>__init__.py</code> file at the root of the repository.</li>
|
|
9257
9647
|
<li>Nautobot and all worker processes will import the git repository's <code>jobs</code> module at startup so a <code>jobs.py</code> or <code>jobs/__init__.py</code> file must exist in the root of the repository.</li>
|
|
9258
9648
|
</ul>
|
|
9259
9649
|
</li>
|
|
@@ -9262,59 +9652,50 @@
|
|
|
9262
9652
|
</ul>
|
|
9263
9653
|
</li>
|
|
9264
9654
|
</ul>
|
|
9265
|
-
<p>In any case, each module holds one or more Job classes (Python classes), each of which serves a specific purpose. The logic of each
|
|
9266
|
-
<p>For example, we can create a module named <code>
|
|
9655
|
+
<p>In any case, each module holds one or more Job classes (Python classes), each of which serves a specific purpose. The logic of each job can be split into a number of distinct methods, each of which performs a discrete portion of the overall job logic.</p>
|
|
9656
|
+
<p>For example, we can create a module named <code>devices.py</code> to hold all of our jobs which pertain to devices in Nautobot. Within that module, we might define several jobs. Each job is defined as a Python class inheriting from <code>nautobot.apps.jobs.Job</code>, which provides the base functionality needed to accept user input and log activity.</p>
|
|
9267
9657
|
<details class="version-changed">
|
|
9268
|
-
<summary>Changed in version 2.0.0
|
|
9269
|
-
<p>All
|
|
9658
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9659
|
+
<p>All job classes that are intended to be runnable must now be registered by a call to <code>nautobot.apps.jobs.register_jobs()</code> on module import. This allows for a module to, if desired, define "abstract" base Job classes that are defined in code but are not registered (and therefore are not runnable in Nautobot). The <code>register_jobs</code> method accepts one or more job classes as arguments.</p>
|
|
9270
9660
|
</details>
|
|
9271
9661
|
<h2 id="writing-jobs">Writing Jobs<a class="headerlink" href="#writing-jobs" title="Permanent link">¶</a></h2>
|
|
9272
|
-
<h3 id="introduction-to-writing-jobs">Introduction to Writing Jobs<a class="headerlink" href="#introduction-to-writing-jobs" title="Permanent link">¶</a></h3>
|
|
9273
9662
|
<div class="admonition warning">
|
|
9274
9663
|
<p class="admonition-title">Warning</p>
|
|
9275
|
-
<p>Make sure your Job subclasses inherit from <code>nautobot.apps.
|
|
9664
|
+
<p>Make sure your Job subclasses inherit from <code>nautobot.apps.Job</code> and <em>not</em> from <code>nautobot.extras.models.Job</code> instead; if you mistakenly inherit from the latter, Django will think you want to define a new database model.</p>
|
|
9276
9665
|
</div>
|
|
9277
|
-
<
|
|
9278
|
-
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps</span> <span class="kn">import</span> <span class="n">jobs</span>
|
|
9666
|
+
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">register_jobs</span>
|
|
9279
9667
|
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
|
|
9280
|
-
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="
|
|
9281
|
-
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
|
|
9282
|
-
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a
|
|
9283
|
-
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a
|
|
9284
|
-
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a>
|
|
9285
|
-
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a>
|
|
9286
|
-
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
|
|
9287
|
-
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a>
|
|
9288
|
-
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a>
|
|
9289
|
-
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a
|
|
9290
|
-
<a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a> <span class="c1"># ... etc.</span>
|
|
9291
|
-
<a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a>
|
|
9292
|
-
<a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">some_text_input</span><span class="p">,</span> <span class="o">...</span><span class="p">):</span>
|
|
9293
|
-
<a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a> <span class="c1"># code to execute when the Job is run goes here</span>
|
|
9294
|
-
<a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a> <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"some_text_input: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">some_text_input</span><span class="p">)</span>
|
|
9295
|
-
<a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a>
|
|
9296
|
-
<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a><span class="n">jobs</span><span class="o">.</span><span class="n">register_jobs</span><span class="p">(</span><span class="n">MyNewJob</span><span class="p">)</span>
|
|
9668
|
+
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="k">class</span> <span class="nc">CreateDevices</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9669
|
+
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a> <span class="o">...</span>
|
|
9670
|
+
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a>
|
|
9671
|
+
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="k">class</span> <span class="nc">DeviceConnectionsReport</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9672
|
+
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a> <span class="o">...</span>
|
|
9673
|
+
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a>
|
|
9674
|
+
<a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="k">class</span> <span class="nc">DeviceIPsReport</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9675
|
+
<a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a> <span class="o">...</span>
|
|
9676
|
+
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a>
|
|
9677
|
+
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="n">register_jobs</span><span class="p">(</span><span class="n">CreateDevices</span><span class="p">,</span> <span class="n">DeviceConnectionsReport</span><span class="p">,</span> <span class="n">DeviceIPsReport</span><span class="p">)</span>
|
|
9297
9678
|
</code></pre></div>
|
|
9298
|
-
<p>Each
|
|
9679
|
+
<p>Each job class will implement some or all of the following components:</p>
|
|
9299
9680
|
<ul>
|
|
9300
|
-
<li
|
|
9301
|
-
<li>
|
|
9302
|
-
<li>
|
|
9303
|
-
<li>Optionally, any of the special methods <
|
|
9681
|
+
<li>Module and class attributes, providing for default behavior, documentation and discoverability</li>
|
|
9682
|
+
<li>a set of variables for user input via the Nautobot UI (if your job requires any user inputs)</li>
|
|
9683
|
+
<li>a <code>run()</code> method, which is the only required attribute on a Job class and receives the user input values, if any, as keyword arguments.</li>
|
|
9684
|
+
<li>Optionally, any of the special methods <code>before_start()</code>, <code>on_success()</code>, <code>on_failure()</code>, and/or <code>after_return()</code> (more on these later).</li>
|
|
9304
9685
|
</ul>
|
|
9305
|
-
<p>It's important to understand that
|
|
9686
|
+
<p>It's important to understand that jobs execute on the server asynchronously as background tasks; they log messages and report their status to the database by updating <a href="../../user-guide/platform-functionality/jobs/models.html#job-results"><code>JobResult</code></a> records and creating <a href="../../user-guide/platform-functionality/jobs/models.html#job-log-entry"><code>JobLogEntry</code></a> records.</p>
|
|
9306
9687
|
<div class="admonition note">
|
|
9307
|
-
<p class="admonition-title">
|
|
9688
|
+
<p class="admonition-title">Note</p>
|
|
9308
9689
|
<p>When actively developing a Job utilizing a development environment it's important to understand that the "automatically reload when code changes are detected" debugging functionality provided by <code>nautobot-server runserver</code> does <strong>not</strong> automatically restart the Celery <code>worker</code> process when code changes are made; therefore, it is required to restart the <code>worker</code> after each update to your Job source code or else it will continue to run the version of the Job code that was present when it first started. In the Nautobot core development environment, we use <code>watchmedo auto-restart</code> as a helper tool to auto-restart the workers as well on code changes; you may wish to configure your local development environment similarly for convenience.</p>
|
|
9309
9690
|
<p>Additionally, as of Nautobot 1.3, the Job database records corresponding to installed Jobs are <em>not</em> automatically refreshed when the development server auto-restarts. If you make changes to any of the class and module metadata attributes described in the following sections, the database will be refreshed to reflect these changes only after running <code>nautobot-server migrate</code> or <code>nautobot-server post_upgrade</code> (recommended) or if you manually edit a Job database record to force it to be refreshed. The exception here is Git-repository-provided Jobs; resyncing the Git repository through Nautobot will also trigger a refresh of the Job records corresponding to this repository's contents.</p>
|
|
9310
9691
|
</div>
|
|
9311
9692
|
<h3 id="job-registration">Job Registration<a class="headerlink" href="#job-registration" title="Permanent link">¶</a></h3>
|
|
9312
9693
|
<details class="version-changed">
|
|
9313
|
-
<summary>Changed in version 2.0.0
|
|
9694
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9314
9695
|
</details>
|
|
9315
|
-
<p>All Job classes, including <code>JobHookReceiver</code> and <code>JobButtonReceiver</code> classes must be registered at <strong>import time</strong> using the <code>nautobot.apps.jobs.register_jobs</code> method. This method accepts one or more
|
|
9696
|
+
<p>All Job classes, including <code>JobHookReceiver</code> and <code>JobButtonReceiver</code> classes must be registered at <strong>import time</strong> using the <code>nautobot.apps.jobs.register_jobs</code> method. This method accepts one or more job classes as arguments. You must account for how your jobs are imported when deciding where to call this method.</p>
|
|
9316
9697
|
<h4 id="registering-jobs-in-jobs_root-or-git-repositories">Registering Jobs in <code>JOBS_ROOT</code> or Git Repositories<a class="headerlink" href="#registering-jobs-in-jobs_root-or-git-repositories" title="Permanent link">¶</a></h4>
|
|
9317
|
-
<p>Only top level module names within <code>JOBS_ROOT</code> are imported by Nautobot at runtime. This means that if you're using submodules, you need to ensure that your
|
|
9698
|
+
<p>Only top level module names within <code>JOBS_ROOT</code> are imported by Nautobot at runtime. This means that if you're using submodules, you need to ensure that your jobs are either registered in your top level <code>__init__.py</code> or that this file imports your submodules where the jobs are registered:</p>
|
|
9318
9699
|
<div class="highlight"><span class="filename">$JOBS_ROOT/my_jobs/__init__.py</span><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">my_job_module</span>
|
|
9319
9700
|
</code></pre></div>
|
|
9320
9701
|
<div class="highlight"><span class="filename">$JOBS_ROOT/my_jobs/my_job_module.py</span><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">register_jobs</span>
|
|
@@ -9324,12 +9705,12 @@
|
|
|
9324
9705
|
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a>
|
|
9325
9706
|
<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a><span class="n">register_jobs</span><span class="p">(</span><span class="n">MyJob</span><span class="p">)</span>
|
|
9326
9707
|
</code></pre></div>
|
|
9327
|
-
<p>Similarly, only the <code>jobs</code> module is loaded from Git repositories. If you're using submodules, you need to ensure that your
|
|
9328
|
-
<p>If not using submodules, you should register your
|
|
9329
|
-
<p>Examples of the different directory structures when registering
|
|
9708
|
+
<p>Similarly, only the <code>jobs</code> module is loaded from Git repositories. If you're using submodules, you need to ensure that your jobs are either registered in the repository's <code>jobs/__init__.py</code> or that this file imports your submodules where the jobs are registered.</p>
|
|
9709
|
+
<p>If not using submodules, you should register your job in the file where your job is defined.</p>
|
|
9710
|
+
<p>Examples of the different directory structures when registering jobs in Git repositories:</p>
|
|
9330
9711
|
<div class="admonition note">
|
|
9331
|
-
<p class="admonition-title"
|
|
9332
|
-
<p>Take note of the <code>__init__.py</code> at the root of the repository. This is required to register
|
|
9712
|
+
<p class="admonition-title">Note</p>
|
|
9713
|
+
<p>Take note of the <code>__init__.py</code> at the root of the repository. This is required to register jobs in a Git repository.</p>
|
|
9333
9714
|
</div>
|
|
9334
9715
|
<div class="highlight"><span class="filename">jobs.py</span><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>.
|
|
9335
9716
|
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>├── __init__.py
|
|
@@ -9342,7 +9723,7 @@
|
|
|
9342
9723
|
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a> └── my_job_module.py
|
|
9343
9724
|
</code></pre></div>
|
|
9344
9725
|
<h4 id="registering-jobs-in-an-app">Registering Jobs in an App<a class="headerlink" href="#registering-jobs-in-an-app" title="Permanent link">¶</a></h4>
|
|
9345
|
-
<p>Apps should register
|
|
9726
|
+
<p>Apps should register jobs in the module defined in their <a href="../apps/api/nautobot-app-config.html#nautobotappconfig-code-location-attributes"><code>NautobotAppConfig.jobs</code></a> property. This defaults to the <code>jobs</code> module of the App.</p>
|
|
9346
9727
|
<h3 id="reserved-attribute-names">Reserved Attribute Names<a class="headerlink" href="#reserved-attribute-names" title="Permanent link">¶</a></h3>
|
|
9347
9728
|
<p>There are many attributes and methods of the Job class that serve as reserved names. You must be careful when implementing custom methods or defining the user input <a href="#variables">variables</a> for your Job that you do not inadvertently "step on" one of these reserved attributes causing unexpected behavior or errors.</p>
|
|
9348
9729
|
<div class="admonition example">
|
|
@@ -9522,21 +9903,21 @@
|
|
|
9522
9903
|
</table>
|
|
9523
9904
|
<h3 id="module-metadata-attributes">Module Metadata Attributes<a class="headerlink" href="#module-metadata-attributes" title="Permanent link">¶</a></h3>
|
|
9524
9905
|
<h4 id="name-grouping"><code>name</code> (Grouping)<a class="headerlink" href="#name-grouping" title="Permanent link">¶</a></h4>
|
|
9525
|
-
<p>You can define a global constant called <code>name</code> within a job module (the Python file which contains one or more
|
|
9906
|
+
<p>You can define a global constant called <code>name</code> within a job module (the Python file which contains one or more job classes) to set the default grouping under which jobs in this module will be displayed in the Nautobot UI. If this value is not defined, the module's file name will be used. This "grouping" value may also be defined or overridden when editing Job records in the database.</p>
|
|
9526
9907
|
<div class="admonition note">
|
|
9527
9908
|
<p class="admonition-title">Note</p>
|
|
9528
9909
|
<p>In some UI elements and API endpoints, the module file name is displayed in addition to or in place of this attribute, so even if defining this attribute, you should still choose an appropriately explanatory file name as well.</p>
|
|
9529
9910
|
</div>
|
|
9530
9911
|
<h3 id="class-metadata-attributes">Class Metadata Attributes<a class="headerlink" href="#class-metadata-attributes" title="Permanent link">¶</a></h3>
|
|
9531
|
-
<p>Job-specific attributes may be defined under a class named <code>Meta</code> within each
|
|
9912
|
+
<p>Job-specific attributes may be defined under a class named <code>Meta</code> within each job class you implement. All of these are optional, but encouraged.</p>
|
|
9532
9913
|
<h4 id="name"><code>name</code><a class="headerlink" href="#name" title="Permanent link">¶</a></h4>
|
|
9533
|
-
<p>This is the human-friendly name of your
|
|
9914
|
+
<p>This is the human-friendly name of your job, as will be displayed in the Nautobot UI. If not set, the class name will be used.</p>
|
|
9534
9915
|
<div class="admonition note">
|
|
9535
9916
|
<p class="admonition-title">Note</p>
|
|
9536
9917
|
<p>In some UI elements and API endpoints, the class name is displayed in addition to or in place of this attribute, so even if defining this attribute, you should still choose an appropriately explanatory class name as well.</p>
|
|
9537
9918
|
</div>
|
|
9538
9919
|
<h4 id="description"><code>description</code><a class="headerlink" href="#description" title="Permanent link">¶</a></h4>
|
|
9539
|
-
<p>An optional human-friendly description of what this
|
|
9920
|
+
<p>An optional human-friendly description of what this job does.
|
|
9540
9921
|
This can accept either plain text, Markdown-formatted text, or <a href="../../user-guide/platform-functionality/template-filters.html#render_markdown">a limited subset of HTML</a>. It can also be multiple lines:</p>
|
|
9541
9922
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="k">class</span> <span class="nc">ExampleJob</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9542
9923
|
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a> <span class="k">class</span> <span class="nc">Meta</span><span class="p">:</span>
|
|
@@ -9548,64 +9929,63 @@ This can accept either plain text, Markdown-formatted text, or <a href="../../us
|
|
|
9548
9929
|
<a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="s2"> 3. It's a floor wax *and* a dessert topping</span>
|
|
9549
9930
|
<a id="__codelineno-5-9" name="__codelineno-5-9" href="#__codelineno-5-9"></a><span class="s2"> """</span>
|
|
9550
9931
|
</code></pre></div>
|
|
9551
|
-
<p>If you code a multi-line description, the first line only will be used in the description column of the
|
|
9932
|
+
<p>If you code a multi-line description, the first line only will be used in the description column of the jobs list, while the full description will be rendered in the job detail view, submission, approval, and results pages.</p>
|
|
9552
9933
|
<h4 id="approval_required"><code>approval_required</code><a class="headerlink" href="#approval_required" title="Permanent link">¶</a></h4>
|
|
9553
9934
|
<p>Default: <code>False</code></p>
|
|
9554
|
-
<p>A boolean that will mark this
|
|
9935
|
+
<p>A boolean that will mark this job as requiring approval from another user to be run. For more details on approvals, <a href="../../user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html">please refer to the section on scheduling and approvals</a>.</p>
|
|
9555
9936
|
<h4 id="dryrun_default"><code>dryrun_default</code><a class="headerlink" href="#dryrun_default" title="Permanent link">¶</a></h4>
|
|
9556
9937
|
<details class="version-changed">
|
|
9557
|
-
<summary>Changed in version 2.0.0
|
|
9558
|
-
<p>The <code>commit_default</code> field was renamed to <code>dryrun_default</code> and the default value was changed from <code>True</code> to <code>False</code>. The <code>commit</code> functionality that provided an automatic rollback of database changes if the
|
|
9938
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9939
|
+
<p>The <code>commit_default</code> field was renamed to <code>dryrun_default</code> and the default value was changed from <code>True</code> to <code>False</code>. The <code>commit</code> functionality that provided an automatic rollback of database changes if the job failed was removed. The <code>dryrun</code> functionality was added to provide a way to bypass job approval if a job implements a <a href="#dryrunvar"><code>DryRunVar</code></a>.</p>
|
|
9559
9940
|
</details>
|
|
9560
9941
|
<p>Default: <code>False</code></p>
|
|
9561
|
-
<p>
|
|
9562
|
-
The checkbox to enable dryrun when executing a Job is unchecked by default in the Nautobot UI. You can set <code>dryrun_default</code> to <code>True</code> under the <code>Meta</code> class if you want this option to instead be checked by default.</p>
|
|
9942
|
+
<p>The checkbox to enable dryrun when executing a job is unchecked by default in the Nautobot UI. You can set <code>dryrun_default</code> to <code>True</code> under the <code>Meta</code> class if you want this option to instead be checked by default.</p>
|
|
9563
9943
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="k">class</span> <span class="nc">MyJob</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9564
9944
|
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a> <span class="k">class</span> <span class="nc">Meta</span><span class="p">:</span>
|
|
9565
9945
|
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a> <span class="n">dryrun_default</span> <span class="o">=</span> <span class="kc">True</span>
|
|
9566
9946
|
</code></pre></div>
|
|
9567
9947
|
<h4 id="field_order"><code>field_order</code><a class="headerlink" href="#field_order" title="Permanent link">¶</a></h4>
|
|
9568
9948
|
<p>Default: <code>[]</code></p>
|
|
9569
|
-
<p>A list of strings (field names) representing the order your
|
|
9949
|
+
<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>
|
|
9570
9950
|
<h4 id="has_sensitive_variables"><code>has_sensitive_variables</code><a class="headerlink" href="#has_sensitive_variables" title="Permanent link">¶</a></h4>
|
|
9571
9951
|
<details class="version-added">
|
|
9572
9952
|
<summary>Added in version 1.3.10</summary>
|
|
9573
9953
|
</details>
|
|
9574
9954
|
<p>Default: <code>True</code></p>
|
|
9575
|
-
<p>Unless set to False, it prevents the
|
|
9576
|
-
<p>Important notes about
|
|
9955
|
+
<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>
|
|
9956
|
+
<p>Important notes about jobs with sensitive variables:</p>
|
|
9577
9957
|
<ul>
|
|
9578
|
-
<li>Such
|
|
9579
|
-
<li>Jobs with sensitive variables cannot be marked as requiring approval (as
|
|
9958
|
+
<li>Such jobs cannot be scheduled to run in the future or on a recurring schedule (as scheduled jobs must by necessity store their variables in the database for future reference).</li>
|
|
9959
|
+
<li>Jobs with sensitive variables cannot be marked as requiring approval (as jobs pending approval must store their variables in the database until approved).</li>
|
|
9580
9960
|
</ul>
|
|
9581
9961
|
<h4 id="hidden"><code>hidden</code><a class="headerlink" href="#hidden" title="Permanent link">¶</a></h4>
|
|
9582
9962
|
<p>Default: <code>False</code></p>
|
|
9583
|
-
<p>A Boolean that if set to <code>True</code> prevents the
|
|
9584
|
-
<p>Since the
|
|
9585
|
-
<p>Important notes about hidden
|
|
9963
|
+
<p>A Boolean that if set to <code>True</code> prevents the job from being displayed by default in the list of Jobs in the Nautobot UI.</p>
|
|
9964
|
+
<p>Since the jobs execution framework is designed to be generic, there may be several technical jobs defined by users which interact with or are invoked by external systems. In such cases, these jobs are not meant to be executed by a human and likely do not make sense to expose to end users for execution, and thus having them exposed in the UI at all is extraneous.</p>
|
|
9965
|
+
<p>Important notes about hidden jobs:</p>
|
|
9586
9966
|
<ul>
|
|
9587
9967
|
<li>This is merely hiding them by default from the web interface. It is NOT a security feature.</li>
|
|
9588
|
-
<li>In the Jobs list view it is possible to filter to "Hidden: (no selection)" or even "Hidden: Yes" to list the hidden
|
|
9589
|
-
<li>All Job UI and REST API endpoints still exist for hidden
|
|
9590
|
-
<li>Hidden
|
|
9591
|
-
<li>Results for hidden
|
|
9968
|
+
<li>In the Jobs list view it is possible to filter to "Hidden: (no selection)" or even "Hidden: Yes" to list the hidden jobs.</li>
|
|
9969
|
+
<li>All Job UI and REST API endpoints still exist for hidden jobs and can be accessed by any user who is aware of their existence.</li>
|
|
9970
|
+
<li>Hidden jobs can still be executed through the UI or the REST API given the appropriate URL.</li>
|
|
9971
|
+
<li>Results for hidden jobs will still appear in the Job Results list after they are run.</li>
|
|
9592
9972
|
</ul>
|
|
9593
9973
|
<h4 id="read_only"><code>read_only</code><a class="headerlink" href="#read_only" title="Permanent link">¶</a></h4>
|
|
9594
9974
|
<details class="version-added">
|
|
9595
9975
|
<summary>Added in version 1.1.0</summary>
|
|
9596
9976
|
</details>
|
|
9597
9977
|
<details class="version-changed">
|
|
9598
|
-
<summary>Changed in version 2.0.0
|
|
9599
|
-
<p>The <code>read_only</code> flag no longer changes the behavior of Nautobot core and is up to the
|
|
9978
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9979
|
+
<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>
|
|
9600
9980
|
</details>
|
|
9601
9981
|
<p>Default: <code>False</code></p>
|
|
9602
|
-
<p>A boolean that can be set by the
|
|
9982
|
+
<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>
|
|
9603
9983
|
<h4 id="soft_time_limit"><code>soft_time_limit</code><a class="headerlink" href="#soft_time_limit" title="Permanent link">¶</a></h4>
|
|
9604
9984
|
<details class="version-added">
|
|
9605
9985
|
<summary>Added in version 1.3.0</summary>
|
|
9606
9986
|
</details>
|
|
9607
|
-
<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
|
|
9608
|
-
<p>The <code>celery.exceptions.SoftTimeLimitExceeded</code> exception will be raised when this soft time limit is exceeded. The
|
|
9987
|
+
<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>
|
|
9988
|
+
<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>
|
|
9609
9989
|
<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>
|
|
9610
9990
|
<a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span>
|
|
9611
9991
|
<a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a>
|
|
@@ -9628,16 +10008,20 @@ The checkbox to enable dryrun when executing a Job is unchecked by default in th
|
|
|
9628
10008
|
<summary>Added in version 1.5.0</summary>
|
|
9629
10009
|
</details>
|
|
9630
10010
|
<p>Default: <code>[]</code></p>
|
|
9631
|
-
<p>A list of
|
|
10011
|
+
<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>
|
|
10012
|
+
<details class="version-changed">
|
|
10013
|
+
<summary>Changed in version 2.4.0 — Changed default queue selection</summary>
|
|
10014
|
+
<p>As a result of the addition of Job Queues, the default queue when running a Job without explicitly selecting a queue is now the job queue specified in the <code>default_job_queue</code> field on the Job model. <code>default_job_queue</code> fields for any existing Job instances are automatically populated with the name of the first entry in <code>task_queues</code> list of the Job class. When <code>task_queues</code> list on the Job class is empty, the corresponding Job instance's <code>default_job_queue</code> will be the job queue with the name provided by <code>settings.CELERY_TASK_DEFAULT_QUEUE</code>. You can also override the initial <code>default_job_queue</code> by setting <code>default_job_queue_override</code> to True and assign the field with a different Job Queue instance.</p>
|
|
10015
|
+
</details>
|
|
9632
10016
|
<div class="admonition note">
|
|
9633
10017
|
<p class="admonition-title">Note</p>
|
|
9634
|
-
<p>A worker must be listening on the requested queue or the
|
|
10018
|
+
<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>
|
|
9635
10019
|
</div>
|
|
9636
10020
|
<h4 id="template_name"><code>template_name</code><a class="headerlink" href="#template_name" title="Permanent link">¶</a></h4>
|
|
9637
10021
|
<details class="version-added">
|
|
9638
10022
|
<summary>Added in version 1.4.0</summary>
|
|
9639
10023
|
</details>
|
|
9640
|
-
<p>A path relative to the
|
|
10024
|
+
<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>
|
|
9641
10025
|
<p>A template can provide additional JavaScript, CSS, or even display HTML. A good starting template would be:</p>
|
|
9642
10026
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>{% extends 'extras/job.html' %}
|
|
9643
10027
|
<a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a>
|
|
@@ -9655,7 +10039,7 @@ The checkbox to enable dryrun when executing a Job is unchecked by default in th
|
|
|
9655
10039
|
<a id="__codelineno-8-14" name="__codelineno-8-14" href="#__codelineno-8-14"></a>{% endblock javascript %}
|
|
9656
10040
|
</code></pre></div>
|
|
9657
10041
|
<details class="version-added">
|
|
9658
|
-
<summary>Added in version 2.2.0
|
|
10042
|
+
<summary>Added in version 2.2.0</summary>
|
|
9659
10043
|
<p>Added the <code>job_form</code> and <code>schedule_form</code> sub-blocks to <code>extras/job.html</code>, for use by Jobs that just want to override the rendered forms without replacing all of <code>{% block content %}</code>.</p>
|
|
9660
10044
|
</details>
|
|
9661
10045
|
<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>
|
|
@@ -9664,7 +10048,7 @@ The checkbox to enable dryrun when executing a Job is unchecked by default in th
|
|
|
9664
10048
|
<summary>Added in version 1.3.0</summary>
|
|
9665
10049
|
</details>
|
|
9666
10050
|
<p>An int or float value, in seconds, which can be used to override the
|
|
9667
|
-
default <a href="../../user-guide/administration/configuration/settings.html#celery_task_time_limit">hard time limit</a> (10 minutes by default) for a
|
|
10051
|
+
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>
|
|
9668
10052
|
<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>
|
|
9669
10053
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span>
|
|
9670
10054
|
<a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a>
|
|
@@ -9680,11 +10064,11 @@ default <a href="../../user-guide/administration/configuration/settings.html#cel
|
|
|
9680
10064
|
<a id="__codelineno-9-12" name="__codelineno-9-12" href="#__codelineno-9-12"></a> <span class="n">job_code</span><span class="p">()</span>
|
|
9681
10065
|
</code></pre></div>
|
|
9682
10066
|
<div class="admonition note">
|
|
9683
|
-
<p class="admonition-title"
|
|
9684
|
-
<p>If the <code>time_limit</code> is set to a value less than or equal to the <code>soft_time_limit</code>, a warning log is generated to inform the user that this
|
|
10067
|
+
<p class="admonition-title">Note</p>
|
|
10068
|
+
<p>If the <code>time_limit</code> is set to a value less than or equal to the <code>soft_time_limit</code>, a warning log is generated to inform the user that this job will fail silently after the <code>time_limit</code> as the <code>soft_time_limit</code> will never be reached.</p>
|
|
9685
10069
|
</div>
|
|
9686
10070
|
<h3 id="variables">Variables<a class="headerlink" href="#variables" title="Permanent link">¶</a></h3>
|
|
9687
|
-
<p>Variables allow your
|
|
10071
|
+
<p>Variables allow your job to accept user input via the Nautobot UI, but they are optional; if your job does not require any user input, there is no need to define any variables. Conversely, if you are making use of user input in your job, you <em>must</em> also implement the <code>run()</code> method, as it is the only entry point to your job that has visibility into the variable values provided by the user.</p>
|
|
9688
10072
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">StringVar</span><span class="p">,</span> <span class="n">IntegerVar</span><span class="p">,</span> <span class="n">ObjectVar</span>
|
|
9689
10073
|
<a id="__codelineno-10-2" name="__codelineno-10-2" href="#__codelineno-10-2"></a>
|
|
9690
10074
|
<a id="__codelineno-10-3" name="__codelineno-10-3" href="#__codelineno-10-3"></a><span class="k">class</span> <span class="nc">CreateDevices</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
@@ -9697,7 +10081,7 @@ default <a href="../../user-guide/administration/configuration/settings.html#cel
|
|
|
9697
10081
|
</code></pre></div>
|
|
9698
10082
|
<p>The remainder of this section documents the various supported variable types and how to make use of them.</p>
|
|
9699
10083
|
<h4 id="default-variable-options">Default Variable Options<a class="headerlink" href="#default-variable-options" title="Permanent link">¶</a></h4>
|
|
9700
|
-
<p>All
|
|
10084
|
+
<p>All job variables support the following default options:</p>
|
|
9701
10085
|
<ul>
|
|
9702
10086
|
<li><code>default</code> - The field's default value</li>
|
|
9703
10087
|
<li><code>description</code> - A brief user-friendly description of the field</li>
|
|
@@ -9719,7 +10103,7 @@ default <a href="../../user-guide/administration/configuration/settings.html#cel
|
|
|
9719
10103
|
<details class="version-added">
|
|
9720
10104
|
<summary>Added in version 2.1.0</summary>
|
|
9721
10105
|
</details>
|
|
9722
|
-
<p>Accepts JSON-formatted data of any length. Renders as a multi-line text input field. The variable passed to <code>run()</code> method on the
|
|
10106
|
+
<p>Accepts JSON-formatted data of any length. Renders as a multi-line text input field. The variable passed to <code>run()</code> method on the job has been serialized to the appropriate Python objects.</p>
|
|
9723
10107
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="k">class</span> <span class="nc">ExampleJSONVarJob</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
9724
10108
|
<a id="__codelineno-11-2" name="__codelineno-11-2" href="#__codelineno-11-2"></a> <span class="n">var1</span> <span class="o">=</span> <span class="n">JSONVar</span><span class="p">()</span>
|
|
9725
10109
|
<a id="__codelineno-11-3" name="__codelineno-11-3" href="#__codelineno-11-3"></a>
|
|
@@ -9727,7 +10111,7 @@ default <a href="../../user-guide/administration/configuration/settings.html#cel
|
|
|
9727
10111
|
<a id="__codelineno-11-5" name="__codelineno-11-5" href="#__codelineno-11-5"></a> <span class="c1"># var1 form data equals '{"key1": "value1"}'</span>
|
|
9728
10112
|
<a id="__codelineno-11-6" name="__codelineno-11-6" href="#__codelineno-11-6"></a> <span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"The value of key1 is: </span><span class="si">%s</span><span class="s2">"</span><span class="p">,</span> <span class="n">var1</span><span class="p">[</span><span class="s2">"key1"</span><span class="p">])</span>
|
|
9729
10113
|
</code></pre></div>
|
|
9730
|
-
<p>In the above example <code>{"key1": "value1"}</code> is provided to the
|
|
10114
|
+
<p>In the above example <code>{"key1": "value1"}</code> is provided to the job form, on submission first the field is validated to be JSON-formatted data then is serialized and passed to the <code>run()</code> method as a dictionary without any need for the job developer to post-process the variable into a Python dictionary.</p>
|
|
9731
10115
|
<h4 id="integervar"><code>IntegerVar</code><a class="headerlink" href="#integervar" title="Permanent link">¶</a></h4>
|
|
9732
10116
|
<p>Stores a numeric integer. Options include:</p>
|
|
9733
10117
|
<ul>
|
|
@@ -9737,7 +10121,7 @@ default <a href="../../user-guide/administration/configuration/settings.html#cel
|
|
|
9737
10121
|
<h4 id="booleanvar"><code>BooleanVar</code><a class="headerlink" href="#booleanvar" title="Permanent link">¶</a></h4>
|
|
9738
10122
|
<p>A true/false flag. This field has no options beyond the defaults listed above.</p>
|
|
9739
10123
|
<h4 id="dryrunvar"><code>DryRunVar</code><a class="headerlink" href="#dryrunvar" title="Permanent link">¶</a></h4>
|
|
9740
|
-
<p>A true/false flag with special handling for
|
|
10124
|
+
<p>A true/false flag with special handling for jobs that require approval. If <code>dryrun = DryRunVar()</code> is declared on a job class, approval may be bypassed if <code>dryrun</code> is set to <code>True</code> on job execution.</p>
|
|
9741
10125
|
<h4 id="choicevar"><code>ChoiceVar</code><a class="headerlink" href="#choicevar" title="Permanent link">¶</a></h4>
|
|
9742
10126
|
<p>A set of choices from which the user can select one.</p>
|
|
9743
10127
|
<ul>
|
|
@@ -9814,7 +10198,7 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9814
10198
|
<h4 id="multiobjectvar"><code>MultiObjectVar</code><a class="headerlink" href="#multiobjectvar" title="Permanent link">¶</a></h4>
|
|
9815
10199
|
<p>Similar to <code>ObjectVar</code>, but allows for the selection of multiple objects.</p>
|
|
9816
10200
|
<h4 id="filevar"><code>FileVar</code><a class="headerlink" href="#filevar" title="Permanent link">¶</a></h4>
|
|
9817
|
-
<p>An uploaded file. Note that uploaded files are present in memory only for the duration of the
|
|
10201
|
+
<p>An uploaded file. Note that uploaded files are present in memory only for the duration of the job's execution: They will not be automatically saved for future use. The job is responsible for writing file contents to disk where necessary.</p>
|
|
9818
10202
|
<h4 id="ipaddressvar"><code>IPAddressVar</code><a class="headerlink" href="#ipaddressvar" title="Permanent link">¶</a></h4>
|
|
9819
10203
|
<p>An IPv4 or IPv6 address, without a mask. Returns a <code>netaddr.IPAddress</code> object.</p>
|
|
9820
10204
|
<h4 id="ipaddresswithmaskvar"><code>IPAddressWithMaskVar</code><a class="headerlink" href="#ipaddresswithmaskvar" title="Permanent link">¶</a></h4>
|
|
@@ -9829,14 +10213,14 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9829
10213
|
<p>Nautobot Jobs when executed will be instantiated by Nautobot, then Nautobot will call in order the special API methods <code>before_start()</code>, <code>run()</code>, <code>on_success()</code>/<code>on_failure()</code>, and <code>after_return()</code>. You must implement the <code>run()</code> method; the other methods have default implementations that do nothing.</p>
|
|
9830
10214
|
<p>As Jobs are Python classes, you are of course free to define any number of other helper methods or functions that you call yourself from within any of the above special methods, but the above are the only ones that will be automatically called.</p>
|
|
9831
10215
|
<details class="version-removed">
|
|
9832
|
-
<summary>Removed in version 2.0.0
|
|
10216
|
+
<summary>Removed in version 2.0.0</summary>
|
|
9833
10217
|
<p>The NetBox backwards compatible <code>test_*()</code> and <code>post_run()</code> special methods have been removed.</p>
|
|
9834
10218
|
</details>
|
|
9835
10219
|
<h4 id="the-before_start-method">The <code>before_start()</code> Method<a class="headerlink" href="#the-before_start-method" title="Permanent link">¶</a></h4>
|
|
9836
10220
|
<p>The <code>before_start()</code> method may optionally be implemented to perform any appropriate Job-specific setup before the <code>run()</code> method is called. It has the signature <code>before_start(self, task_id, args, kwargs)</code> for historical reasons; the <code>task_id</code> parameter will always be identical to <code>self.request.id</code>, the <code>args</code> parameter will generally be empty, and any user-specified variables passed into the Job execution will be present in the <code>kwargs</code> parameter.</p>
|
|
9837
10221
|
<p>The return value from <code>before_start()</code> is ignored, but if it raises any exception, the Job execution will be marked as a failure and <code>run()</code> will not be called.</p>
|
|
9838
10222
|
<h4 id="the-run-method">The <code>run()</code> Method<a class="headerlink" href="#the-run-method" title="Permanent link">¶</a></h4>
|
|
9839
|
-
<p>The <code>run()</code> method is the primary worker of any Job, and must be implemented. After the <code>self</code> argument, it should accept keyword arguments for any variables defined on the
|
|
10223
|
+
<p>The <code>run()</code> method is the primary worker of any Job, and must be implemented. After the <code>self</code> argument, it should accept keyword arguments for any variables defined on the job:</p>
|
|
9840
10224
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">StringVar</span><span class="p">,</span> <span class="n">IntegerVar</span><span class="p">,</span> <span class="n">ObjectVar</span>
|
|
9841
10225
|
<a id="__codelineno-18-2" name="__codelineno-18-2" href="#__codelineno-18-2"></a>
|
|
9842
10226
|
<a id="__codelineno-18-3" name="__codelineno-18-3" href="#__codelineno-18-3"></a><span class="k">class</span> <span class="nc">CreateDevices</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
@@ -9847,13 +10231,13 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9847
10231
|
<a id="__codelineno-18-8" name="__codelineno-18-8" href="#__codelineno-18-8"></a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">var1</span><span class="p">,</span> <span class="n">var2</span><span class="p">,</span> <span class="n">var3</span><span class="p">):</span>
|
|
9848
10232
|
<a id="__codelineno-18-9" name="__codelineno-18-9" href="#__codelineno-18-9"></a> <span class="o">...</span>
|
|
9849
10233
|
</code></pre></div>
|
|
9850
|
-
<p>Again, defining user variables is totally optional; you may create a
|
|
10234
|
+
<p>Again, defining user variables is totally optional; you may create a job with a <code>run()</code> method with only the <code>self</code> argument if no user input is needed.</p>
|
|
9851
10235
|
<div class="admonition warning">
|
|
9852
|
-
<p class="admonition-title">
|
|
10236
|
+
<p class="admonition-title">Warning</p>
|
|
9853
10237
|
<p>When writing Jobs that create and manipulate data it is recommended to make use of the <code>validated_save()</code> convenience method which exists on all core models. This method saves the instance data but first enforces model validation logic. Simply calling <code>save()</code> on the model instance <strong>does not</strong> enforce validation automatically and may lead to bad data. See the development <a href="../core/best-practices.html">best practices</a>.</p>
|
|
9854
10238
|
</div>
|
|
9855
10239
|
<div class="admonition warning">
|
|
9856
|
-
<p class="admonition-title">
|
|
10240
|
+
<p class="admonition-title">Warning</p>
|
|
9857
10241
|
<p>The Django ORM provides methods to create/edit many objects at once, namely <code>bulk_create()</code> and <code>update()</code>. These are best avoided in most cases as they bypass a model's built-in validation and can easily lead to database corruption if not used carefully.</p>
|
|
9858
10242
|
</div>
|
|
9859
10243
|
<p>If <code>run()</code> returns any value (even the implicit <code>None</code>), the Job execution will be marked as a success and the returned value will be stored in the associated JobResult database record. Conversely, if <code>run()</code> raises any exception, the Job execution will be marked as a failure and the traceback will be stored in the JobResult.</p>
|
|
@@ -9867,8 +10251,8 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9867
10251
|
<details class="version-changed">
|
|
9868
10252
|
<summary>Changed in version 2.0.0</summary>
|
|
9869
10253
|
</details>
|
|
9870
|
-
<p>Messages logged from a
|
|
9871
|
-
<p>The logger can be accessed either by using the <code>logger</code> property on the
|
|
10254
|
+
<p>Messages logged from a job's logger will be stored in <a href="../../user-guide/platform-functionality/jobs/models.html#job-log-entry"><code>JobLogEntry</code></a> records associated with the current <a href="../../user-guide/platform-functionality/jobs/models.html#job-results"><code>JobResult</code></a>.</p>
|
|
10255
|
+
<p>The logger can be accessed either by using the <code>logger</code> property on the job class or <code>nautobot.extras.jobs.get_task_logger(__name__)</code>. Both will return the same logger instance. For more information on the standard Python logging module, see the <a href="https://docs.python.org/3/library/logging.html">Python documentation</a>.</p>
|
|
9872
10256
|
<p>The logger accepts an <code>extra</code> kwarg that you can optionally set for the following features:</p>
|
|
9873
10257
|
<ul>
|
|
9874
10258
|
<li><code>grouping</code>- Replaces the <code>active_test</code> Job property in Nautobot v1.X</li>
|
|
@@ -9897,16 +10281,20 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9897
10281
|
</div>
|
|
9898
10282
|
<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>
|
|
9899
10283
|
<details class="version-changed">
|
|
9900
|
-
<summary>Changed in version 1.3.4
|
|
9901
|
-
<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"
|
|
10284
|
+
<summary>Changed in version 1.3.4</summary>
|
|
10285
|
+
<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">settings.SANITIZER_PATTERNS</a>.</p>
|
|
9902
10286
|
</details>
|
|
9903
10287
|
<details class="version-changed">
|
|
9904
|
-
<summary>Changed in version 2.0.0
|
|
9905
|
-
<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
|
|
10288
|
+
<summary>Changed in version 2.0.0</summary>
|
|
10289
|
+
<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>
|
|
9906
10290
|
</details>
|
|
9907
10291
|
<details class="version-changed">
|
|
9908
10292
|
<summary>Changed in version 2.0.0</summary>
|
|
9909
|
-
<p>The <code>AbortTransaction</code> class was moved from the <code>nautobot.utilities.exceptions</code> module to <code>nautobot.core.exceptions</code
|
|
10293
|
+
<p>The <code>AbortTransaction</code> class was moved from the <code>nautobot.utilities.exceptions</code> module to <code>nautobot.core.exceptions</code>.</p>
|
|
10294
|
+
</details>
|
|
10295
|
+
<details class="version-added">
|
|
10296
|
+
<summary>Added in version 2.4.0</summary>
|
|
10297
|
+
<p>You can now use <code>self.logger.success()</code> to set the log level to <code>SUCCESS</code>.</p>
|
|
9910
10298
|
</details>
|
|
9911
10299
|
<h3 id="file-output">File Output<a class="headerlink" href="#file-output" title="Permanent link">¶</a></h3>
|
|
9912
10300
|
<details class="version-added">
|
|
@@ -9923,8 +10311,8 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9923
10311
|
<p>The above Job when run will create two files, "greeting.txt" and "farewell.txt", that will be made available for download from the JobResult detail view's "Advanced" tab and via the REST API. These files will persist indefinitely, but can automatically be deleted if the JobResult itself is deleted; they can also be deleted manually by an administrator via the "File Proxies" link in the Admin UI.</p>
|
|
9924
10312
|
<p>The maximum size of any single created file (or in other words, the maximum number of bytes that can be passed to <code>self.create_file()</code>) is controlled by the <a href="../../user-guide/administration/configuration/settings.html#job_create_file_max_size"><code>JOB_CREATE_FILE_MAX_SIZE</code></a> system setting. A <code>ValueError</code> exception will be raised if <code>create_file()</code> is called with an overly large <code>content</code> value.</p>
|
|
9925
10313
|
<h3 id="marking-a-job-as-failed">Marking a Job as Failed<a class="headerlink" href="#marking-a-job-as-failed" title="Permanent link">¶</a></h3>
|
|
9926
|
-
<p>To mark a
|
|
9927
|
-
<p>As an example, the following
|
|
10314
|
+
<p>To mark a job as failed, raise an exception from within the <code>run()</code> method. The exception message will be logged to the traceback of the job result. The job result status will be set to <code>failed</code>. To output a job log message you can use the <code>self.logger.error()</code> method.</p>
|
|
10315
|
+
<p>As an example, the following job will fail if the user does not put the word "Taco" in <code>var1</code>:</p>
|
|
9928
10316
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">StringVar</span>
|
|
9929
10317
|
<a id="__codelineno-22-2" name="__codelineno-22-2" href="#__codelineno-22-2"></a>
|
|
9930
10318
|
<a id="__codelineno-22-3" name="__codelineno-22-3" href="#__codelineno-22-3"></a><span class="k">class</span> <span class="nc">MyJob</span><span class="p">(</span><span class="n">Job</span><span class="p">):</span>
|
|
@@ -9937,10 +10325,10 @@ Another example of using the nested reference would be to access <a href="../../
|
|
|
9937
10325
|
</code></pre></div>
|
|
9938
10326
|
<h3 id="accessing-user-and-job-result">Accessing User and Job Result<a class="headerlink" href="#accessing-user-and-job-result" title="Permanent link">¶</a></h3>
|
|
9939
10327
|
<details class="version-changed">
|
|
9940
|
-
<summary>Changed in version 2.0.0
|
|
10328
|
+
<summary>Changed in version 2.0.0</summary>
|
|
9941
10329
|
<p>The <code>request</code> property has been changed to a Celery request instead of a Django web request and no longer includes the information from the web request that initiated the Job. The <code>user</code> object is now available as <code>self.user</code> instead of <code>self.request.user</code>.</p>
|
|
9942
10330
|
</details>
|
|
9943
|
-
<p>The user that initiated the
|
|
10331
|
+
<p>The user that initiated the job and the job result associated to the job can be accessed through properties on the job class:</p>
|
|
9944
10332
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a><span class="n">username</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">user</span><span class="o">.</span><span class="n">username</span>
|
|
9945
10333
|
<a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a><span class="n">job_result_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">job_result</span><span class="o">.</span><span class="n">id</span>
|
|
9946
10334
|
<a id="__codelineno-23-3" name="__codelineno-23-3" href="#__codelineno-23-3"></a><span class="bp">self</span><span class="o">.</span><span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s2">"Job </span><span class="si">%s</span><span class="s2"> initiated by user </span><span class="si">%s</span><span class="s2"> is running."</span><span class="p">,</span> <span class="n">job_result_id</span><span class="p">,</span> <span class="n">username</span><span class="p">)</span>
|
|
@@ -9962,7 +10350,7 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
9962
10350
|
</details>
|
|
9963
10351
|
<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>
|
|
9964
10352
|
<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>
|
|
9965
|
-
<p>When using <code>TransactionTestCase</code> (whether from Django or from Nautobot) each tests runs on a completely empty database. Furthermore, Nautobot requires new
|
|
10353
|
+
<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>
|
|
9966
10354
|
<p>A simple example of a Job test case might look like the following:</p>
|
|
9967
10355
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.testing</span> <span class="kn">import</span> <span class="n">run_job_for_testing</span><span class="p">,</span> <span class="n">TransactionTestCase</span>
|
|
9968
10356
|
<a id="__codelineno-24-2" name="__codelineno-24-2" href="#__codelineno-24-2"></a><span class="kn">from</span> <span class="nn">nautobot.extras.models</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">JobLogEntry</span>
|
|
@@ -9984,15 +10372,15 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
9984
10372
|
<p class="admonition-title">Tip</p>
|
|
9985
10373
|
<p>For more advanced examples refer to the Nautobot source code, specifically <code>nautobot/extras/tests/test_jobs.py</code>.</p>
|
|
9986
10374
|
</div>
|
|
9987
|
-
<h2 id="debugging-job-performance">Debugging
|
|
10375
|
+
<h2 id="debugging-job-performance">Debugging job performance<a class="headerlink" href="#debugging-job-performance" title="Permanent link">¶</a></h2>
|
|
9988
10376
|
<details class="version-added">
|
|
9989
10377
|
<summary>Added in version 1.5.17</summary>
|
|
9990
10378
|
</details>
|
|
9991
|
-
<p>Debugging the performance of Nautobot
|
|
9992
|
-
<p>The 'profile' form field on
|
|
10379
|
+
<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>
|
|
10380
|
+
<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>
|
|
9993
10381
|
<div class="admonition note">
|
|
9994
10382
|
<p class="admonition-title">Note</p>
|
|
9995
|
-
<p>If you need to run this in an environment where <code>DEBUG</code> is <code>False</code>, you have the option of using <code>nautobot-server runjob</code> with the <code>--profile</code> flag. According to the docs, <code>cProfile</code> should have minimal impact on the performance of the
|
|
10383
|
+
<p>If you need to run this in an environment where <code>DEBUG</code> is <code>False</code>, you have the option of using <code>nautobot-server runjob</code> with the <code>--profile</code> flag. According to the docs, <code>cProfile</code> should have minimal impact on the performance of the job; still, proceed with caution when using this in a production environment.</p>
|
|
9996
10384
|
</div>
|
|
9997
10385
|
<h3 id="reading-profiling-reports">Reading profiling reports<a class="headerlink" href="#reading-profiling-reports" title="Permanent link">¶</a></h3>
|
|
9998
10386
|
<p>A full description on how to deal with the output of <code>cProfile</code> can be found in the <a href="https://docs.python.org/3/library/profile.html#instant-user-s-manual">Instant User's Manual</a>, but here is something to get you started:</p>
|
|
@@ -10001,18 +10389,16 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
10001
10389
|
<a id="__codelineno-25-3" name="__codelineno-25-3" href="#__codelineno-25-3"></a><span class="n">stats</span> <span class="o">=</span> <span class="n">pstats</span><span class="o">.</span><span class="n">Stats</span><span class="p">(</span><span class="sa">f</span><span class="s2">"/tmp/nautobot-jobresult-</span><span class="si">{</span><span class="n">job_result_uuid</span><span class="si">}</span><span class="s2">.pstats"</span><span class="p">)</span>
|
|
10002
10390
|
<a id="__codelineno-25-4" name="__codelineno-25-4" href="#__codelineno-25-4"></a><span class="n">stats</span><span class="o">.</span><span class="n">sort_stats</span><span class="p">(</span><span class="n">pstats</span><span class="o">.</span><span class="n">SortKey</span><span class="o">.</span><span class="n">CUMULATIVE</span><span class="p">)</span><span class="o">.</span><span class="n">print_stats</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
|
|
10003
10391
|
</code></pre></div>
|
|
10004
|
-
<p>This will print the 10 functions that the
|
|
10392
|
+
<p>This will print the 10 functions that the job execution spent the most time in - adapt this to your needs!</p>
|
|
10005
10393
|
<h2 id="example-jobs">Example Jobs<a class="headerlink" href="#example-jobs" title="Permanent link">¶</a></h2>
|
|
10006
|
-
<h3 id="example-everything-job">Example "Everything" Job<a class="headerlink" href="#example-everything-job" title="Permanent link">¶</a></h3>
|
|
10007
|
-
<p>The "Example App" included with the Nautobot source code <a href="https://github.com/nautobot/nautobot/blob/main/examples/example_app/example_app/jobs.py">includes a number of simple sample Jobs</a>, including an <code>ExampleEverythingJob</code> class that demonstrates and documents the usage of the various metadata attributes, input variable types, and magic methods that a Job can support. As Job functionality will continue to evolve over time, if using this file as a reference, please make sure that you're viewing the version of this Job that corresponds to your target Nautobot version.</p>
|
|
10008
10394
|
<h3 id="creating-objects-for-a-planned-location">Creating objects for a planned location<a class="headerlink" href="#creating-objects-for-a-planned-location" title="Permanent link">¶</a></h3>
|
|
10009
|
-
<p>This
|
|
10395
|
+
<p>This job prompts the user for three variables:</p>
|
|
10010
10396
|
<ul>
|
|
10011
10397
|
<li>The name of the new location</li>
|
|
10012
10398
|
<li>The device model (a filtered list of defined device types)</li>
|
|
10013
10399
|
<li>The number of access switches to create</li>
|
|
10014
10400
|
</ul>
|
|
10015
|
-
<p>These variables are presented as a web form to be completed by the user. Once submitted, the
|
|
10401
|
+
<p>These variables are presented as a web form to be completed by the user. Once submitted, the job's <code>run()</code> method is called to create the appropriate objects, and it returns simple CSV output to the user summarizing the created objects.</p>
|
|
10016
10402
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a><span class="kn">from</span> <span class="nn">django.contrib.contenttypes.models</span> <span class="kn">import</span> <span class="n">ContentType</span>
|
|
10017
10403
|
<a id="__codelineno-26-2" name="__codelineno-26-2" href="#__codelineno-26-2"></a>
|
|
10018
10404
|
<a id="__codelineno-26-3" name="__codelineno-26-3" href="#__codelineno-26-3"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">StringVar</span><span class="p">,</span> <span class="n">IntegerVar</span><span class="p">,</span> <span class="n">ObjectVar</span><span class="p">,</span> <span class="n">register_jobs</span>
|
|
@@ -10072,7 +10458,7 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
10072
10458
|
<a id="__codelineno-26-57" name="__codelineno-26-57" href="#__codelineno-26-57"></a><span class="n">register_jobs</span><span class="p">(</span><span class="n">NewBranch</span><span class="p">)</span>
|
|
10073
10459
|
</code></pre></div>
|
|
10074
10460
|
<h3 id="device-validation">Device validation<a class="headerlink" href="#device-validation" title="Permanent link">¶</a></h3>
|
|
10075
|
-
<p>A
|
|
10461
|
+
<p>A job to perform various validation of Device data in Nautobot. As this job does not require any user input, it does not define any variables.</p>
|
|
10076
10462
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">Job</span><span class="p">,</span> <span class="n">register_jobs</span>
|
|
10077
10463
|
<a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-2"></a><span class="kn">from</span> <span class="nn">nautobot.dcim.models</span> <span class="kn">import</span> <span class="n">ConsolePort</span><span class="p">,</span> <span class="n">Device</span><span class="p">,</span> <span class="n">PowerPort</span>
|
|
10078
10464
|
<a id="__codelineno-27-3" name="__codelineno-27-3" href="#__codelineno-27-3"></a><span class="kn">from</span> <span class="nn">nautobot.extras.models</span> <span class="kn">import</span> <span class="n">Status</span>
|
|
@@ -10125,9 +10511,9 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
10125
10511
|
<a id="__codelineno-27-50" name="__codelineno-27-50" href="#__codelineno-27-50"></a><span class="n">register_jobs</span><span class="p">(</span><span class="n">DeviceConnectionsReport</span><span class="p">)</span>
|
|
10126
10512
|
</code></pre></div>
|
|
10127
10513
|
<h2 id="job-button-receivers">Job Button Receivers<a class="headerlink" href="#job-button-receivers" title="Permanent link">¶</a></h2>
|
|
10128
|
-
<p>Job Buttons are only able to initiate a specific type of
|
|
10514
|
+
<p>Job Buttons are only able to initiate a specific type of job called a <strong>Job Button Receiver</strong>. These are jobs that subclass the <code>nautobot.apps.jobs.JobButtonReceiver</code> class. Job Button Receivers are similar to normal jobs except they are hard coded to accept only <code>object_pk</code> and <code>object_model_name</code> <a href="#variables">variables</a>. Job Button Receivers are hidden from the jobs listing UI by default but otherwise function similarly to other jobs. The <code>JobButtonReceiver</code> class only implements one method called <code>receive_job_button</code>.</p>
|
|
10129
10515
|
<div class="admonition note">
|
|
10130
|
-
<p class="admonition-title">
|
|
10516
|
+
<p class="admonition-title">Note</p>
|
|
10131
10517
|
<p>Job Button Receivers still need to be <a href="../../user-guide/platform-functionality/jobs/index.html#enabling-jobs-for-running">enabled through the web UI</a> before they can be used just like other Jobs.</p>
|
|
10132
10518
|
</div>
|
|
10133
10519
|
<h3 id="the-receive_job_button-method">The <code>receive_job_button()</code> Method<a class="headerlink" href="#the-receive_job_button-method" title="Permanent link">¶</a></h3>
|
|
@@ -10190,14 +10576,14 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
10190
10576
|
<a id="__codelineno-29-36" name="__codelineno-29-36" href="#__codelineno-29-36"></a><span class="n">register_jobs</span><span class="p">(</span><span class="n">ExampleComplexJobButtonReceiver</span><span class="p">)</span>
|
|
10191
10577
|
</code></pre></div>
|
|
10192
10578
|
<h2 id="job-hook-receivers">Job Hook Receivers<a class="headerlink" href="#job-hook-receivers" title="Permanent link">¶</a></h2>
|
|
10193
|
-
<p>Job Hooks are only able to initiate a specific type of
|
|
10579
|
+
<p>Job Hooks are only able to initiate a specific type of job called a <strong>Job Hook Receiver</strong>. These are jobs that subclass the <code>nautobot.apps.jobs.JobHookReceiver</code> class. Job hook receivers are similar to normal jobs except they are hard coded to accept only an <code>object_change</code> <a href="#variables">variable</a>. Job Hook Receivers are hidden from the jobs listing UI by default but otherwise function similarly to other jobs. The <code>JobHookReceiver</code> class only implements one method called <code>receive_job_hook</code>.</p>
|
|
10194
10580
|
<div class="admonition warning">
|
|
10195
|
-
<p class="admonition-title">
|
|
10581
|
+
<p class="admonition-title">Warning</p>
|
|
10196
10582
|
<p>Requiring approval for execution of Job Hooks by setting the <code>Meta.approval_required</code> attribute to <code>True</code> on your <code>JobHookReceiver</code> subclass is not supported. The value of this attribute will be ignored. Support for requiring approval of Job Hooks will be added in a future release.</p>
|
|
10197
10583
|
</div>
|
|
10198
10584
|
<div class="admonition important">
|
|
10199
|
-
<p class="admonition-title">
|
|
10200
|
-
<p>To prevent negatively impacting system performance through an infinite loop, a change that was made by a <code>JobHookReceiver</code>
|
|
10585
|
+
<p class="admonition-title">Important</p>
|
|
10586
|
+
<p>To prevent negatively impacting system performance through an infinite loop, a change that was made by a <code>JobHookReceiver</code> job will not trigger another <code>JobHookReceiver</code> job to run.</p>
|
|
10201
10587
|
</div>
|
|
10202
10588
|
<h3 id="example-job-hook-receiver">Example Job Hook Receiver<a class="headerlink" href="#example-job-hook-receiver" title="Permanent link">¶</a></h3>
|
|
10203
10589
|
<div class="highlight"><pre><span></span><code><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a><span class="kn">from</span> <span class="nn">nautobot.apps.jobs</span> <span class="kn">import</span> <span class="n">JobHookReceiver</span><span class="p">,</span> <span class="n">register_jobs</span>
|
|
@@ -10385,10 +10771,10 @@ However the import paths used in the examples requires 1.5.2 and newer.</p>
|
|
|
10385
10771
|
</div>
|
|
10386
10772
|
|
|
10387
10773
|
|
|
10388
|
-
<script id="__config" type="application/json">{"base": "../..", "features": ["content.code.copy", "content.tabs.link", "navigation.footer", "navigation.tabs", "navigation.tabs.sticky", "navigation.tracking", "search.highlight", "search.share", "search.suggest"], "search": "../../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
|
|
10774
|
+
<script id="__config" type="application/json">{"base": "../..", "features": ["content.code.annotate", "content.code.copy", "content.tabs.link", "navigation.footer", "navigation.tabs", "navigation.tabs.sticky", "navigation.tracking", "search.highlight", "search.share", "search.suggest"], "search": "../../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
|
|
10389
10775
|
|
|
10390
10776
|
|
|
10391
|
-
<script src="../../assets/javascripts/bundle.
|
|
10777
|
+
<script src="../../assets/javascripts/bundle.83f73b43.min.js"></script>
|
|
10392
10778
|
|
|
10393
10779
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
|
|
10394
10780
|
|