⚡
FLASH SALE
— 30% OFF Yearly Network Automation Memberships! Use code
SALE30
at checkout. Offer ends August 20th.
➜ Sign up here
Training
Bootcamp
Courses
Tech Sessions
Resources
Blog
Tips
GitHub
YouTube
Newsletter
Playgrounds
Pricing
Sign In
Become Member
TTP Parser
Validate and test the parsing of your TTP templates
Tools
J2 Renderer
TTP Parser
TextFSM Parser
XPath Tester
Members Only
JMESPath Validator
JSON Schema Validator
Data Format Converter
TTP Template
"""Nautobot DiffSync Models for FortiManager SSOT.""" from typing import override from nautobot.ipam.models import IPAddress from nautobot_ssot_firewall_policies.diffsync.models.base import IPAddressDiffSyncModel class NautobotIPAddressDiffSyncModel(IPAddressDiffSyncModel): """Model to deal with Nautobot IP Addresses from the ipam.IPAddress Model.""" @classmethod @override def create(cls, adapter, ids, attrs): """Create IP Addresses in Nautobot.""" adapter.log.logger.debug("Creating IP Address: %s %s", ids, attrs) # Getting current objects Loaded into the Diffsync instances Nautobot ip_add_obj = IPAddress.objects.get( name=ids["host"], parent__namespace__name=ids["parent__namespace__name"], ) try: adapter.log.info("IP Add Obj: %", ip_add_obj) except Exception as ip_address_err: adapter.job.logger.debug("Could not create IP Address. Error: %s", ip_address_err) @override def update(self, attrs): self.adapter.job.logger.debug( "INFO: Entering udate method for IP: %s on Namespace: %s", self.host, self.parent__namespace__name ) self.adapter.job.logger.debug("INFO: Attributes used for update: %s", attrs) obj = self.get_from_db() if "description" in attrs: updated_description = attrs["description"] self.adapter.job.logger.debug( "DEBUG: Updating description from '%s' to '%s'", obj.description, updated_description ) obj.description = updated_description else: self.adapter.job.logger.debug( "DEBUG: 'description not in attrs for this update. No change from source" ) return super().update_base(attrs) @override def delete(self): return super().delete_base()
0
/ 20000
Raw Text
DLAM
0
/ 20000
Result
[ {} ]
Parse
Share
Auto-Sync