-
Hey there! I have a really simple question most likely, but I'm struggling to figure out the syntax to create cables using the API. In the examples given in the API docs, it mentions object_type, and object_id for the "a" and "b" terminations...but everything I try to put in those is not working. This is the part I'm talking about:
So lets say I have a port on my switch(interface) and a port on a panel(front-port) that I want to create a cable between. What would the above block look like if I wanted the "a" termination to be the switch interface port? Thanks in advance for any and all help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I do most of my stuff in Python, but what I usually do is create a dummy connection and perform a GET call on the particular endpoint via Swagger. {
"id": 2075,
"url": "https://netbox.netboxServer.com/api/dcim/cable-terminations/2075/",
"display": "Cable #1037 to test",
"cable": 1037,
"cable_end": "A",
"termination_type": "dcim.interface"} So "object_type" should be something similar to the sluggified version on the interface type (interface, front, console, ....), depending on Interface type it could be |
Beta Was this translation helpful? Give feedback.
I do most of my stuff in Python, but what I usually do is create a dummy connection and perform a GET call on the particular endpoint via Swagger.
Thus, a GET call of the cable path ID I created in the GUI, will give me the following output:
So "object_type" should be something similar to the sluggified version on the interface type (interface, front, console, ....), depending on Interface type it could be
"dcim.interface", "dcim.frontport", "dcim.console"
.