From e69cf12b3e5bf42b765fc2d05743a78a69c8ecb9 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 15 Dec 2023 13:46:18 -0600 Subject: [PATCH 1/5] rename plugin to app globally --- docs/quick-start.md | 30 ++--- nautobot-app-ssot/README.md | 20 +-- nautobot-app-ssot/cookiecutter.json | 12 +- nautobot-app-ssot/tests/conftest.py | 14 +-- .../tests/test_bake_nautobot_app_ssot.py | 8 +- .../{{ cookiecutter.project_slug }}/README.md | 14 +-- .../development/nautobot_config.py | 4 +- .../docs/admin/install.md | 26 ++-- .../icon-{{ cookiecutter.app_slug }}.png | 1 + .../icon-{{ cookiecutter.plugin_slug }}.png | 1 - .../pyproject.toml | 4 +- .../{{ cookiecutter.app_name }}/__init__.py | 1 + .../api/__init__.py | 1 + .../api/serializers.py | 1 + .../{{ cookiecutter.app_name }}/api/urls.py | 1 + .../{{ cookiecutter.app_name }}/api/views.py | 1 + .../diffsync/adapters/__init__.py | 0 .../diffsync/adapters/nautobot.py | 4 +- ...{ cookiecutter.system_of_record_slug }}.py | 4 +- .../diffsync/models/__init__.py | 2 +- .../diffsync/models/base.py | 0 .../diffsync/models/nautobot.py | 2 +- ...{ cookiecutter.system_of_record_slug }}.py | 2 +- .../{{ cookiecutter.app_name }}/filters.py | 1 + .../{{ cookiecutter.app_name }}/forms.py | 1 + .../jobs.py | 2 +- .../migrations/__init__.py | 1 + .../{{ cookiecutter.app_name }}/models.py | 1 + .../{{ cookiecutter.app_name }}/navigation.py | 1 + .../{{ cookiecutter.app_name }}/tables.py | 1 + ....model_class_name | lower }}_retrieve.html | 1 + .../tests/__init__.py | 1 + .../tests/fixtures.py | 1 + .../tests/fixtures/get_devices.json | 0 .../tests/test_api.py | 1 + .../tests/test_api_views.py | 1 + .../tests/test_basic.py | 1 + ...ookiecutter.model_class_name | lower }}.py | 1 + ...ookiecutter.model_class_name | lower }}.py | 1 + ...ookiecutter.model_class_name | lower }}.py | 1 + .../tests/test_views.py | 1 + ...cutter.system_of_record_slug }}_adapter.py | 6 +- .../{{ cookiecutter.app_name }}/urls.py | 1 + .../utils/__init__.py | 0 .../utils/nautobot.py | 0 ...{ cookiecutter.system_of_record_slug }}.py | 0 .../{{ cookiecutter.app_name }}/views.py | 1 + .../__init__.py | 1 - .../api/__init__.py | 1 - .../api/serializers.py | 1 - .../api/urls.py | 1 - .../api/views.py | 1 - .../{{ cookiecutter.plugin_name }}/filters.py | 1 - .../{{ cookiecutter.plugin_name }}/forms.py | 1 - .../migrations/__init__.py | 1 - .../{{ cookiecutter.plugin_name }}/models.py | 1 - .../navigation.py | 1 - .../{{ cookiecutter.plugin_name }}/tables.py | 1 - ....model_class_name | lower }}_retrieve.html | 1 - .../tests/__init__.py | 1 - .../tests/fixtures.py | 1 - .../tests/test_api.py | 1 - .../tests/test_api_views.py | 1 - .../tests/test_basic.py | 1 - ...ookiecutter.model_class_name | lower }}.py | 1 - ...ookiecutter.model_class_name | lower }}.py | 1 - ...ookiecutter.model_class_name | lower }}.py | 1 - .../tests/test_views.py | 1 - .../{{ cookiecutter.plugin_name }}/urls.py | 1 - .../{{ cookiecutter.plugin_name }}/views.py | 1 - nautobot-app/README.md | 18 +-- nautobot-app/cookiecutter.json | 16 +-- nautobot-app/hooks/post_gen_project.py | 8 +- nautobot-app/hooks/pre_gen_project.py | 7 +- nautobot-app/tests/conftest.py | 18 +-- nautobot-app/tests/test_bake_nautobot_app.py | 8 +- .../.github/ISSUE_TEMPLATE/bug_report.md | 4 +- .../.github/ISSUE_TEMPLATE/feature_request.md | 2 +- .../pull_request_template.md | 2 +- .../.github/workflows/ci.yml | 34 ++--- .../.github/workflows/upstream_testing.yml | 4 +- .../.gitignore | 2 +- .../{{ cookiecutter.project_slug }}/README.md | 12 +- .../development/Dockerfile | 2 +- .../development/docker-compose.base.yml | 2 +- .../development/docker-compose.dev.yml | 2 +- .../development/nautobot_config.py | 4 +- .../docs/admin/compatibility_matrix.md | 2 +- .../docs/admin/install.md | 26 ++-- .../docs/admin/release_notes/version_1.0.md | 2 +- .../docs/admin/uninstall.md | 6 +- .../docs/admin/upgrade.md | 2 +- .../docs/dev/arch_decision.md | 2 +- .../docs/dev/code_reference/api.md | 2 +- .../docs/dev/code_reference/package.md | 2 +- .../docs/dev/contributing.md | 2 +- .../docs/dev/dev_environment.md | 118 +++++++++--------- ...g => icon-{{ cookiecutter.app_slug }}.png} | Bin .../docs/user/app_overview.md | 2 +- .../invoke.example.yml | 4 +- .../invoke.mysql.yml | 4 +- .../mkdocs.yml | 2 +- .../pyproject.toml | 4 +- .../{{ cookiecutter.project_slug }}/tasks.py | 42 +++---- .../__init__.py | 6 +- .../api/__init__.py | 1 + .../api/serializers.py | 4 +- .../api/urls.py | 4 +- .../api/views.py | 6 +- .../filters.py | 4 +- .../forms.py | 4 +- .../migrations/__init__.py | 0 .../models.py | 2 +- .../{{ cookiecutter.app_name }}/navigation.py | 25 ++++ .../tables.py | 4 +- ....model_class_name | lower }}_retrieve.html | 0 .../tests/__init__.py | 1 + .../tests/fixtures.py | 2 +- .../tests/test_api.py | 2 +- .../tests/test_api_views.py | 6 +- .../tests/test_basic.py | 0 ...ookiecutter.model_class_name | lower }}.py | 6 +- ...ookiecutter.model_class_name | lower }}.py | 2 +- ...ookiecutter.model_class_name | lower }}.py | 2 +- .../tests/test_views.py | 4 +- .../urls.py | 4 +- .../views.py | 6 +- .../api/__init__.py | 1 - .../navigation.py | 25 ---- .../tests/__init__.py | 1 - tasks.py | 2 +- 131 files changed, 346 insertions(+), 347 deletions(-) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/adapters/__init__.py (100%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/adapters/nautobot.py (88%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py (84%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/models/__init__.py (69%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/models/base.py (100%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/models/nautobot.py (97%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py (92%) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/jobs.py (97%) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/fixtures/get_devices.json (100%) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py (83%) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/utils/__init__.py (100%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/utils/nautobot.py (100%) rename nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/utils/{{ cookiecutter.system_of_record_slug }}.py (100%) create mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py delete mode 120000 nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py rename nautobot-app/{{ cookiecutter.project_slug }}/docs/images/{icon-{{ cookiecutter.plugin_slug }}.png => icon-{{ cookiecutter.app_slug }}.png} (100%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/__init__.py (81%) create mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/api/serializers.py (82%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/api/urls.py (70%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/api/views.py (77%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/filters.py (83%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/forms.py (93%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/migrations/__init__.py (100%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/models.py (96%) create mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tables.py (91%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}}/{{ cookiecutter.model_class_name | lower }}_retrieve.html (100%) create mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/fixtures.py (82%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_api.py (94%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_api_views.py (80%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_basic.py (100%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py (86%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py (95%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py (96%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/tests/test_views.py (86%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/urls.py (64%) rename nautobot-app/{{ cookiecutter.project_slug }}/{{{ cookiecutter.plugin_name }} => {{ cookiecutter.app_name }}}/views.py (80%) delete mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py delete mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py delete mode 100644 nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py diff --git a/docs/quick-start.md b/docs/quick-start.md index 84e76386..bf0fba3c 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -54,25 +54,25 @@ docker compose run --rm -- dev cookiecutter --output-dir=./outputs ./nautobot- [2/18] full_name (Network to Code, LLC): [3/18] email (info@networktocode.com): [4/18] github_org (nautobot): - [5/18] plugin_name (my_plugin): - [6/18] verbose_name (My Plugin): - [7/18] plugin_slug (my-plugin): - [8/18] project_slug (nautobot-plugin-my-plugin): - [9/18] repo_url (https://github.com/nautobot/nautobot-plugin-my-plugin): - [10/18] base_url (my-plugin): + [5/18] app_name (my_app): + [6/18] verbose_name (My App): + [7/18] app_slug (my-app): + [8/18] project_slug (nautobot-app-my-app): + [9/18] repo_url (https://github.com/nautobot/nautobot-app-my-app): + [10/18] base_url (my-app): [11/18] min_nautobot_version (1.6.0): [12/18] max_nautobot_version (1.9999): - [13/18] camel_name (MyPlugin): - [14/18] project_short_description (My Plugin): + [13/18] camel_name (MyApp): + [14/18] project_short_description (My App): [15/18] model_class_name (None): [16/18] Select open_source_license 1 - Apache-2.0 2 - Not open source Choose from [1/2] (1): [17/18] docs_base_url (https://docs.nautobot.com): - [18/18] docs_app_url (https://docs.nautobot.com/projects/my-plugin/en/latest): + [18/18] docs_app_url (https://docs.nautobot.com/projects/my-app/en/latest): -Congratulations! Your cookie has now been baked. It is located at /opt/ntc/nautobot/cookiecutter-nautobot-app/outputs/nautobot-plugin-my-plugin. +Congratulations! Your cookie has now been baked. It is located at /opt/ntc/nautobot/cookiecutter-nautobot-app/outputs/nautobot-app-my-app. ⚠️⚠️ Before you start using your cookie you must run the following commands inside your cookie: @@ -127,11 +127,11 @@ First create the `my-app.json` file: "full_name": "Network to Code, LLC", "email": "info@networktocode.com", "github_org": "nautobot", - "plugin_name": "my_app", + "app_name": "my_app", "verbose_name": "My App", - "plugin_slug": "my-app", - "project_slug": "nautobot-plugin-my-app", - "repo_url": "https://github.com/nautobot/nautobot-plugin-my-app", + "app_slug": "my-app", + "project_slug": "nautobot-app-my-app", + "repo_url": "https://github.com/nautobot/nautobot-app-my-app", "base_url": "my-app", "min_nautobot_version": "2.0.0", "max_nautobot_version": "2.9999", @@ -156,7 +156,7 @@ Output: ```shell docker compose run --rm -- dev cookiecutter --output-dir=./outputs --replay-file=my-app.json ./nautobot-app -Congratulations! Your cookie has now been baked. It is located at /opt/ntc/nautobot/cookiecutter-nautobot-app/outputs/nautobot-plugin-my-app. +Congratulations! Your cookie has now been baked. It is located at /opt/ntc/nautobot/cookiecutter-nautobot-app/outputs/nautobot-app-my-app. ⚠️⚠️ Before you start using your cookie you must run the following commands inside your cookie: diff --git a/nautobot-app-ssot/README.md b/nautobot-app-ssot/README.md index 57d9f1ec..77e7c5de 100644 --- a/nautobot-app-ssot/README.md +++ b/nautobot-app-ssot/README.md @@ -10,7 +10,7 @@ The term SSoT, or Single Source of Truth, refers to the intention of using Nauto ### IMPORTANT Cookie Notes -- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.plugin_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! +- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.app_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! - Please resolve and remove **all** of the comments and blocks marked with `Developer Note - Remove Me!` prior to publishing the documentation. Catch'em all with `rgrep "Developer Note"`. - The documentation website will be built and hosted on `readthedocs.io` for open source projects and follows the standard Network to Code branding for all our open source projects. @@ -32,24 +32,24 @@ The following table lists the inputs that you will be prompted for when generati | Setting | Description | |-------- | ----------- | -| **codeowner_github_usernames** | The Github codeowners for the new plugin | -| **full_name** | Used in the **author** field within `pyproject.toml` and `PluginConfig` | +| **codeowner_github_usernames** | The Github codeowners for the new app | +| **full_name** | Used in the **author** field within `pyproject.toml` and `NautobotAppConfig` | | **email** | Used in the **author** field within `pyproject.toml` | | **github_org** | Used to construct **repo_url** | | **system_of_record** | The System of Record that the plug-in is intended to work with. | | **system_of_record_slug** | Used to construct model and adapter names. | | **system_of_record_camel** | Used to construct class names. | -| **plugin_name** | The Python name of the plugin | -| **verbose_name** | Used in `PluginConfig` | -| **plugin_slug** | Python packaging name | +| **app_name** | The Python name of the app | +| **verbose_name** | Used in `NautobotAppConfig` | +| **app_slug** | Python packaging name | | **project_slug** | Used to construct **repo_url** | -| **base_url** | Defines plugin's base url used in Nautobot | +| **base_url** | Defines app's base url used in Nautobot | | **min_nautobot_version** | The minimum supported Nautobot version | | **max_nautobot_version** | The maximum supported Nautobot version | | **nautobot_version** | Used for development purposes to decide with Nautobot-dev Docker image to use for development | -| **camel_name** | Used to define the plugin's subclassing of `PluginConfig`, e.g. `MyPluginConfig(PluginConfig):` | -| **project_short_description** | Used in the **description** field within `PluginConfig` | +| **camel_name** | Used to define the app's subclassing of `NautobotAppConfig`, e.g. `MyNautobotAppConfig(NautobotAppConfig):` | +| **project_short_description** | Used in the **description** field within `NautobotAppConfig` | | **model_class_name** | If you want to generate initial files, such as `models.py`, `forms.py`, `filters.py`, `navigation.py`, `tables.py`, `views`, and API models, initialize this name to a valid model name. The default value is `None` | | **Select open_source_license** | Determine if project is open source or not | | **docs_base_url**| The main URL where the project documentation will be hosted. For open source projects use the default (`https://docs.nautobot.com`). | -| **docs_app_url**| The full URL for documentation hosting. You might want to shorten the project alias, for example `https://docs.nautobot.com/projects/ssot-system-of-record/en/latest` instead of `https://docs.nautobot.com/projects/nautobot-plugin-ssot-system-of-record/en/latest`. Make sure there's no trailing `/`! | +| **docs_app_url**| The full URL for documentation hosting. You might want to shorten the project alias, for example `https://docs.nautobot.com/projects/ssot-system-of-record/en/latest` instead of `https://docs.nautobot.com/projects/nautobot-app-ssot-system-of-record/en/latest`. Make sure there's no trailing `/`! | diff --git a/nautobot-app-ssot/cookiecutter.json b/nautobot-app-ssot/cookiecutter.json index f443608c..cf9027e7 100644 --- a/nautobot-app-ssot/cookiecutter.json +++ b/nautobot-app-ssot/cookiecutter.json @@ -6,15 +6,15 @@ "system_of_record": "System of Record", "system_of_record_camel": "{{ cookiecutter.system_of_record.title().replace(' ', '').replace('_', '').replace('-', '') }}", "system_of_record_slug": "{{ cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_') }}", - "plugin_name": "nautobot_ssot_{{ cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_') }}", - "verbose_name": "{{ cookiecutter.plugin_name.title().replace('_', ' ') }}", - "plugin_slug": "{{ cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-') }}", + "app_name": "nautobot_ssot_{{ cookiecutter.system_of_record.lower().replace(' ', '_').replace('-', '_') }}", + "verbose_name": "{{ cookiecutter.app_name.title().replace('_', ' ') }}", + "app_slug": "{{ cookiecutter.app_name.lower().replace(' ', '-').replace('_', '-') }}", "project_slug": "nautobot-app-ssot-{{ cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-') }}", "repo_url": "https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}", "base_url": "ssot-{{ cookiecutter.system_of_record.lower().replace(' ', '-').replace('_', '-') }}", "min_nautobot_version": "2.0.0", "max_nautobot_version": "2.9999", - "camel_name": "{{ cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '') }}", + "camel_name": "{{ cookiecutter.app_slug.title().replace(' ', '').replace('-', '') }}", "project_short_description": "{{ cookiecutter.verbose_name }}", "model_class_name": "None", "open_source_license": [ @@ -22,5 +22,5 @@ "Not open source" ], "docs_base_url": "https://docs.nautobot.com", - "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.plugin_slug }}/en/latest" -} + "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.app_slug }}/en/latest" +} \ No newline at end of file diff --git a/nautobot-app-ssot/tests/conftest.py b/nautobot-app-ssot/tests/conftest.py index bc55edba..991688ed 100644 --- a/nautobot-app-ssot/tests/conftest.py +++ b/nautobot-app-ssot/tests/conftest.py @@ -38,23 +38,23 @@ def cookies_baked_nautobot_app_ssot(cookies): examples_projects = {} results = {} extra_contexts = { - "nautobot-plugin-ssot-ext-sor": { + "nautobot-app-ssot-ext-sor": { "open_source_license": "Not open source", "system_of_record": "Ext SoR", }, - "nautobot-plugin-ssot-my-sor": { + "nautobot-app-ssot-my-sor": { "open_source_license": "Apache-2.0", "system_of_record": "My SoR", }, } # pylint: disable-next=protected-access environ["COOKIECUTTER_CONFIG"] = str(cookies._config_file) - for plugin_slug, extra_context in extra_contexts.items(): - results[plugin_slug] = cookies.bake(extra_context=extra_context, template="nautobot-app-ssot") + for app_slug, extra_context in extra_contexts.items(): + results[app_slug] = cookies.bake(extra_context=extra_context, template="nautobot-app-ssot") - assert results[plugin_slug].exception is None + assert results[app_slug].exception is None - examples_projects[plugin_slug] = init_examples_project(plugin_slug) - shutil.move(results[plugin_slug].project_path, examples_projects[plugin_slug]) + examples_projects[app_slug] = init_examples_project(app_slug) + shutil.move(results[app_slug].project_path, examples_projects[app_slug]) return results, examples_projects diff --git a/nautobot-app-ssot/tests/test_bake_nautobot_app_ssot.py b/nautobot-app-ssot/tests/test_bake_nautobot_app_ssot.py index dc6c7442..eafc7b82 100644 --- a/nautobot-app-ssot/tests/test_bake_nautobot_app_ssot.py +++ b/nautobot-app-ssot/tests/test_bake_nautobot_app_ssot.py @@ -23,7 +23,7 @@ def test_bake_nautobot_execution(cookies_baked_nautobot_app_ssot): Tests creation of example nautobot with the cookiecutter default values """ results, examples_projects = cookies_baked_nautobot_app_ssot - plugin_slug = "nautobot-plugin-ssot-ext-sor" - assert results[plugin_slug].exit_code == 0 - assert results[plugin_slug].exception is None - assert examples_projects[plugin_slug].is_dir() + app_slug = "nautobot-app-ssot-ext-sor" + assert results[app_slug].exit_code == 0 + assert results[app_slug].exception is None + assert examples_projects[app_slug].is_dir() diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md index aed494fc..196ad347 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md @@ -1,6 +1,6 @@ # {{ cookiecutter.verbose_name }} SSoT -A plugin for [Nautobot](https://github.com/nautobot/nautobot). +A app for [Nautobot](https://github.com/nautobot/nautobot). The term SSoT, or Single Source of Truth, refers to the intention of using Nautobot to consolidate data from disparate Systems of Record to create a single resource for all automation needs. This is done by extending the [Nautobot SSoT framework](https://github.com/nautobot/nautobot-plugin-ssot) which uses the DiffSync library. This plug-in is built with the capability in mind to import and export data from your desired System of Record. @@ -9,18 +9,18 @@ Developer Note - Remove Me! The README will have certain links/images broken until the PR is merged into `develop`. Update the GitHub links with whichever branch you're using (main etc.) if different. -The logo of the project is a placeholder (docs/images/icon-{{ cookiecutter.plugin_slug }}.png) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! +The logo of the project is a placeholder (docs/images/icon-{{ cookiecutter.app_slug }}.png) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! To avoid extra work and temporary links, make sure that publishing docs (or merging a PR) is done at the same time as setting up the docs site on RTD, then test everything. -->

- +
- - + +
An App for Nautobot.

@@ -33,9 +33,9 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg > Developer Note: Add any representative screenshots of the App in action. These images should also be added to the `docs/user/app_use_cases.md` section. -> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/plugin-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI. +> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/app-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI. -More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality: +More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the app's added functionality: ![](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/placeholder.png) diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py index 15711d37..6ff7a76d 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -131,7 +131,7 @@ # Enable installed Apps. Add the name of each App to the list. PLUGINS = [ "nautobot_ssot", - "{{ cookiecutter.plugin_name }}", + "{{ cookiecutter.app_name }}", ] # Apps configuration settings. These settings are used by various Apps that the user may have installed. @@ -140,7 +140,7 @@ "nautobot_ssot": { "hide_example_jobs": True, }, - # '{{ cookiecutter.plugin_name }}': { + # '{{ cookiecutter.app_name }}': { # 'foo': 'bar', # 'buzz': 'bazz', # }, diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md index b3c59c05..4dfca40e 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/admin/install.md @@ -7,7 +7,7 @@ Here you will find detailed instructions on how to **install** and **configure** ## Prerequisites -- The plugin is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher. +- The app is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher. - Databases supported: PostgreSQL, MySQL !!! note @@ -21,37 +21,37 @@ Here you will find detailed instructions on how to **install** and **configure** ## Install Guide !!! note - Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{ cookiecutter.plugin_slug }}`](https://pypi.org/project/{{ cookiecutter.plugin_slug }}/). + Apps can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this app is [`{{ cookiecutter.app_slug }}`](https://pypi.org/project/{{ cookiecutter.app_slug }}/). -The plugin is available as a Python package via PyPI and can be installed with `pip`: +The app is available as a Python package via PyPI and can be installed with `pip`: ```shell -pip install {{ cookiecutter.plugin_slug }} +pip install {{ cookiecutter.app_slug }} ``` -To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.plugin_slug }}` package: +To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.app_slug }}` package: ```shell -echo {{ cookiecutter.plugin_slug }} >> local_requirements.txt +echo {{ cookiecutter.app_slug }} >> local_requirements.txt ``` -Once installed, the plugin needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file: +Once installed, the app needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file: -- Append `"{{ cookiecutter.plugin_name }}"` to the `PLUGINS` list. -- Append the `"{{ cookiecutter.plugin_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults. +- Append `"{{ cookiecutter.app_name }}"` to the `PLUGINS` list. +- Append the `"{{ cookiecutter.app_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults. ```python # In your nautobot_config.py PLUGINS = [ "nautobot_ssot", - "{{ cookiecutter.plugin_name }}", + "{{ cookiecutter.app_name }}", ] PLUGINS_CONFIG = { "nautobot_ssot": { "hide_example_jobs": True, }, - '{{ cookiecutter.plugin_name }}': { + '{{ cookiecutter.app_name }}': { # ADD YOUR SETTINGS HERE }, } @@ -78,10 +78,10 @@ sudo systemctl restart nautobot nautobot-worker nautobot-scheduler !!! warning "Developer Note - Remove Me!" Any configuration required to get the App set up. Edit the table below as per the examples provided. -The plugin behavior can be controlled with the following list of settings: +The app behavior can be controlled with the following list of settings: | Key | Example | Default | Description | | ------- | ------ | -------- | ------------------------------------- | -| `enable_backup` | `True` | `True` | A boolean to represent whether or not to run backup configurations within the plugin. | +| `enable_backup` | `True` | `True` | A boolean to represent whether or not to run backup configurations within the app. | | `platform_slug_map` | `{"cisco_wlc": "cisco_aireos"}` | `None` | A dictionary in which the key is the platform slug and the value is what netutils uses in any "network_os" parameter. | | `per_feature_bar_width` | `0.15` | `0.15` | The width of the table bar within the overview report | diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png new file mode 120000 index 00000000..579d316d --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png deleted file mode 120000 index 96fd7ffa..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml index 8c87cd73..25adf982 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "{{ cookiecutter.plugin_slug }}" +name = "{{ cookiecutter.app_slug }}" version = "0.1.0" description = "{{ cookiecutter.project_short_description }}" authors = ["{{ cookiecutter.full_name }} <{{ cookiecutter.email }}>"] @@ -20,7 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] packages = [ - { include = "{{ cookiecutter.plugin_name }}" }, + { include = "{{ cookiecutter.app_name }}" }, ] [tool.poetry.dependencies] diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py new file mode 120000 index 00000000..1886432d --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py new file mode 120000 index 00000000..f19ac3be --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py new file mode 120000 index 00000000..50cbbf67 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py new file mode 120000 index 00000000..ff479f23 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py new file mode 120000 index 00000000..60d2493e --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/__init__.py similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/__init__.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/__init__.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/nautobot.py similarity index 88% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/nautobot.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/nautobot.py index 0a8e7b2f..bcb1961b 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/nautobot.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/nautobot.py @@ -1,7 +1,7 @@ -"""Nautobot Adapter for {{ cookiecutter.system_of_record }} SSoT plugin.""" +"""Nautobot Adapter for {{ cookiecutter.system_of_record }} SSoT app.""" from diffsync import DiffSync -from {{ cookiecutter.plugin_name }}.diffsync.models.nautobot import NautobotDevice +from {{ cookiecutter.app_name }}.diffsync.models.nautobot import NautobotDevice class NautobotAdapter(DiffSync): diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py similarity index 84% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py index cdbd5ff7..a4b24299 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/{{ cookiecutter.system_of_record_slug }}.py @@ -1,7 +1,7 @@ -"""{{ cookiecutter.verbose_name }} Adapter for {{ cookiecutter.system_of_record }} SSoT plugin.""" +"""{{ cookiecutter.verbose_name }} Adapter for {{ cookiecutter.system_of_record }} SSoT app.""" from diffsync import DiffSync -from {{ cookiecutter.plugin_name }}.diffsync.models.{{ cookiecutter.system_of_record_slug }} import {{ cookiecutter.system_of_record_camel }}Device +from {{ cookiecutter.app_name }}.diffsync.models.{{ cookiecutter.system_of_record_slug }} import {{ cookiecutter.system_of_record_camel }}Device class {{ cookiecutter.system_of_record_camel }}Adapter(DiffSync): diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/__init__.py similarity index 69% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/__init__.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/__init__.py index eb8cda1f..132bb086 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/__init__.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/__init__.py @@ -1 +1 @@ -"""DiffSync models and adapters for the {{ cookiecutter.system_of_record }} SSoT plugin.""" +"""DiffSync models and adapters for the {{ cookiecutter.system_of_record }} SSoT app.""" diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/base.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/base.py similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/base.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/base.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/nautobot.py similarity index 97% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/nautobot.py index 7beea1fa..2277470a 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/nautobot.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/nautobot.py @@ -3,7 +3,7 @@ from nautobot.dcim.models import Device as NewDevice, Location, LocationType, DeviceType from nautobot.extras.models import Status, Role -from {{ cookiecutter.plugin_name }}.diffsync.models.base import Device +from {{ cookiecutter.app_name }}.diffsync.models.base import Device def ensure_location(location_name): diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py similarity index 92% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py index 4d9e2fef..15d4182b 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py @@ -1,6 +1,6 @@ """{{ cookiecutter.verbose_name }} DiffSync models for {{ cookiecutter.verbose_name }} SSoT.""" -from {{ cookiecutter.plugin_name }}.diffsync.models.base import Device +from {{ cookiecutter.app_name }}.diffsync.models.base import Device class {{ cookiecutter.system_of_record_camel }}Device(Device): diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py new file mode 120000 index 00000000..26e7d2b5 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py new file mode 120000 index 00000000..f4ca8f2b --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/jobs.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/jobs.py similarity index 97% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/jobs.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/jobs.py index b374a5cb..b9cb39a4 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/jobs.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/jobs.py @@ -3,7 +3,7 @@ from diffsync import DiffSyncFlags from nautobot.extras.jobs import BooleanVar, Job from nautobot_ssot.jobs.base import DataSource, DataTarget -from {{ cookiecutter.plugin_name }}.diffsync.adapters import {{ cookiecutter.system_of_record_slug }}, nautobot +from {{ cookiecutter.app_name }}.diffsync.adapters import {{ cookiecutter.system_of_record_slug }}, nautobot name = "{{ cookiecutter.system_of_record }} SSoT" # pylint: disable=invalid-name diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py new file mode 120000 index 00000000..a38b77b6 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py new file mode 120000 index 00000000..e7b108eb --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py new file mode 120000 index 00000000..0b7ce6de --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py new file mode 120000 index 00000000..c8e606b6 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html new file mode 120000 index 00000000..6c6bb54e --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html @@ -0,0 +1 @@ +../../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py new file mode 120000 index 00000000..d5d16d36 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py new file mode 120000 index 00000000..6eed763c --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures/get_devices.json similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures/get_devices.json diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py new file mode 120000 index 00000000..af7d34ea --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py new file mode 120000 index 00000000..af38d438 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py new file mode 120000 index 00000000..293b7d7e --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py new file mode 120000 index 00000000..6c5491a0 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py new file mode 120000 index 00000000..c2dfebf1 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py new file mode 120000 index 00000000..b496d68c --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py new file mode 120000 index 00000000..7e3eb09f --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py @@ -0,0 +1 @@ +../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py similarity index 83% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py index 004a1a21..24a0fef1 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_{{ cookiecutter.system_of_record_slug }}_adapter.py @@ -7,8 +7,8 @@ from django.contrib.contenttypes.models import ContentType from nautobot.extras.models import Job, JobResult from nautobot.core.testing import TransactionTestCase -from {{ cookiecutter.plugin_name }}.diffsync.adapters.{{ cookiecutter.system_of_record_slug }} import {{ cookiecutter.system_of_record_camel }}Adapter -from {{ cookiecutter.plugin_name }}.jobs import {{ cookiecutter.system_of_record_camel }}DataSource +from {{ cookiecutter.app_name }}.diffsync.adapters.{{ cookiecutter.system_of_record_slug }} import {{ cookiecutter.system_of_record_camel }}Adapter +from {{ cookiecutter.app_name }}.jobs import {{ cookiecutter.system_of_record_camel }}DataSource def load_json(path): @@ -17,7 +17,7 @@ def load_json(path): return json.loads(file.read()) -DEVICE_FIXTURE = load_json("./{{ cookiecutter.plugin_name }}/tests/fixtures/get_devices.json") +DEVICE_FIXTURE = load_json("./{{ cookiecutter.app_name }}/tests/fixtures/get_devices.json") class Test{{ cookiecutter.system_of_record_camel }}AdapterTestCase(TransactionTestCase): diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py new file mode 120000 index 00000000..ebf9231c --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/__init__.py similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/__init__.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/__init__.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/nautobot.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/nautobot.py similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/nautobot.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/nautobot.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py similarity index 100% rename from nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py rename to nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/utils/{{ cookiecutter.system_of_record_slug }}.py diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py new file mode 120000 index 00000000..adf7f694 --- /dev/null +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py @@ -0,0 +1 @@ +../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py deleted file mode 120000 index 06575aff..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py deleted file mode 120000 index 9c7aa994..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py deleted file mode 120000 index ffed85ab..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py deleted file mode 120000 index 2b30ed95..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py deleted file mode 120000 index 1328b5b9..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py deleted file mode 120000 index 602d5a64..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py deleted file mode 120000 index dbe36562..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py deleted file mode 120000 index e1aa7c68..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py deleted file mode 120000 index 3ba1e8ef..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py deleted file mode 120000 index 22a83ad8..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py deleted file mode 120000 index 7a68c7c4..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html deleted file mode 120000 index 1fcbf878..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html +++ /dev/null @@ -1 +0,0 @@ -../../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py deleted file mode 120000 index 34ead0b6..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py deleted file mode 120000 index 0aa7332e..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py deleted file mode 120000 index c052b216..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py deleted file mode 120000 index ca2d630e..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py deleted file mode 120000 index 44de1fc1..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py deleted file mode 120000 index 777fc6d8..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py deleted file mode 120000 index 596ef71a..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py deleted file mode 120000 index 9f6fabf7..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py deleted file mode 120000 index 0423c9d9..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py +++ /dev/null @@ -1 +0,0 @@ -../../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py deleted file mode 120000 index 601b0293..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py \ No newline at end of file diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py deleted file mode 120000 index fff61ea4..00000000 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py +++ /dev/null @@ -1 +0,0 @@ -../../../nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py \ No newline at end of file diff --git a/nautobot-app/README.md b/nautobot-app/README.md index fd9df0e9..be77602b 100644 --- a/nautobot-app/README.md +++ b/nautobot-app/README.md @@ -8,7 +8,7 @@ This folder provides a Cookiecutter template for a Nautobot App that adheres to ### IMPORTANT Cookie Notes -- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.plugin_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! +- The logo of the project is a placeholder (`docs/images/icon-{{ cookiecutter.app_slug }}.png`) - please replace it with your app icon, making sure it's at least 200x200px and has a transparent background! - Please resolve and remove **all** of the comments and blocks marked with `Developer Note - Remove Me!` prior to publishing the documentation. Catch'em all with `rgrep "Developer Note"`. - The documentation website will be built and hosted on `readthedocs.io` for open source projects and follows the standard Network to Code branding for all our open source projects. @@ -24,20 +24,20 @@ The following table lists the inputs that you will be prompted for when generati | Setting | Description | |-------- | ----------- | -| **codeowner_github_usernames** | The Github codeowners for the new plugin | -| **full_name** | Used in the **author** field within `pyproject.toml` and `PluginConfig` | +| **codeowner_github_usernames** | The Github codeowners for the new app | +| **full_name** | Used in the **author** field within `pyproject.toml` and `NautobotAppConfig` | | **email** | Used in the **author** field within `pyproject.toml` | | **github_org** | Used to construct **repo_url** | -| **plugin_name** | The Python name of the plugin | -| **verbose_name** | Used in `PluginConfig` | -| **plugin_slug** | Python packaging name | +| **app_name** | The Python name of the app | +| **verbose_name** | Used in `NautobotAppConfig` | +| **app_slug** | Python packaging name | | **project_slug** | Used to construct **repo_url** | -| **base_url** | Defines plugin's base url used in Nautobot | +| **base_url** | Defines app's base url used in Nautobot | | **min_nautobot_version** | The minimum supported Nautobot version | | **max_nautobot_version** | The maximum supported Nautobot version | | **nautobot_version** | Used for development purposes to decide with Nautobot-dev Docker image to use for development | -| **camel_name** | Used to define the plugin's subclassing of `PluginConfig`, e.g. `MyPluginConfig(PluginConfig):` | -| **project_short_description** | Used in the **description** field within `PluginConfig` | +| **camel_name** | Used to define the app's subclassing of `NautobotAppConfig`, e.g. `MyNautobotAppConfig(NautobotAppConfig):` | +| **project_short_description** | Used in the **description** field within `NautobotAppConfig` | | **model_class_name** | If you want to generate initial files, such as `models.py`, `forms.py`, `filters.py`, `navigation.py`, `tables.py`, `views`, and API models, initialize this name to a valid model name. The default value is `None` | | **Select open_source_license** | Determine if project is open source or not | | **docs_base_url**| The main URL where the project documentation will be hosted. For open source projects use the default (`https://docs.nautobot.com`). | diff --git a/nautobot-app/cookiecutter.json b/nautobot-app/cookiecutter.json index 0636af2c..6786ac25 100644 --- a/nautobot-app/cookiecutter.json +++ b/nautobot-app/cookiecutter.json @@ -3,15 +3,15 @@ "full_name": "Network to Code, LLC", "email": "info@networktocode.com", "github_org": "nautobot", - "plugin_name": "my_app", - "verbose_name": "{{ cookiecutter.plugin_name.title().replace('_', ' ') }}", - "plugin_slug": "{{ cookiecutter.plugin_name.lower().replace(' ', '-').replace('_', '-') }}", - "project_slug": "nautobot-app-{{ cookiecutter.plugin_slug }}", + "app_name": "my_app", + "verbose_name": "{{ cookiecutter.app_name.title().replace('_', ' ') }}", + "app_slug": "{{ cookiecutter.app_name.lower().replace(' ', '-').replace('_', '-') }}", + "project_slug": "nautobot-app-{{ cookiecutter.app_slug }}", "repo_url": "https://github.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}", - "base_url": "{{ cookiecutter.plugin_slug }}", + "base_url": "{{ cookiecutter.app_slug }}", "min_nautobot_version": "2.0.0", "max_nautobot_version": "2.9999", - "camel_name": "{{ cookiecutter.plugin_slug.title().replace(' ', '').replace('-', '') }}", + "camel_name": "{{ cookiecutter.app_slug.title().replace(' ', '').replace('-', '') }}", "project_short_description": "{{ cookiecutter.verbose_name }}", "model_class_name": "None", "open_source_license": [ @@ -19,5 +19,5 @@ "Not open source" ], "docs_base_url": "https://docs.nautobot.com", - "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.plugin_slug }}/en/latest" -} + "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.app_slug }}/en/latest" +} \ No newline at end of file diff --git a/nautobot-app/hooks/post_gen_project.py b/nautobot-app/hooks/post_gen_project.py index d90caff1..623d4d8d 100644 --- a/nautobot-app/hooks/post_gen_project.py +++ b/nautobot-app/hooks/post_gen_project.py @@ -3,7 +3,7 @@ from pathlib import Path _PROJECT_PATH = Path.cwd() -_ADDONS_PATH = _PROJECT_PATH / "{{ cookiecutter.plugin_name }}" +_ADDONS_PATH = _PROJECT_PATH / "{{ cookiecutter.app_name }}" _CONGRATS = f""" Congratulations! Your cookie has now been baked. It is located at {_PROJECT_PATH}. @@ -35,7 +35,7 @@ "models.py", "navigation.py", "tables.py", - "templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name.lower() }}_retrieve.html", + "templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name.lower() }}_retrieve.html", "tests/fixtures.py", "tests/test_api_views.py", "tests/test_filter_{{ cookiecutter.model_class_name.lower() }}.py", @@ -50,14 +50,14 @@ folders_to_remove = [ "api", "migrations", - "templates/{{ cookiecutter.plugin_name }}", + "templates/{{ cookiecutter.app_name }}", "templates", ] for folder in folders_to_remove: (_ADDONS_PATH / folder).rmdir() # Persist the baked cookie parameters in-repo for future usage as a replay file or for the drift management. - cookie = {{ cookiecutter }} + cookie = {{cookiecutter}} (_PROJECT_PATH / ".cookiecutter.json").write_text( json.dumps({"cookiecutter": cookie}, indent=4) + "\n", encoding="utf-8" ) diff --git a/nautobot-app/hooks/pre_gen_project.py b/nautobot-app/hooks/pre_gen_project.py index 958d1591..4557091b 100644 --- a/nautobot-app/hooks/pre_gen_project.py +++ b/nautobot-app/hooks/pre_gen_project.py @@ -4,12 +4,11 @@ MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$" -plugin_name = "{{ cookiecutter.plugin_name }}" +app_name = "{{ cookiecutter.app_name }}" -if not re.match(MODULE_REGEX, plugin_name): +if not re.match(MODULE_REGEX, app_name): print( - "ERROR: The plugin Name (%s) is not a valid Python module name. Please do not use a - and use _ instead" - % plugin_name + "ERROR: The app Name (%s) is not a valid Python module name. Please do not use a - and use _ instead" % app_name ) # Exit to cancel project diff --git a/nautobot-app/tests/conftest.py b/nautobot-app/tests/conftest.py index 6f773c0d..9bacd48f 100644 --- a/nautobot-app/tests/conftest.py +++ b/nautobot-app/tests/conftest.py @@ -38,23 +38,23 @@ def cookies_baked_nautobot_app(cookies): examples_projects = {} results = {} extra_contexts = { - "nautobot-plugin": { + "nautobot-app": { "open_source_license": "Not open source", - "plugin_name": "nautobot_plugin", + "app_name": "nautobot_app", }, - "my-plugin": { + "my-app": { "open_source_license": "Apache-2.0", - "plugin_name": "my_plugin", + "app_name": "my_app", }, } # pylint: disable-next=protected-access environ["COOKIECUTTER_CONFIG"] = str(cookies._config_file) - for plugin_slug, extra_context in extra_contexts.items(): - results[plugin_slug] = cookies.bake(extra_context=extra_context, template="nautobot-app") + for app_slug, extra_context in extra_contexts.items(): + results[app_slug] = cookies.bake(extra_context=extra_context, template="nautobot-app") - assert results[plugin_slug].exception is None + assert results[app_slug].exception is None - examples_projects[plugin_slug] = init_examples_project(plugin_slug) - shutil.move(results[plugin_slug].project_path, examples_projects[plugin_slug]) + examples_projects[app_slug] = init_examples_project(app_slug) + shutil.move(results[app_slug].project_path, examples_projects[app_slug]) return results, examples_projects diff --git a/nautobot-app/tests/test_bake_nautobot_app.py b/nautobot-app/tests/test_bake_nautobot_app.py index 90284b32..549d2631 100644 --- a/nautobot-app/tests/test_bake_nautobot_app.py +++ b/nautobot-app/tests/test_bake_nautobot_app.py @@ -23,7 +23,7 @@ def test_bake_nautobot_execution(cookies_baked_nautobot_app): Tests creation of example nautobot with the cookiecutter default values """ results, examples_projects = cookies_baked_nautobot_app - plugin_slug = "nautobot-plugin" - assert results[plugin_slug].exit_code == 0 - assert results[plugin_slug].exception is None - assert examples_projects[plugin_slug].is_dir() + app_slug = "nautobot-app" + assert results[app_slug].exit_code == 0 + assert results[app_slug].exception is None + assert examples_projects[app_slug].is_dir() diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md index acca3ff4..880d6a06 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,12 +1,12 @@ --- name: 🐛 Bug Report -about: Report a reproducible bug in the current release of {{ cookiecutter.plugin_slug }} +about: Report a reproducible bug in the current release of {{ cookiecutter.app_slug }} --- ### Environment * Python version: * Nautobot version: -* {{ cookiecutter.plugin_slug }} version: +* {{ cookiecutter.app_slug }} version: ### Expected Behavior diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md index 4c6af8fa..9b6a4d7f 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/.github/ISSUE_TEMPLATE/feature_request.md @@ -6,7 +6,7 @@ about: Propose a new feature or enhancement ### Environment * Nautobot version: -* {{ cookiecutter.plugin_slug }} version: +* {{ cookiecutter.app_slug }} version:

- +
- - + +
An App for Nautobot.

@@ -29,9 +29,9 @@ To avoid extra work and temporary links, make sure that publishing docs (or merg > Developer Note: Add any representative screenshots of the App in action. These images should also be added to the `docs/user/app_use_cases.md` section. -> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/plugin-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI. +> Developer Note: Place the files in the `docs/images/` folder and link them using only full URLs from GitHub, for example: `![Overview](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/app-overview.png)`. This absolute static linking is required to ensure the README renders properly in GitHub, the docs site, and any other external sites like PyPI. -More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the plugin's added functionality: +More screenshots can be found in the [Using the App]({{ cookiecutter.docs_app_url }}/user/app_use_cases/) page in the documentation. Here's a quick overview of some of the app's added functionality: ![](https://raw.githubusercontent.com/{{ cookiecutter.github_org }}/{{ cookiecutter.project_slug }}/develop/docs/images/placeholder.png) diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile b/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile index e4851f92..b378e191 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/Dockerfile @@ -20,7 +20,7 @@ ARG NAUTOBOT_ROOT=/opt/nautobot ENV prometheus_multiproc_dir=/prom_cache ENV NAUTOBOT_ROOT=${NAUTOBOT_ROOT} -ENV INVOKE_{{ cookiecutter.plugin_name.upper() }}_LOCAL=true +ENV INVOKE_{{ cookiecutter.app_name.upper() }}_LOCAL=true # Install Poetry manually via its installer script; # We might be using an older version of Nautobot that includes an older version of Poetry diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml index 58ce8438..05b7893b 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.base.yml @@ -7,7 +7,7 @@ x-nautobot-build: &nautobot-build context: "../" dockerfile: "development/Dockerfile" x-nautobot-base: &nautobot-base - image: "{{ cookiecutter.plugin_slug }}/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" + image: "{{ cookiecutter.app_slug }}/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" env_file: - "development.env" - "creds.env" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml index 86366357..ec952217 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/docker-compose.dev.yml @@ -24,7 +24,7 @@ services: - "8001:8080" volumes: - "../:/source" - image: "{{ cookiecutter.plugin_slug }}/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" + image: "{{ cookiecutter.app_slug }}/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" healthcheck: disable: true tty: true diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py index 19f8f2a4..da40753c 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/development/nautobot_config.py @@ -126,12 +126,12 @@ # # Enable installed Apps. Add the name of each App to the list. -PLUGINS = ["{{ cookiecutter.plugin_name }}"] +PLUGINS = ["{{ cookiecutter.app_name }}"] # Apps configuration settings. These settings are used by various Apps that the user may have installed. # Each key in the dictionary is the name of an installed App and its value is a dictionary of settings. # PLUGINS_CONFIG = { -# '{{ cookiecutter.plugin_name }}': { +# '{{ cookiecutter.app_name }}': { # 'foo': 'bar', # 'buzz': 'bazz' # } diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md index eb4e5277..d595b92a 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/compatibility_matrix.md @@ -1,7 +1,7 @@ # Compatibility Matrix !!! warning "Developer Note - Remove Me!" - Explain how the release models of the plugin and of Nautobot work together, how releases are supported, how features and older releases are deprecated etc. + Explain how the release models of the app and of Nautobot work together, how releases are supported, how features and older releases are deprecated etc. | {{ cookiecutter.verbose_name }} Version | Nautobot First Support Version | Nautobot Last Support Version | | ------------- | -------------------- | ------------- | diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md index c1a11fb7..47f599fb 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/install.md @@ -7,7 +7,7 @@ Here you will find detailed instructions on how to **install** and **configure** ## Prerequisites -- The plugin is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher. +- The app is compatible with Nautobot {{ cookiecutter.min_nautobot_version }} and higher. - Databases supported: PostgreSQL, MySQL !!! note @@ -21,31 +21,31 @@ Here you will find detailed instructions on how to **install** and **configure** ## Install Guide !!! note - Plugins can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this plugin is [`{{ cookiecutter.plugin_slug }}`](https://pypi.org/project/{{ cookiecutter.plugin_slug }}/). + Apps can be installed manually or using Python's `pip`. See the [nautobot documentation](https://nautobot.readthedocs.io/en/latest/plugins/#install-the-package) for more details. The pip package name for this app is [`{{ cookiecutter.app_slug }}`](https://pypi.org/project/{{ cookiecutter.app_slug }}/). -The plugin is available as a Python package via PyPI and can be installed with `pip`: +The app is available as a Python package via PyPI and can be installed with `pip`: ```shell -pip install {{ cookiecutter.plugin_slug }} +pip install {{ cookiecutter.app_slug }} ``` -To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.plugin_slug }}` package: +To ensure {{ cookiecutter.verbose_name }} is automatically re-installed during future upgrades, create a file named `local_requirements.txt` (if not already existing) in the Nautobot root directory (alongside `requirements.txt`) and list the `{{ cookiecutter.app_slug }}` package: ```shell -echo {{ cookiecutter.plugin_slug }} >> local_requirements.txt +echo {{ cookiecutter.app_slug }} >> local_requirements.txt ``` -Once installed, the plugin needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file: +Once installed, the app needs to be enabled in your Nautobot configuration. The following block of code below shows the additional configuration required to be added to your `nautobot_config.py` file: -- Append `"{{ cookiecutter.plugin_name }}"` to the `PLUGINS` list. -- Append the `"{{ cookiecutter.plugin_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults. +- Append `"{{ cookiecutter.app_name }}"` to the `PLUGINS` list. +- Append the `"{{ cookiecutter.app_name }}"` dictionary to the `PLUGINS_CONFIG` dictionary and override any defaults. ```python # In your nautobot_config.py -PLUGINS = ["{{ cookiecutter.plugin_name }}"] +PLUGINS = ["{{ cookiecutter.app_name }}"] # PLUGINS_CONFIG = { -# "{{ cookiecutter.plugin_name }}": { +# "{{ cookiecutter.app_name }}": { # ADD YOUR SETTINGS HERE # } # } @@ -72,10 +72,10 @@ sudo systemctl restart nautobot nautobot-worker nautobot-scheduler !!! warning "Developer Note - Remove Me!" Any configuration required to get the App set up. Edit the table below as per the examples provided. -The plugin behavior can be controlled with the following list of settings: +The app behavior can be controlled with the following list of settings: | Key | Example | Default | Description | | ------- | ------ | -------- | ------------------------------------- | -| `enable_backup` | `True` | `True` | A boolean to represent whether or not to run backup configurations within the plugin. | +| `enable_backup` | `True` | `True` | A boolean to represent whether or not to run backup configurations within the app. | | `platform_slug_map` | `{"cisco_wlc": "cisco_aireos"}` | `None` | A dictionary in which the key is the platform slug and the value is what netutils uses in any "network_os" parameter. | | `per_feature_bar_width` | `0.15` | `0.15` | The width of the table bar within the overview report | diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md index c181648b..b2456689 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/release_notes/version_1.0.md @@ -27,7 +27,7 @@ This document describes all new features and changes in the release `1.0`. The f - Major features or milestones - Achieved in this `x.y` release -- Changes to compatibility with Nautobot and/or other plugins, libraries etc. +- Changes to compatibility with Nautobot and/or other apps, libraries etc. ## [v1.0.1] - 2021-09-08 diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/uninstall.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/uninstall.md index 862efdde..b09ce35e 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/uninstall.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/uninstall.md @@ -4,10 +4,10 @@ Here you will find any steps necessary to cleanly remove the App from your Nauto ## Database Cleanup -Prior to removing the plugin from the `nautobot_config.py`, run the following command to roll back any migration specific to this plugin. +Prior to removing the app from the `nautobot_config.py`, run the following command to roll back any migration specific to this app. ```shell -nautobot-server migrate {{ cookiecutter.plugin_name }} zero +nautobot-server migrate {{ cookiecutter.app_name }} zero ``` !!! warning "Developer Note - Remove Me!" @@ -20,5 +20,5 @@ Remove the configuration you added in `nautobot_config.py` from `PLUGINS` & `PLU ## Uninstall the package ```bash -$ pip3 uninstall {{ cookiecutter.plugin_slug }} +$ pip3 uninstall {{ cookiecutter.app_slug }} ``` diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md index 72a11b50..beb7f70c 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/admin/upgrade.md @@ -7,4 +7,4 @@ Here you will find any steps necessary to upgrade the App in your Nautobot envir !!! warning "Developer Note - Remove Me!" Add more detailed steps on how the app is upgraded in an existing Nautobot setup and any version specifics (such as upgrading between major versions with breaking changes). -When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this plugin. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `{{ cookiecutter.plugin_slug }}` package via `pip`. +When a new release comes out it may be necessary to run a migration of the database to account for any changes in the data models used by this app. Execute the command `nautobot-server post-upgrade` within the runtime environment of your Nautobot installation after updating the `{{ cookiecutter.app_slug }}` package via `pip`. diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/arch_decision.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/arch_decision.md index e7bcbbe4..6a68035d 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/arch_decision.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/arch_decision.md @@ -4,4 +4,4 @@ The intention is to document deviations from a standard Model View Controller (M !!! warning "Developer Note - Remove Me!" Optional page, remove if not applicable. - For examples see [Golden Config](https://github.com/nautobot/nautobot-plugin-golden-config/tree/develop/docs/dev/dev_adr.md) and [nautobot-plugin-reservation](https://github.com/networktocode/nautobot-plugin-reservation/blob/develop/docs/dev/dev_adr.md). + For examples see [Golden Config](https://github.com/nautobot/nautobot-plugin-golden-config/tree/develop/docs/dev/dev_adr.md). diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md index cf546297..12cd7681 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/api.md @@ -1,5 +1,5 @@ # {{ cookiecutter.verbose_name }} API Package -::: {{ cookiecutter.plugin_name }}.api +::: {{ cookiecutter.app_name }}.api options: show_submodules: True diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md index 8c21bcdf..ec69ec4d 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/code_reference/package.md @@ -1 +1 @@ -::: {{ cookiecutter.plugin_name }} +::: {{ cookiecutter.app_name }} diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/contributing.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/contributing.md index 2337f740..042fd89d 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/contributing.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/contributing.md @@ -9,7 +9,7 @@ The project is following Network to Code software development guidelines and is - Python linting and formatting: `black`, `pylint`, `bandit`, `flake8`, and `pydocstyle`. - YAML linting is done with `yamllint`. -- Django unit test to ensure the plugin is working properly. +- Django unit test to ensure the app is working properly. Documentation is built using [mkdocs](https://www.mkdocs.org/). The [Docker based development environment](dev_environment.md#docker-development-environment) automatically starts a container hosting a live version of the documentation website on [http://localhost:8001](http://localhost:8001) that auto-refreshes when you make any changes to your local files. diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md index b48467d5..c45a0215 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/dev/dev_environment.md @@ -14,13 +14,13 @@ This is a quick reference guide if you're already familiar with the development The [Invoke](http://www.pyinvoke.org/) library is used to provide some helper commands based on the environment. There are a few configuration parameters which can be passed to Invoke to override the default configuration: - `nautobot_ver`: the version of Nautobot to use as a base for any built docker containers (default: {{ cookiecutter.min_nautobot_version }}) -- `project_name`: the default docker compose project name (default: `{{ cookiecutter.plugin_slug }}`) +- `project_name`: the default docker compose project name (default: `{{ cookiecutter.app_slug }}`) - `python_ver`: the version of Python to use as a base for any built docker containers (default: 3.11) - `local`: a boolean flag indicating if invoke tasks should be run on the host or inside the docker containers (default: False, commands will be run in docker containers) - `compose_dir`: the full path to a directory containing the project compose files - `compose_files`: a list of compose files applied in order (see [Multiple Compose files](https://docs.docker.com/compose/extends/#multiple-compose-files) for more information) -Using **Invoke** these configuration options can be overridden using [several methods](https://docs.pyinvoke.org/en/stable/concepts/configuration.html). Perhaps the simplest is setting an environment variable `INVOKE_{{ cookiecutter.plugin_name.upper() }}_VARIABLE_NAME` where `VARIABLE_NAME` is the variable you are trying to override. The only exception is `compose_files`, because it is a list it must be overridden in a YAML file. There is an example `invoke.yml` (`invoke.example.yml`) in this directory which can be used as a starting point. +Using **Invoke** these configuration options can be overridden using [several methods](https://docs.pyinvoke.org/en/stable/concepts/configuration.html). Perhaps the simplest is setting an environment variable `INVOKE_{{ cookiecutter.app_name.upper() }}_VARIABLE_NAME` where `VARIABLE_NAME` is the variable you are trying to override. The only exception is `compose_files`, because it is a list it must be overridden in a YAML file. There is an example `invoke.yml` (`invoke.example.yml`) in this directory which can be used as a starting point. ### Docker Development Environment @@ -56,7 +56,7 @@ To either stop or destroy the development environment use the following options. ```yaml --- -{{ cookiecutter.plugin_name }}: +{{ cookiecutter.app_name }}: local: true ``` @@ -128,8 +128,8 @@ Each command can be executed with `invoke `. All commands support the a flake8 Run flake8 to check that Python files adhere to its style standards. pydocstyle Run pydocstyle to validate docstring formatting adheres to NTC defined standards. pylint Run pylint code analysis. - tests Run all tests for this plugin. - unittest Run Django unit tests for the plugin. + tests Run all tests for this app. + unittest Run Django unit tests for the app. ``` ## Project Overview @@ -180,7 +180,7 @@ The first thing you need to do is build the necessary Docker image for Nautobot #14 exporting layers #14 exporting layers 1.2s done #14 writing image sha256:2d524bc1665327faa0d34001b0a9d2ccf450612bf8feeb969312e96a2d3e3503 done -#14 naming to docker.io/{{ cookiecutter.plugin_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 done +#14 naming to docker.io/{{ cookiecutter.app_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 done ``` ### Invoke - Starting the Development Environment @@ -191,18 +191,18 @@ Next, you need to start up your Docker containers. ➜ invoke start Starting Nautobot in detached mode... Running docker-compose command "up --detach" -Creating network "{{ cookiecutter.plugin_name }}_default" with the default driver -Creating volume "{{ cookiecutter.plugin_name }}_postgres_data" with default driver -Creating {{ cookiecutter.plugin_name }}_redis_1 ... -Creating {{ cookiecutter.plugin_name }}_docs_1 ... -Creating {{ cookiecutter.plugin_name }}_postgres_1 ... -Creating {{ cookiecutter.plugin_name }}_postgres_1 ... done -Creating {{ cookiecutter.plugin_name }}_redis_1 ... done -Creating {{ cookiecutter.plugin_name }}_nautobot_1 ... -Creating {{ cookiecutter.plugin_name }}_docs_1 ... done -Creating {{ cookiecutter.plugin_name }}_nautobot_1 ... done -Creating {{ cookiecutter.plugin_name }}_worker_1 ... -Creating {{ cookiecutter.plugin_name }}_worker_1 ... done +Creating network "{{ cookiecutter.app_name }}_default" with the default driver +Creating volume "{{ cookiecutter.app_name }}_postgres_data" with default driver +Creating {{ cookiecutter.app_name }}_redis_1 ... +Creating {{ cookiecutter.app_name }}_docs_1 ... +Creating {{ cookiecutter.app_name }}_postgres_1 ... +Creating {{ cookiecutter.app_name }}_postgres_1 ... done +Creating {{ cookiecutter.app_name }}_redis_1 ... done +Creating {{ cookiecutter.app_name }}_nautobot_1 ... +Creating {{ cookiecutter.app_name }}_docs_1 ... done +Creating {{ cookiecutter.app_name }}_nautobot_1 ... done +Creating {{ cookiecutter.app_name }}_worker_1 ... +Creating {{ cookiecutter.app_name }}_worker_1 ... done Docker Compose is now in the Docker CLI, try `docker compose up` ``` @@ -211,11 +211,11 @@ This will start all of the Docker containers used for hosting Nautobot. You shou ```bash ➜ docker ps ****CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -ee90fbfabd77 {{ cookiecutter.plugin_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "nautobot-server rqw…" 16 seconds ago Up 13 seconds {{ cookiecutter.plugin_name }}_worker_1 -b8adb781d013 {{ cookiecutter.plugin_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "/docker-entrypoint.…" 20 seconds ago Up 15 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp {{ cookiecutter.plugin_name }}_nautobot_1 -d64ebd60675d {{ cookiecutter.plugin_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "mkdocs serve -v -a …" 25 seconds ago Up 18 seconds 0.0.0.0:8001->8080/tcp, :::8001->8080/tcp {{ cookiecutter.plugin_name }}_docs_1 -e72d63129b36 postgres:13-alpine "docker-entrypoint.s…" 25 seconds ago Up 19 seconds 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp {{ cookiecutter.plugin_name }}_postgres_1 -96c6ff66997c redis:6-alpine "docker-entrypoint.s…" 25 seconds ago Up 21 seconds 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp {{ cookiecutter.plugin_name }}_redis_1 +ee90fbfabd77 {{ cookiecutter.app_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "nautobot-server rqw…" 16 seconds ago Up 13 seconds {{ cookiecutter.app_name }}_worker_1 +b8adb781d013 {{ cookiecutter.app_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "/docker-entrypoint.…" 20 seconds ago Up 15 seconds 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp {{ cookiecutter.app_name }}_nautobot_1 +d64ebd60675d {{ cookiecutter.app_slug }}/nautobot:{{ cookiecutter.min_nautobot_version }}-py3.11 "mkdocs serve -v -a …" 25 seconds ago Up 18 seconds 0.0.0.0:8001->8080/tcp, :::8001->8080/tcp {{ cookiecutter.app_name }}_docs_1 +e72d63129b36 postgres:13-alpine "docker-entrypoint.s…" 25 seconds ago Up 19 seconds 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp {{ cookiecutter.app_name }}_postgres_1 +96c6ff66997c redis:6-alpine "docker-entrypoint.s…" 25 seconds ago Up 21 seconds 0.0.0.0:6379->6379/tcp, :::6379->6379/tcp {{ cookiecutter.app_name }}_redis_1 ``` Once the containers are fully up, you should be able to open up a web browser, and view: @@ -259,27 +259,27 @@ The last command to know for now is `invoke stop`. ➜ invoke stop Stopping Nautobot... Running docker-compose command "down" -Stopping {{ cookiecutter.plugin_name }}_worker_1 ... -Stopping {{ cookiecutter.plugin_name }}_nautobot_1 ... -Stopping {{ cookiecutter.plugin_name }}_docs_1 ... -Stopping {{ cookiecutter.plugin_name }}_redis_1 ... -Stopping {{ cookiecutter.plugin_name }}_postgres_1 ... -Stopping {{ cookiecutter.plugin_name }}_worker_1 ... done -Stopping {{ cookiecutter.plugin_name }}_nautobot_1 ... done -Stopping {{ cookiecutter.plugin_name }}_postgres_1 ... done -Stopping {{ cookiecutter.plugin_name }}_redis_1 ... done -Stopping {{ cookiecutter.plugin_name }}_docs_1 ... done -Removing {{ cookiecutter.plugin_name }}_worker_1 ... -Removing {{ cookiecutter.plugin_name }}_nautobot_1 ... -Removing {{ cookiecutter.plugin_name }}_docs_1 ... -Removing {{ cookiecutter.plugin_name }}_redis_1 ... -Removing {{ cookiecutter.plugin_name }}_postgres_1 ... -Removing {{ cookiecutter.plugin_name }}_postgres_1 ... done -Removing {{ cookiecutter.plugin_name }}_docs_1 ... done -Removing {{ cookiecutter.plugin_name }}_worker_1 ... done -Removing {{ cookiecutter.plugin_name }}_redis_1 ... done -Removing {{ cookiecutter.plugin_name }}_nautobot_1 ... done -Removing network {{ cookiecutter.plugin_name }}_default +Stopping {{ cookiecutter.app_name }}_worker_1 ... +Stopping {{ cookiecutter.app_name }}_nautobot_1 ... +Stopping {{ cookiecutter.app_name }}_docs_1 ... +Stopping {{ cookiecutter.app_name }}_redis_1 ... +Stopping {{ cookiecutter.app_name }}_postgres_1 ... +Stopping {{ cookiecutter.app_name }}_worker_1 ... done +Stopping {{ cookiecutter.app_name }}_nautobot_1 ... done +Stopping {{ cookiecutter.app_name }}_postgres_1 ... done +Stopping {{ cookiecutter.app_name }}_redis_1 ... done +Stopping {{ cookiecutter.app_name }}_docs_1 ... done +Removing {{ cookiecutter.app_name }}_worker_1 ... +Removing {{ cookiecutter.app_name }}_nautobot_1 ... +Removing {{ cookiecutter.app_name }}_docs_1 ... +Removing {{ cookiecutter.app_name }}_redis_1 ... +Removing {{ cookiecutter.app_name }}_postgres_1 ... +Removing {{ cookiecutter.app_name }}_postgres_1 ... done +Removing {{ cookiecutter.app_name }}_docs_1 ... done +Removing {{ cookiecutter.app_name }}_worker_1 ... done +Removing {{ cookiecutter.app_name }}_redis_1 ... done +Removing {{ cookiecutter.app_name }}_nautobot_1 ... done +Removing network {{ cookiecutter.app_name }}_default ``` This will safely shut down all of your running Docker containers for this project. When you are ready to spin containers back up, it is as simple as running `invoke start` again [as seen previously](#invoke-starting-the-development-environment). @@ -291,9 +291,9 @@ This will safely shut down all of your running Docker containers for this projec Your environment should now be fully setup, all necessary Docker containers are created and running, and you're logged into Nautobot in your web browser. Now what? -Now you can start developing your plugin in the project folder! +Now you can start developing your app in the project folder! -The magic here is the root directory is mounted inside your Docker containers when built and ran, so **any** changes made to the files in here are directly updated to the Nautobot plugin code running in Docker. This means that as you modify the code in your plugin folder, the changes will be instantly updated in Nautobot. +The magic here is the root directory is mounted inside your Docker containers when built and ran, so **any** changes made to the files in here are directly updated to the Nautobot app code running in Docker. This means that as you modify the code in your app folder, the changes will be instantly updated in Nautobot. !!! warning There are a few exceptions to this, as outlined in the section [To Rebuild or Not To Rebuild](#to-rebuild-or-not-to-rebuild). @@ -317,7 +317,7 @@ When trying to debug an issue, one helpful thing you can look at are the logs wi !!! info Want to limit the log output even further? Use the `--tail <#>` command line argument in conjunction with `-f`. -So for example, our plugin is named `{{ cookiecutter.plugin_slug }}`, the command would most likely be `docker logs {{ cookiecutter.plugin_name }}_nautobot_1 -f`. You can find the name of all running containers via `docker ps`. +So for example, our app is named `{{ cookiecutter.app_slug }}`, the command would most likely be `docker logs {{ cookiecutter.app_name }}_nautobot_1 -f`. You can find the name of all running containers via `docker ps`. If you want to view the logs specific to the worker container, simply use the name of that container instead. @@ -343,7 +343,7 @@ Once completed, the new/updated environment variables should now be live. ### Installing Additional Python Packages -If you want your plugin to leverage another available Nautobot plugin or another Python package, you can easily add them into your Docker environment. +If you want your app to leverage another available Nautobot app or another Python package, you can easily add them into your Docker environment. ```bash ➜ poetry shell @@ -358,18 +358,18 @@ Once the dependencies are resolved, stop the existing containers, rebuild the Do ➜ invoke start ``` -### Installing Additional Nautobot Plugins +### Installing Additional Nautobot Apps -Let's say for example you want the new plugin you're creating to integrate into Slack. To do this, you will want to integrate into the existing Nautobot ChatOps Plugin. +Let's say for example you want the new app you're creating to integrate into Slack. To do this, you will want to integrate into the existing Nautobot ChatOps App. ```bash ➜ poetry shell ➜ poetry add nautobot-chatops ``` -Once you activate the virtual environment via Poetry, you then tell Poetry to install the new plugin. +Once you activate the virtual environment via Poetry, you then tell Poetry to install the new app. -Before you continue, you'll need to update the file `development/nautobot_config.py` accordingly with the name of the new plugin under `PLUGINS` and any relevant settings as necessary for the plugin under `PLUGINS_CONFIG`. Since you're modifying the underlying OS (not just Django files), you need to rebuild the image. This is a similar process to updating environment variables, which was explained earlier. +Before you continue, you'll need to update the file `development/nautobot_config.py` accordingly with the name of the new app under `PLUGINS` and any relevant settings as necessary for the app under `PLUGINS_CONFIG`. Since you're modifying the underlying OS (not just Django files), you need to rebuild the image. This is a similar process to updating environment variables, which was explained earlier. ```bash ➜ invoke stop @@ -377,7 +377,7 @@ Before you continue, you'll need to update the file `development/nautobot_config ➜ invoke start ``` -Once the containers are up and running, you should now see the new plugin installed in your Nautobot instance. +Once the containers are up and running, you should now see the new app installed in your Nautobot instance. !!! note You can even launch an `ngrok` service locally on your laptop, pointing to port 8080 (such as for chatops development), and it will point traffic directly to your Docker images. @@ -387,10 +387,10 @@ Once the containers are up and running, you should now see the new plugin instal To update the Python version, you can update it within `tasks.py`. ```python -namespace = Collection("{{ cookiecutter.plugin_name }}") +namespace = Collection("{{ cookiecutter.app_name }}") namespace.configure( { - "{{ cookiecutter.plugin_name }}": { + "{{ cookiecutter.app_name }}": { ... "python_ver": "3.11", ... @@ -399,17 +399,17 @@ namespace.configure( ) ``` -Or set the `INVOKE_{{ cookiecutter.plugin_name.upper() }}_PYTHON_VER` variable. +Or set the `INVOKE_{{ cookiecutter.app_name.upper() }}_PYTHON_VER` variable. ### Updating Nautobot Version To update the Nautobot version, you can update it within `tasks.py`. ```python -namespace = Collection("{{ cookiecutter.plugin_name }}") +namespace = Collection("{{ cookiecutter.app_name }}") namespace.configure( { - "{{ cookiecutter.plugin_name }}": { + "{{ cookiecutter.app_name }}": { ... "nautobot_ver": "{{ cookiecutter.min_nautobot_version }}", ... @@ -418,7 +418,7 @@ namespace.configure( ) ``` -Or set the `INVOKE_{{ cookiecutter.plugin_name.upper() }}_NAUTOBOT_VER` variable. +Or set the `INVOKE_{{ cookiecutter.app_name.upper() }}_NAUTOBOT_VER` variable. ## Other Miscellaneous Commands To Know diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png b/nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png similarity index 100% rename from nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.plugin_slug }}.png rename to nautobot-app/{{ cookiecutter.project_slug }}/docs/images/icon-{{ cookiecutter.app_slug }}.png diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/docs/user/app_overview.md b/nautobot-app/{{ cookiecutter.project_slug }}/docs/user/app_overview.md index 06ff5d32..582b3610 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/docs/user/app_overview.md +++ b/nautobot-app/{{ cookiecutter.project_slug }}/docs/user/app_overview.md @@ -21,7 +21,7 @@ This document provides an overview of the App including critical information and ## Nautobot Features Used !!! warning "Developer Note - Remove Me!" - What is shown today in the Installed Plugins page in Nautobot. What parts of Nautobot does it interact with, what does it add etc. ? + What is shown today in the Installed Apps page in Nautobot. What parts of Nautobot does it interact with, what does it add etc. ? ### Extras diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml index d76d1632..c76449a9 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.example.yml @@ -1,6 +1,6 @@ --- -{{ cookiecutter.plugin_name }}: - project_name: "{{ cookiecutter.plugin_slug }}" +{{ cookiecutter.app_name }}: + project_name: "{{ cookiecutter.app_slug }}" nautobot_ver: "{{ cookiecutter.min_nautobot_version }}" local: false python_ver: "3.11" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml index e0e248ff..ffc9c8d1 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/invoke.mysql.yml @@ -1,6 +1,6 @@ --- -{{ cookiecutter.plugin_name }}: - project_name: "{{ cookiecutter.plugin_slug }}" +{{ cookiecutter.app_name }}: + project_name: "{{ cookiecutter.app_slug }}" nautobot_ver: "{{ cookiecutter.min_nautobot_version }}" local: false python_ver: "3.11" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml b/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml index e42aa68b..8358596b 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/mkdocs.yml @@ -1,7 +1,7 @@ --- dev_addr: "127.0.0.1:8001" edit_uri: "edit/main/{{ cookiecutter.project_slug }}/docs" -site_dir: "{{ cookiecutter.plugin_name }}/static/{{ cookiecutter.plugin_name }}/docs" +site_dir: "{{ cookiecutter.app_name }}/static/{{ cookiecutter.app_name }}/docs" site_name: "{{ cookiecutter.verbose_name }} Documentation" site_url: "{{ cookiecutter.docs_app_url }}/" repo_url: "{{ cookiecutter.repo_url }}" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml b/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml index eede7b2c..a3aadbda 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "{{ cookiecutter.plugin_slug }}" +name = "{{ cookiecutter.app_slug }}" version = "0.1.0" description = "{{ cookiecutter.project_short_description }}" authors = ["{{ cookiecutter.full_name }} <{{ cookiecutter.email }}>"] @@ -20,7 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] packages = [ - { include = "{{ cookiecutter.plugin_name }}" }, + { include = "{{ cookiecutter.app_name }}" }, ] [tool.poetry.dependencies] diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py b/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py index a0a7d9fe..24b3d3fa 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/tasks.py @@ -43,13 +43,13 @@ def is_truthy(arg): # Use pyinvoke configuration for default values, see http://docs.pyinvoke.org/en/stable/concepts/configuration.html -# Variables may be overwritten in invoke.yml or by the environment variables INVOKE_{{ cookiecutter.plugin_name.upper() }}_xxx -namespace = Collection("{{ cookiecutter.plugin_name }}") +# Variables may be overwritten in invoke.yml or by the environment variables INVOKE_{{ cookiecutter.app_name.upper() }}_xxx +namespace = Collection("{{ cookiecutter.app_name }}") namespace.configure( { - "{{ cookiecutter.plugin_name }}": { + "{{ cookiecutter.app_name }}": { "nautobot_ver": "{{ cookiecutter.min_nautobot_version }}", - "project_name": "{{ cookiecutter.plugin_slug }}", + "project_name": "{{ cookiecutter.app_slug }}", "python_ver": "3.11", "local": False, "compose_dir": os.path.join(os.path.dirname(__file__), "development"), @@ -66,7 +66,7 @@ def is_truthy(arg): def _is_compose_included(context, name): - return f"docker-compose.{name}.yml" in context.{{ cookiecutter.plugin_name }}.compose_files + return f"docker-compose.{name}.yml" in context.{{ cookiecutter.app_name }}.compose_files def _await_healthy_service(context, service): @@ -118,19 +118,19 @@ def docker_compose(context, command, **kwargs): build_env = { # Note: 'docker compose logs' will stop following after 60 seconds by default, # so we are overriding that by setting this environment variable. - "COMPOSE_HTTP_TIMEOUT": context.{{ cookiecutter.plugin_name }}.compose_http_timeout, - "NAUTOBOT_VER": context.{{ cookiecutter.plugin_name }}.nautobot_ver, - "PYTHON_VER": context.{{ cookiecutter.plugin_name }}.python_ver, + "COMPOSE_HTTP_TIMEOUT": context.{{ cookiecutter.app_name }}.compose_http_timeout, + "NAUTOBOT_VER": context.{{ cookiecutter.app_name }}.nautobot_ver, + "PYTHON_VER": context.{{ cookiecutter.app_name }}.python_ver, **kwargs.pop("env", {}), } compose_command_tokens = [ "docker compose", - f"--project-name {context.{{ cookiecutter.plugin_name }}.project_name}", - f'--project-directory "{context.{{ cookiecutter.plugin_name }}.compose_dir}"', + f"--project-name {context.{{ cookiecutter.app_name }}.project_name}", + f'--project-directory "{context.{{ cookiecutter.app_name }}.compose_dir}"', ] - for compose_file in context.{{ cookiecutter.plugin_name }}.compose_files: - compose_file_path = os.path.join(context.{{ cookiecutter.plugin_name }}.compose_dir, compose_file) + for compose_file in context.{{ cookiecutter.app_name }}.compose_files: + compose_file_path = os.path.join(context.{{ cookiecutter.app_name }}.compose_dir, compose_file) compose_command_tokens.append(f' -f "{compose_file_path}"') compose_command_tokens.append(command) @@ -148,7 +148,7 @@ def docker_compose(context, command, **kwargs): def run_command(context, command, **kwargs): """Wrapper to run a command locally or inside the nautobot container.""" - if is_truthy(context.{{ cookiecutter.plugin_name }}.local): + if is_truthy(context.{{ cookiecutter.app_name }}.local): context.run(command, **kwargs) else: # Check if nautobot is running, no need to start another nautobot container to run a command @@ -182,7 +182,7 @@ def build(context, force_rm=False, cache=True): if force_rm: command += " --force-rm" - print(f"Building Nautobot with Python {context.{{ cookiecutter.plugin_name }}.python_ver}...") + print(f"Building Nautobot with Python {context.{{ cookiecutter.app_name }}.python_ver}...") docker_compose(context, command) @@ -370,7 +370,7 @@ def createsuperuser(context, user="admin"): ) def makemigrations(context, name=""): """Perform makemigrations operation in Django.""" - command = "nautobot-server makemigrations {{ cookiecutter.plugin_name }}" + command = "nautobot-server makemigrations {{ cookiecutter.app_name }}" if name: command += f" --name {name}" @@ -586,7 +586,7 @@ def docs(context): """Build and serve docs locally for development.""" command = "mkdocs serve -v" - if is_truthy(context.{{ cookiecutter.plugin_name }}.local): + if is_truthy(context.{{ cookiecutter.app_name }}.local): print(">>> Serving Documentation at http://localhost:8001") run_command(context, command) else: @@ -649,7 +649,7 @@ def hadolint(context): @task def pylint(context): """Run pylint code analysis.""" - command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml {{ cookiecutter.plugin_name }}' + command = 'pylint --init-hook "import nautobot; nautobot.setup()" --rcfile pyproject.toml {{ cookiecutter.app_name }}' run_command(context, command) @@ -700,7 +700,7 @@ def check_migrations(context): def unittest( context, keepdb=False, - label="{{ cookiecutter.plugin_name }}", + label="{{ cookiecutter.app_name }}", failfast=False, buffer=True, pattern="", @@ -726,7 +726,7 @@ def unittest( @task def unittest_coverage(context): """Report on code test coverage as measured by 'invoke unittest'.""" - command = "coverage report --skip-covered --include '{{ cookiecutter.plugin_name }}/*' --omit *migrations*" + command = "coverage report --skip-covered --include '{{ cookiecutter.app_name }}/*' --omit *migrations*" run_command(context, command) @@ -739,9 +739,9 @@ def unittest_coverage(context): } ) def tests(context, failfast=False, keepdb=False, lint_only=False): - """Run all tests for this plugin.""" + """Run all tests for this app.""" # If we are not running locally, start the docker containers so we don't have to for each test - if not is_truthy(context.{{ cookiecutter.plugin_name }}.local): + if not is_truthy(context.{{ cookiecutter.app_name }}.local): print("Starting Docker Containers...") start(context) # Sorted loosely from fastest to slowest diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py similarity index 81% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py index dbf1b429..7da7fcea 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/__init__.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/__init__.py @@ -1,4 +1,4 @@ -"""Plugin declaration for {{ cookiecutter.plugin_name }}.""" +"""App declaration for {{ cookiecutter.app_name }}.""" # Metadata is inherited from Nautobot. If not including Nautobot in the environment, this should be added from importlib import metadata @@ -8,9 +8,9 @@ class {{ cookiecutter.camel_name }}Config(NautobotAppConfig): - """Plugin configuration for the {{ cookiecutter.plugin_name }} plugin.""" + """App configuration for the {{ cookiecutter.app_name }} app.""" - name = "{{ cookiecutter.plugin_name }}" + name = "{{ cookiecutter.app_name }}" verbose_name = "{{ cookiecutter.verbose_name }}" version = __version__ author = "{{ cookiecutter.full_name }}" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py new file mode 100644 index 00000000..e97c72bb --- /dev/null +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/__init__.py @@ -0,0 +1 @@ +"""REST API module for {{ cookiecutter.app_name }} app.""" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py similarity index 82% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py index b3585cce..18bdb082 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/serializers.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/serializers.py @@ -1,7 +1,7 @@ -"""API serializers for {{ cookiecutter.plugin_name }}.""" +"""API serializers for {{ cookiecutter.app_name }}.""" from nautobot.apps.api import NautobotModelSerializer, TaggedModelSerializerMixin -from {{ cookiecutter.plugin_name }} import models +from {{ cookiecutter.app_name }} import models class {{ cookiecutter.model_class_name }}Serializer(NautobotModelSerializer, TaggedModelSerializerMixin): # pylint: disable=too-many-ancestors diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py similarity index 70% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py index fbda22a7..f5144911 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/urls.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/urls.py @@ -1,8 +1,8 @@ -"""Django API urlpatterns declaration for {{ cookiecutter.plugin_name }} plugin.""" +"""Django API urlpatterns declaration for {{ cookiecutter.app_name }} app.""" from nautobot.apps.api import OrderedDefaultRouter -from {{ cookiecutter.plugin_name }}.api import views +from {{ cookiecutter.app_name }}.api import views router = OrderedDefaultRouter() # add the name of your api endpoint, usually hyphenated model name in plural, e.g. "my-model-classes" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py similarity index 77% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py index 846c45dc..dbf88726 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/views.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/api/views.py @@ -1,9 +1,9 @@ -"""API views for {{ cookiecutter.plugin_name }}.""" +"""API views for {{ cookiecutter.app_name }}.""" from nautobot.apps.api import NautobotModelViewSet -from {{ cookiecutter.plugin_name }} import filters, models -from {{ cookiecutter.plugin_name }}.api import serializers +from {{ cookiecutter.app_name }} import filters, models +from {{ cookiecutter.app_name }}.api import serializers class {{ cookiecutter.model_class_name }}ViewSet(NautobotModelViewSet): # pylint: disable=too-many-ancestors diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py similarity index 83% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py index 1445143f..9461f08e 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/filters.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/filters.py @@ -1,8 +1,8 @@ -"""Filtering for {{ cookiecutter.plugin_name }}.""" +"""Filtering for {{ cookiecutter.app_name }}.""" from nautobot.apps.filters import NautobotFilterSet, NameSearchFilterSet -from {{ cookiecutter.plugin_name }} import models +from {{ cookiecutter.app_name }} import models class {{ cookiecutter.model_class_name }}FilterSet(NautobotFilterSet, NameSearchFilterSet): # pylint: disable=too-many-ancestors diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py similarity index 93% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py index f74cb470..1cdd5905 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/forms.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/forms.py @@ -1,8 +1,8 @@ -"""Forms for {{ cookiecutter.plugin_name }}.""" +"""Forms for {{ cookiecutter.app_name }}.""" from django import forms from nautobot.apps.forms import NautobotBulkEditForm, NautobotFilterForm, NautobotModelForm, TagsBulkEditFormMixin -from {{ cookiecutter.plugin_name }} import models +from {{ cookiecutter.app_name }} import models class {{ cookiecutter.model_class_name }}Form(NautobotModelForm): # pylint: disable=too-many-ancestors diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py similarity index 100% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/migrations/__init__.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/migrations/__init__.py diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py similarity index 96% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py index d8798660..22d329a6 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/models.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/models.py @@ -17,7 +17,7 @@ # If you want to choose a specific model to overload in your class declaration, please reference the following documentation: # how to chose a database model: https://docs.nautobot.com/projects/core/en/stable/plugins/development/#database-models class {{ cookiecutter.model_class_name }}(PrimaryModel): # pylint: disable=too-many-ancestors - """Base model for {{ cookiecutter.verbose_name }} plugin.""" + """Base model for {{ cookiecutter.verbose_name }} app.""" name = models.CharField(max_length=100, unique=True) description = models.CharField(max_length=200, blank=True) diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py new file mode 100644 index 00000000..b6ea647b --- /dev/null +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/navigation.py @@ -0,0 +1,25 @@ +"""Menu items.""" + +from nautobot.apps.ui import NavMenuAddButton, NavMenuGroup, NavMenuItem, NavMenuTab + + +items = ( + NavMenuItem( + link="plugins:{{ cookiecutter.app_name }}:{{ cookiecutter.model_class_name.lower() }}_list", + name="{{ cookiecutter.verbose_name }}", + permissions=["{{ cookiecutter.app_name }}.view_{{ cookiecutter.model_class_name.lower() }}"], + buttons=( + NavMenuAddButton( + link="plugins:{{ cookiecutter.app_name }}:{{ cookiecutter.model_class_name.lower() }}_add", + permissions=["{{ cookiecutter.app_name }}.add_{{ cookiecutter.model_class_name.lower() }}"], + ), + ), + ), +) + +menu_items = ( + NavMenuTab( + name="Apps", + groups=(NavMenuGroup(name="{{ cookiecutter.verbose_name }}", items=tuple(items)),), + ), +) diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py similarity index 91% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py index f99cf0b0..47e8016e 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tables.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tables.py @@ -1,9 +1,9 @@ -"""Tables for {{ cookiecutter.plugin_name }}.""" +"""Tables for {{ cookiecutter.app_name }}.""" import django_tables2 as tables from nautobot.apps.tables import BaseTable, ButtonsColumn, ToggleColumn -from {{ cookiecutter.plugin_name }} import models +from {{ cookiecutter.app_name }} import models class {{ cookiecutter.model_class_name }}Table(BaseTable): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html similarity index 100% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/templates/{{ cookiecutter.plugin_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/templates/{{ cookiecutter.app_name }}/{{ cookiecutter.model_class_name | lower }}_retrieve.html diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py new file mode 100644 index 00000000..0f0755c1 --- /dev/null +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests for {{ cookiecutter.app_name }} app.""" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py similarity index 82% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py index 1bff1dfe..136535da 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/fixtures.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/fixtures.py @@ -1,5 +1,5 @@ """Create fixtures for tests.""" -from {{ cookiecutter.plugin_name }}.models import {{ cookiecutter.model_class_name }} +from {{ cookiecutter.app_name }}.models import {{ cookiecutter.model_class_name }} def create_{{ cookiecutter.model_class_name.lower() }}(): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py similarity index 94% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py index deb81593..87d19300 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api.py @@ -1,4 +1,4 @@ -"""Unit tests for {{ cookiecutter.plugin_name }}.""" +"""Unit tests for {{ cookiecutter.app_name }}.""" from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py similarity index 80% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py index a6c0bfab..d63e61e2 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_api_views.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_api_views.py @@ -1,8 +1,8 @@ -"""Unit tests for {{ cookiecutter.plugin_name }}.""" +"""Unit tests for {{ cookiecutter.app_name }}.""" from nautobot.apps.testing import APIViewTestCases -from {{ cookiecutter.plugin_name }} import models -from {{ cookiecutter.plugin_name }}.tests import fixtures +from {{ cookiecutter.app_name }} import models +from {{ cookiecutter.app_name }}.tests import fixtures class {{ cookiecutter.model_class_name }}APIViewTest(APIViewTestCases.APIViewTestCase): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py similarity index 100% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_basic.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_basic.py diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py similarity index 86% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py index 51ae405c..18fa9e4d 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_filter_{{ cookiecutter.model_class_name | lower }}.py @@ -1,8 +1,8 @@ """Test {{ cookiecutter.model_class_name }} Filter.""" from django.test import TestCase -from {{ cookiecutter.plugin_name }} import filters -from {{ cookiecutter.plugin_name }} import models -from {{ cookiecutter.plugin_name }}.tests import fixtures +from {{ cookiecutter.app_name }} import filters +from {{ cookiecutter.app_name }} import models +from {{ cookiecutter.app_name }}.tests import fixtures class {{ cookiecutter.model_class_name }}FilterTestCase(TestCase): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py similarity index 95% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py index d1669d83..e1d25f1d 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_form_{{ cookiecutter.model_class_name | lower }}.py @@ -1,7 +1,7 @@ """Test {{ cookiecutter.model_class_name.lower() }} forms.""" from django.test import TestCase -from {{ cookiecutter.plugin_name }} import forms +from {{ cookiecutter.app_name }} import forms class {{ cookiecutter.model_class_name }}Test(TestCase): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py similarity index 96% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py index 37ba789a..1f67bbab 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_model_{{ cookiecutter.model_class_name | lower }}.py @@ -2,7 +2,7 @@ from django.test import TestCase -from {{ cookiecutter.plugin_name }} import models +from {{ cookiecutter.app_name }} import models class Test{{ cookiecutter.model_class_name }}(TestCase): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py similarity index 86% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py index 6c7252b2..c4836f39 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/test_views.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/tests/test_views.py @@ -1,8 +1,8 @@ """Unit tests for views.""" from nautobot.apps.testing import ViewTestCases -from {{ cookiecutter.plugin_name }} import models -from {{ cookiecutter.plugin_name }}.tests import fixtures +from {{ cookiecutter.app_name }} import models +from {{ cookiecutter.app_name }}.tests import fixtures class {{ cookiecutter.model_class_name }}ViewTest(ViewTestCases.PrimaryObjectViewTestCase): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py similarity index 64% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py index d6a26306..eb95fe2e 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/urls.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/urls.py @@ -1,7 +1,7 @@ -"""Django urlpatterns declaration for {{ cookiecutter.plugin_name }} plugin.""" +"""Django urlpatterns declaration for {{ cookiecutter.app_name }} app.""" from nautobot.apps.urls import NautobotUIViewSetRouter -from {{ cookiecutter.plugin_name }} import views +from {{ cookiecutter.app_name }} import views router = NautobotUIViewSetRouter() diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py similarity index 80% rename from nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py rename to nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py index 9ac7370a..ac7e08df 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/views.py +++ b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/views.py @@ -1,8 +1,8 @@ -"""Views for {{ cookiecutter.plugin_name }}.""" +"""Views for {{ cookiecutter.app_name }}.""" from nautobot.apps.views import NautobotUIViewSet -from {{ cookiecutter.plugin_name }} import filters, forms, models, tables -from {{ cookiecutter.plugin_name }}.api import serializers +from {{ cookiecutter.app_name }} import filters, forms, models, tables +from {{ cookiecutter.app_name }}.api import serializers class {{ cookiecutter.model_class_name }}UIViewSet(NautobotUIViewSet): diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py deleted file mode 100644 index f3ae94ec..00000000 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""REST API module for {{ cookiecutter.plugin_name }} plugin.""" diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py deleted file mode 100644 index 51291170..00000000 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/navigation.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Menu items.""" - -from nautobot.apps.ui import NavMenuAddButton, NavMenuGroup, NavMenuItem, NavMenuTab - - -items = ( - NavMenuItem( - link="plugins:{{ cookiecutter.plugin_name }}:{{ cookiecutter.model_class_name.lower() }}_list", - name="{{ cookiecutter.verbose_name }}", - permissions=["{{ cookiecutter.plugin_name }}.view_{{ cookiecutter.model_class_name.lower() }}"], - buttons=( - NavMenuAddButton( - link="plugins:{{ cookiecutter.plugin_name }}:{{ cookiecutter.model_class_name.lower() }}_add", - permissions=["{{ cookiecutter.plugin_name }}.add_{{ cookiecutter.model_class_name.lower() }}"], - ), - ), - ), -) - -menu_items = ( - NavMenuTab( - name="Plugins", - groups=(NavMenuGroup(name="{{ cookiecutter.verbose_name }}", items=tuple(items)),), - ), -) diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py b/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py deleted file mode 100644 index 24374daf..00000000 --- a/nautobot-app/{{ cookiecutter.project_slug }}/{{ cookiecutter.plugin_name }}/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unit tests for {{ cookiecutter.plugin_name }} plugin.""" diff --git a/tasks.py b/tasks.py index 5ddf1ef4..a88e9f43 100644 --- a/tasks.py +++ b/tasks.py @@ -398,7 +398,7 @@ def unittest(context, label="", failfast=False, pattern="", verbose=False): } ) def tests(context, failfast=False, keepdb=False, lint_only=False): - """Run all tests for this plugin.""" + """Run all tests for this app.""" # If we are not running locally, start the docker containers so we don't have to for each test if not is_truthy(context.cookiecutter_nautobot_app.local): print("Starting Docker Containers...") From 103ba08e40a3e02c0fe7d71a16b0374a75e5dbc5 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 18 Dec 2023 13:26:47 -0500 Subject: [PATCH 2/5] Update nautobot-app/hooks/post_gen_project.py Co-authored-by: Cristian --- nautobot-app/hooks/post_gen_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nautobot-app/hooks/post_gen_project.py b/nautobot-app/hooks/post_gen_project.py index 623d4d8d..bd255f28 100644 --- a/nautobot-app/hooks/post_gen_project.py +++ b/nautobot-app/hooks/post_gen_project.py @@ -57,7 +57,7 @@ (_ADDONS_PATH / folder).rmdir() # Persist the baked cookie parameters in-repo for future usage as a replay file or for the drift management. - cookie = {{cookiecutter}} + cookie = {{ cookiecutter }} (_PROJECT_PATH / ".cookiecutter.json").write_text( json.dumps({"cookiecutter": cookie}, indent=4) + "\n", encoding="utf-8" ) From febcde807f98d531f5c58f9ec7bf7ef248513e8b Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 18 Dec 2023 13:26:52 -0500 Subject: [PATCH 3/5] Update nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md Co-authored-by: Cristian --- nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md index 196ad347..e1c497d5 100644 --- a/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md +++ b/nautobot-app-ssot/{{ cookiecutter.project_slug }}/README.md @@ -1,6 +1,6 @@ # {{ cookiecutter.verbose_name }} SSoT -A app for [Nautobot](https://github.com/nautobot/nautobot). +An app for [Nautobot](https://github.com/nautobot/nautobot). The term SSoT, or Single Source of Truth, refers to the intention of using Nautobot to consolidate data from disparate Systems of Record to create a single resource for all automation needs. This is done by extending the [Nautobot SSoT framework](https://github.com/nautobot/nautobot-plugin-ssot) which uses the DiffSync library. This plug-in is built with the capability in mind to import and export data from your desired System of Record. From 26262f491f37289c8eed2e022efd632f5d401791 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 18 Dec 2023 13:28:12 -0500 Subject: [PATCH 4/5] Update nautobot-app-ssot/cookiecutter.json --- nautobot-app-ssot/cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nautobot-app-ssot/cookiecutter.json b/nautobot-app-ssot/cookiecutter.json index cf9027e7..08df17af 100644 --- a/nautobot-app-ssot/cookiecutter.json +++ b/nautobot-app-ssot/cookiecutter.json @@ -23,4 +23,4 @@ ], "docs_base_url": "https://docs.nautobot.com", "docs_app_url": "{{ cookiecutter.docs_base_url }}/projects/{{ cookiecutter.app_slug }}/en/latest" -} \ No newline at end of file +} From c9b87b581098e61ccf59af59956badbf90602657 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 18 Dec 2023 13:31:39 -0500 Subject: [PATCH 5/5] Update nautobot-app/{{ cookiecutter.project_slug }}/.github/workflows/upstream_testing.yml --- .../.github/workflows/upstream_testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nautobot-app/{{ cookiecutter.project_slug }}/.github/workflows/upstream_testing.yml b/nautobot-app/{{ cookiecutter.project_slug }}/.github/workflows/upstream_testing.yml index 22876d6a..c7ae27e8 100644 --- a/nautobot-app/{{ cookiecutter.project_slug }}/.github/workflows/upstream_testing.yml +++ b/nautobot-app/{{ cookiecutter.project_slug }}/.github/workflows/upstream_testing.yml @@ -10,4 +10,4 @@ jobs: uses: "nautobot/nautobot/.github/workflows/plugin_upstream_testing_base.yml@develop" with: # Below could potentially be collapsed into a single argument if a concrete relationship between both is enforced invoke_context_name: "{{ cookiecutter.app_name.upper() }}" - app_name: "{{ cookiecutter.project_slug }}" + plugin_name: "{{ cookiecutter.project_slug }}"