pynautobot
pynautobot copied to clipboard
Add notes support for all models that support notes
Improve notes support
Current State
API does not have a "notes" attr in the return payload and only returns "notes_url" as a link to a list view for all notes that apply to the current instance.
Proposal
Provide ".notes" on any model that provides notes and the attribute would be an pynautobot.core.endpoint.Endpoint
to allow for create update and delete operations scoped to just the current model instance
Example desired outcome
dev = py_nb.dcim.devices.get(name="foo")
count(dev.notes.all()) # return N notes created on a device named foo
note = dev.notes.create(note="bar")
note.note="baz"
note.save()
count(dev.notes.all()) # return being N+1 of previous count