Closed HarishankarYellapragada closed 1 year ago
>>> nic = netbox.dcim.interfaces.get(device="Test", name="eth0")
>>> print(nic)
eth0
>>> print(nic.mac_address)
None
>>> nic.mac_address = "11:22:33:44:55:66"
>>> nic.save()
True
>>> nic = netbox.dcim.interfaces.get(device="Test", name="eth0")
>>> print(nic.mac_address)
11:22:33:44:55:66
>>>
Worked like a charm @markkuleinio
I am sharing an example below with an error while updating mac_address.
Interface Nic 1 is an existing interface without any mac address. id used is interface id.
output
Looking forward to fixing the mistake in my script