-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slurpit Support #601
Closed
Closed
Slurpit Support #601
Changes from 8 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
b3e7e89
Nautobot SSoT: Slurpit
lpconsulting321 cef8aae
Update test
lpconsulting321 c4f814d
small improvements on testing
lpconsulting321 c54a4fd
Add poetry configuration
lpconsulting321 4c2fbe7
Add changelog
lpconsulting321 ecd2c79
Fix ruff formatting
lpconsulting321 7f1bfd2
fixes: codeowners
lpconsulting321 9cca34e
Fix pylint issues
lpconsulting321 ff61a14
Fix unit test
lpconsulting321 5090947
Add locationtype during test setup
lpconsulting321 b11e876
Fix pylint issue
lpconsulting321 c56fd40
Fix 3.8 issues
lpconsulting321 9c0cd28
update readme
lpconsulting321 935c8a1
Add typed dicts
Renrut5 b51427a
Add changelog
Renrut5 e874fc5
update docs
Renrut5 03d43e7
fix errors
Renrut5 f8beda4
fix: 🐛 Fixed missing hostname_mapping functionality in DNA Center int…
jdrew82 8a99d78
refactor: 🔥 Removed use of OS Version CustomField as it is now covere…
jdrew82 a32b1ea
feat: ✨ Added support for Software Version model in Nautobot 2.2.
jdrew82 c3f58fa
fix: 🐛 Add SoftwareImageFile creation and association to DeviceType t…
jdrew82 e9f9f4e
docs: 📝 Update Job form screenshot
jdrew82 d9473a9
refactor: ♻️ Redo code for hostname_map to make it unique
jdrew82 9aea0bb
test: ✅ Fix tests to address changes in DNAC integration
jdrew82 c6364fc
test: 🚨 Disable warning from pylint
jdrew82 141308c
refactor: ♻️ Move Meraki skip to happen earlier so it's not in failed…
jdrew82 b2eef1e
refactor: ♻️ Rename var per comment on PR
jdrew82 03af999
fix: 🐛 Ensure that Global isn't a parent if the setting is False.
jdrew82 df8620b
refactor: ♻️ Tweak Meraki detection using errorDescription in case it…
jdrew82 f85be3b
test: 🐛 Correct fixture parent value to Global.
jdrew82 0576a11
refactor: ♻️ Redo loading of areas to be done through loading of Buil…
jdrew82 5f3d8a6
fix: 🐛 Update area attribute on Building model to be Optional.
jdrew82 378e3a8
test: ✅ Update load_area/buildings tests to account for refactor.
jdrew82 40ead83
test: ✅ Add tests to validate handling of loading areas and buildings…
jdrew82 27812e1
fix: 🐛 Add a check that the data being used to update area_parent is …
jdrew82 37802cb
fix: 🐛 Change how area_parent is updated to check if building name is…
jdrew82 3169243
test: ✅ Add a test validating using location_map when you have buildi…
jdrew82 8d24c01
perf: 🧑💻 Move some warning log statements behind debug toggle.
jdrew82 5f2bf85
fix: 🐛 Add check that Area parent is defined before trying to assign.
jdrew82 794fa5e
fix: 🐛 Add mask_length update to IPAddress.update()
jdrew82 44ecac7
feat: ✨ Add PrefixLocation DiffSyncModel to track location assignment…
jdrew82 924ab7d
fix: 🐛 Correct check when using location_map to use network name.
jdrew82 5cfd10a
feat: ✨ Add ability to rename network if name key found in location_m…
jdrew82 f83c54c
feat: ✨ Add ability to rename Building in DNA Center with location_map.
jdrew82 093ac0f
test: ✅ Update Prefix model tests to remove use of Location as it's n…
jdrew82 5d70041
fix: 🐛 Ensure name key is used.
jdrew82 cbe8b49
fix: 🐛 Fix name of Building if found in location_map and only load Fl…
jdrew82 6b395a6
docs: 📝 Update docs for job var.
jdrew82 55184c6
test: ✅ Fix tests for load_floors()
jdrew82 de74c81
fix: 🐛 Correct bug where wrong building name was used due to overwrite.
jdrew82 b0f94a2
fix: 🐛 Fix Nautobot loading wrong Location names for site and floor.
jdrew82 a68e474
build: 👷 Add missing code owners for DNAC, Meraki, and Itential integ…
jdrew82 5524bbf
docs: 📝 Add changelog fragment
jdrew82 a2a0f92
fix: 🐛 Add check for port existing in uplink_settings before loading …
jdrew82 23ca2f8
fix: 🐛 Fix creation of PrefixLocationAssignment in Meraki.
jdrew82 057ff8d
fix: 🐛 Correct PrefixLocationAssignment to use location as site_map h…
jdrew82 1d6524d
fix: 🐛 Change check for location attribute to be done only if locatio…
jdrew82 bec846c
fix: 🐛 Fix bug in Bootstrap integration from loading ValidatedSoftwar…
jdrew82 3434ca6
refactor: ♻️ Refactor load_validated_software to not grab SoftwareLCM…
jdrew82 e904830
fix: 🐛 Check for device_platform attribute on Software and resort to …
jdrew82 680471a
fix: 🐛 Change getattr to hasattr
jdrew82 a68a88f
fix: 🐛 Correct identifiers for validated_software
jdrew82 96dcb26
fix: 🐛 Catch DoesNotExist thrown when attempting to find ContentType …
jdrew82 7e97a91
feat: ✨ Added support for SoftwareVersion to Bootstrap integration.
jdrew82 c85d56e
fix: 🐛 Correct logging var
jdrew82 64bd33a
revert: ⏪️ Restore checks around DLM classes
jdrew82 01f457d
fix: 🐛 Fix the imports for models to use apps instead of direct impor…
jdrew82 a320a49
fix conflicts
lpconsulting321 e284aa0
feat: ✨ Add default settings to project and update dev environment.
jdrew82 f49039b
refactor: ♻️ Extract parse_hostname_for_role function to SSoT utils t…
jdrew82 c26981c
fix: 🐛 Add try/except block around import for Controller and CMDG
jdrew82 db5be5f
fix: 🐛 Update DiffSyncFlags on DNAC integration to disable logging un…
jdrew82 a019815
feat: ✨ Add Citrix ADM integration
jdrew82 8c5470b
test: ✅ Add tests for CItrix ADM integration.
jdrew82 dbbee53
fix: 🐛 Fix missing ContentType bug in use of create_or_update_custom_…
jdrew82 4869887
docs: 📝 Add documentation for Citrix ADM integration.
jdrew82 caaa2ab
build:
jdrew82 fa136be
test: ✅ Adjust tests for migration to SSoT project
jdrew82 fb64b18
feat: ✨ Add additional information to Job like Citrix logo and Data m…
jdrew82 0b51b9c
test: 🚨 Ignore pylint warning
jdrew82 8db8904
test: 🚨 Address complaints from pylint
jdrew82 1b95773
docs: 📝 Add changelog fragment bout parse_hostname_for_role() change.
jdrew82 b7cdb0c
conflict
lpconsulting321 cb113de
Fix infite loop when resolving location parents.
progala 7ab20d7
Replace region reference with parent.
progala 0703fb0
Disable unused job flag.
progala b599951
Implement SNOW SSOT 'delete_records' flag.
progala 71be453
Add change fragments.
progala c05d3ac
Fix linting error.
progala 8df8d9e
docs: 📝 Add missing acknowledgements
jdrew82 7e2e394
build: Add code owner for Citrix integration
jdrew82 bb3b229
docs: 📝 Add changelog snippets
jdrew82 06a33cc
fix: 🐛 Fix hostname_mapping option in Citrix ADM integration.
jdrew82 f37f299
refactor: ♻️ Remove duplicate parse_hostname_for_role() in Meraki int…
jdrew82 fd71fdc
docs: 📝 Add changelog snippets
jdrew82 8782719
fix: 🐛 Correct default to be a list.
jdrew82 dde0c13
conflict
lpconsulting321 6a9f874
update lock
lpconsulting321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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 @@ | ||
Added integration with Slurpit. |
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
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
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
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
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,34 @@ | ||
# Slurpit Integration Setup | ||
|
||
This guide will walk you through steps to set up Slurpit integration with the `nautobot_ssot` app. | ||
|
||
## Prerequisites | ||
|
||
Before configuring the integration, please ensure, that `nautobot-ssot` app was [installed with Slurpit integration extra dependencies](../install.md#install-guide). | ||
|
||
```shell | ||
pip install nautobot-ssot[slurpit] | ||
``` | ||
|
||
## Configuration | ||
|
||
Access to your Slurpit instance is defined using the [ExternalIntegration](https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-functionality/externalintegration/) model which allows you to utilize this integration with multiple instances concurrently. Each ExternalIntegration must specify a SecretsGroup that contains Secrets that contain the Slurpit token to authenticate against that instance. You can find Secrets and SecretsGroups available under the Secrets menu. | ||
|
||
![Slurpit Token](../../images/slurpit_token.png) | ||
|
||
![Slurpit SecretsGroup](../../images/slurpit_secretsgroup.png) | ||
|
||
Please note that is it imperative for the SecretsGroup used for Slurpit uses HTTP(S) Access type and Token. Also note that the name of the Secrets or SecretsGroup are irrelevant but are recommended to be relevant to the Slurpit instance in question. | ||
|
||
Once the SecretsGroup is created you'll need to create the ExternalIntegration. You'll find this under the Extensibility menu. | ||
|
||
![Slurpit ExternalIntegration](../../images/slurpit_externalintegration.png) | ||
|
||
Below is an example snippet from `nautobot_config.py` that demonstrates how to enable and configure the Slurpit integration: | ||
|
||
```python | ||
PLUGINS_CONFIG = { | ||
"nautobot_ssot": { | ||
"enable_slurpit": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_SLURPIT")), | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,31 @@ | ||
# Slurpit SSoT Integration | ||
|
||
This integration provides a simple way to synchronize data between [Slurpit](https://slurpit.io/) and [Nautobot](https://github.com/nautobot/nautobot). It support multiple data types, including Devices, Interfaces, and IP Addresses. | ||
|
||
It synchronizes the following objects: | ||
|
||
| Slurpit | Nautobot | | ||
| ----------------------- | ---------------------------- | | ||
| Sites | Location | | ||
| Devices | Manufacturer | | ||
| Devices | Platform | | ||
| Devices | Device Type | | ||
| Devices | Device | | ||
| Planning (Hardware Info) | Inventory Item | | ||
| Planning (VLANs) | VLAN | | ||
| Planning (Routing Table) | VRF | | ||
| Planning (Routing Table) | Prefixe | | ||
| Planning (Interfaces) | Interface | | ||
| Planning (Interfaces) | IP Address | | ||
|
||
## Usage | ||
|
||
Once the integration is installed and configured, from the Nautobot SSoT dashboard view (`/plugins/ssot/`), Slurpit will be shown as a Data Source. You can click the **Sync** button to access a form view from which you can run the Slurpit-to-Nautobot synchronization Job. Running the job will redirect you to a Nautobot **Job Result** view, from which you can access the **SSoT Sync Details** view to see detailed information about the outcome of the sync Job. | ||
|
||
## Screenshots | ||
|
||
![Detail View](../../images/slurpit-detail-view.png) | ||
|
||
--- | ||
|
||
![Results View](../../images/slurpit-result-view.png) |
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
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
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 @@ | ||
"""Slurpit SSoT.""" |
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,11 @@ | ||
"""Constants used by Slurpit Integration.""" | ||
|
||
from django.conf import settings | ||
|
||
CONFIG = settings.PLUGINS_CONFIG.get("nautobot_ssot", {}) | ||
|
||
# Required Settings | ||
DEFAULT_DEVICE_ROLE = CONFIG.get("slurpit_default_device_role", "Network Device") | ||
DEFAULT_DEVICE_ROLE_COLOR = CONFIG.get("slurpit_default_device_role_color", "ff0000") | ||
DEFAULT_DEVICE_STATUS = CONFIG.get("slurpit_default_device_status", "Active") | ||
DEFAULT_DEVICE_STATUS_COLOR = CONFIG.get("slurpit_default_device_status_color", "ff0000") |
Empty file.
Empty file.
59 changes: 59 additions & 0 deletions
59
nautobot_ssot/integrations/slurpit/diffsync/adapters/nautobot.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,59 @@ | ||
# pylint: disable=R0801 | ||
"""DiffSync adapter for Nautobot.""" | ||
|
||
from nautobot_ssot.contrib import NautobotAdapter | ||
from nautobot_ssot.integrations.slurpit.diffsync.models import ( | ||
DeviceModel, | ||
DeviceTypeModel, | ||
InterfaceModel, | ||
InventoryItemModel, | ||
IPAddressModel, | ||
LocationModel, | ||
ManufacturerModel, | ||
PlatformModel, | ||
PrefixModel, | ||
RoleModel, | ||
VLANModel, | ||
VRFModel, | ||
) | ||
|
||
|
||
class NautobotDiffSyncAdapter(NautobotAdapter): | ||
"""DiffSync adapter for Nautobot.""" | ||
|
||
def __init__(self, *args, job, sync=None, data=None, **kwargs): | ||
"""Initialize the NautobotDiffSyncAdapter.""" | ||
self.data = data if data is not None else {} | ||
super().__init__(*args, job=job, sync=sync, **kwargs) | ||
|
||
def _load_objects(self, diffsync_model): | ||
"""Given a diffsync model class, load a list of models from the database and return them.""" | ||
parameter_names = self._get_parameter_names(diffsync_model) | ||
for database_object in diffsync_model._get_queryset(data=self.data): # pylint: disable=W0212 | ||
self._load_single_object(database_object, diffsync_model, parameter_names) | ||
|
||
location = LocationModel | ||
manufacturer = ManufacturerModel | ||
device_type = DeviceTypeModel | ||
platform = PlatformModel | ||
role = RoleModel | ||
device = DeviceModel | ||
interface = InterfaceModel | ||
inventory_item = InventoryItemModel | ||
vlan = VLANModel | ||
vrf = VRFModel | ||
prefix = PrefixModel | ||
ipaddress = IPAddressModel | ||
top_level = ( | ||
"location", | ||
"manufacturer", | ||
"device_type", | ||
"platform", | ||
"role", | ||
"device", | ||
"vlan", | ||
"vrf", | ||
"prefix", | ||
"ipaddress", | ||
"interface", | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be False.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpconsulting321 That is most likely being caused due to your integration being enabled. Making this change should resolve the issue. Itential is the only integration that's left enabled for now as it has tests of the integration's Job that requires the integration be installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3