Why doesn't the Cable creation API support matching on objects like other parts of the API? #18648
deliciouslytyped
started this conversation in
General
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Why doesn't the Cable creation API support matching on objects like other parts of the API?
Parts of the API allow specifying objects by specifying a subset of attributes resulting in a unique object (I don't know offhand which part of the docs this is stated in), but creating cable (terminations) requires specifying the termination object type (for example 'dcim.interface') and an object id.
For example (I have some custom yaml processing code that basically maps this to
pynetbox nb.dcim.devices.create(...)
):Here
role
,device_type
,ite
, andrack
match an appropriate object.Creating cables doesn't seem to support this.
This makes user automation code more complicated and also requires doing a round-trip to first retrieve the IDs (which can also result in TOCTOU issues.)
Beta Was this translation helpful? Give feedback.
All reactions