RTNL objects in NDB can exist in several states:
invalid: The object does not exist in the system.system: The object exists both in the system and in NDB.setns: The existing object should be moved to another network namespace.remove: The existing object must be deleted from the system.
State transitions are recorded in the object's state.events list, providing timestamps that can be correlated with NDB logs and RTNL event logs.
from pyroute2 import NDB
ndb = NDB()
# Create an interface and commit the change
c = ndb.interfaces.create(ifname='t0', kind='dummy').commit()
# Inspect the state transition history
print(c.state.events)
# Example output: [(1557752212.6703758, 'invalid'), (1557752212.6821117, 'system')]