-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revamps SSoT cookie for contrib pattern
- Loading branch information
1 parent
e9b4d0c
commit 127f1d9
Showing
10 changed files
with
42 additions
and
145 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Diffsync components for {{ cookiecutter.app_name }}.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/__init__.py
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/adapters/nautobot.py
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...t-app-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Diffsync models for {{ cookiecutter.app_name }}.""" | ||
from typing import Optional, Annotated | ||
|
||
from nautobot.dcim.models import Device | ||
from nautobot_ssot.contrib import CustomFieldAnnotation, NautobotModel | ||
|
||
|
||
class DiffsyncDevice(NautobotModel): | ||
"""DiffSync model for {{ cookiecutter.system_of_record }} devices.""" | ||
|
||
_model = Device | ||
_modelname = "device" | ||
_identifiers = ("name",) | ||
_attributes = ( | ||
"status__name", | ||
"role__name", | ||
"device_type__name", | ||
"location__name", | ||
"example_custom_field" | ||
) | ||
|
||
name: str | ||
status__name: Optional[str] = None | ||
role__name: Optional[str] = None | ||
device_type__name: Optional[str] = None | ||
location__name: Optional[str] = None | ||
ip_address: Optional[str] = None | ||
example_custom_field: Annotated[str, CustomFieldAnnotation(key="my_example_custom_field")] |
1 change: 0 additions & 1 deletion
1
...t/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/__init__.py
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
...-ssot/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/base.py
This file was deleted.
Oops, something went wrong.
60 changes: 0 additions & 60 deletions
60
...t/{{ cookiecutter.project_slug }}/{{ cookiecutter.app_name }}/diffsync/models/nautobot.py
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...}/{{ cookiecutter.app_name }}/diffsync/models/{{ cookiecutter.system_of_record_slug }}.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters