{
"detail": "Not found."
}curl -X PUT -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{
"interface_a": "1250",
"interface_b": "2676",
"connection_status": "Connected"
}' \
'http://127.0.0.1:8001/api/dcim/interface-connections/212/?connection_status=Connected&device=40'curl -X GET -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" 'http://127.0.0.1:8001/api/dcim/interface-connections/1250/'
{
"id": 1250,
"device": {
"id": 40,
"url": "http://127.0.0.1:8001/api/dcim/devices/40/",
"name": "serv64.ix",
"display_name": "server1"
},
"name": "device1",
"form_factor": {
"label": "1000BASE-T (1GE)",
"value": 1000
},
"enabled": true,
"lag": null,
"mtu": null,
"mac_address": "02:4D:05:C1:F2:C9",
"mgmt_only": true,
"description": "",
"is_connected": false,
"interface_connection": null,
"circuit_termination": null
}
curl -X PUT -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{
"interface_a": 1250,
"interface_b": 2676,
"connection_status": "Connected"
}' \
'http://127.0.0.1:8001/api/dcim/interface-connections/212/?connection_status=Connected&device=40' "connection_status": {
"label": "Connected",
"value": true
}
So something like
curl -X PUT -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{
"interface_a": 1250,
"interface_b": 2676,
"connection_status": true
}' \
'http://127.0.0.1:8001/api/dcim/interface-connections/212/?connection_status=Connected&device=40'curl -X PUT -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{ "interface_a": 1250, "interface_b": 2676, "connection_status": true }' 'http://127.0.0.1:8001/api/dcim/interface-connections/212/?device=40'
{
"detail": "Not found."
}
"device=40" to the servername but I always get the same error "detail: not found"
Perhaps it has something todo with the fact, that I'm creating an new connetion with the ID "212" which I just made up? It's the next free ID, IDs 1-211 are already taken.
curl -X POST -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{ "interface_a": 1250, "interface_b": 2676, "connection_status": true }' 'http://127.0.0.1:8001/api/dcim/interface-connections/'
curl -X POST -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{ "interface_a": 1250, "interface_b": 2676, "connection_status": true }' 'http://127.0.0.1:8001/api/dcim/interface-connections/'
{
"interface_a": [
"This field is required."
],
"interface_b": [
"This field is required."
]
}
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/4f4b74e6-8e82-4fd8-8747-4fe94e5b58af%40googlegroups.com.--
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/cdCFML796LI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to netbox-discus...@googlegroups.com.
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token <token>" -H "Accept: application/json; indent=2" --data '{ "interface_a": 1250, "interface_b": 2676, "connection_status": true }' 'http://127.0.0.1:8001/api/dcim/interface-connections/'
{
"id": 213,