How do I delete a netbox entry when I remove the service from a device?
I have a python-and-template service which simply creates a loopback interface on a device. The IP-Address for the Loopback-Interface is taken from an IP-Address-Pool on netbox. So when I apply the service to a device, a new entry in the netbox database is created. But when I remove the service from the device with the 'no'-command, the entry in netbox is (of course) not deleted, which means the IP-Address is still shown as if it would've been in use. I do all of this in the cb_create method in the python script with the help of pynetbox, but is there a similar method like cb_delete for example when a service gets removed from a device? Because if there were such a method, it would be really easy then, because then I just could post my code for the removal of the netbox entry there.
So is there a way to automatically remove the netbox entry for when the service gets removed from the device? What I want to accomplish is basically the reverse of what I do in the cb_create method. There I reserve an IP-Address in netbox when a service is deployed, and when I remove that service I want to free that IP-Address again.
Any help would be greatly appreciated, best regards,
In a brownfield environment at some point you need to do service reconciliation. I wonder how this would be possible with such a allocation service. Do you think it might be possible to pass the current ID to the allocation service? Only in the event there is no current ID it should allocate one.
Learning NSO hasn't been easier!
Although navigating the offerings may need some guidance.
You basically have two options, one instructor-led and one self-paced using free resources on DevNet. We of course recommend using both options.
Live Event & Video On-Demand
Individual Live Sessions
Telstra Network Transformation with AutomationRoss Manariti, Technical Product Owner - Resource Domain & Element Management, Telstra
Customer services across thousands of network a...
If you are an NSO user, you are probably aware that when you write and read data from any of the NSO northbound interface agents, such as NETCONF, RESTCONF, CLI, MAAPI, etc., those agents are going through the NSO transaction manager before reaching the C...
NSO Developer Days is an opportunity for both new and experienced customers to come together and network, share best practices, meet engineering and learn more about what is coming next for NSO. Join service provider and enterprise network automation pro...
I have a simple service to configure an IP under loopback interface, but how do I delete the IP, if the one I am going to configure is pre-existing on another interface or at least give a warning that this IP is already in use?
Here is m...