Replies: 1 comment
-
I figured it out. For some reason the snapshot doesn't work, but that doesn't bother me much. the iface = Interface.objects.get(device_id=dev.id, name=data['primary_nic'].name)
ipaddr = IPAddress(address = data['primary_ip'])
ipaddr.full_clean()
ipaddr.save()
iface.snapshot()
iface.ip_addresses.set([ipaddr]) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write a custom script that creates a new IP Address and attaches to an existing Interface. Testing in nbshell, I can't figure out the right syntax. I thought it should be like this:
A similar POST to /api/ipam/ip-addresses/ works fine with this payload:
I also tried
assigned_object_type=Interface
and that gave the same error. How is this supposed to be used?Beta Was this translation helpful? Give feedback.
All reactions