Closed ohthateverest closed 3 years ago
Please provide the complete API request that you're sending.
cURL output generated from Postman of the complete Request.
curl --location --request GET 'http://netbox-dev.contoso.com/api/dcim/interfaces/16380/' \
--header 'Authorization: Token fe83d4e3ca6296fb681e1b821278c22ab9e0de3e' \
--header 'Content-Type: application/json' \
--header 'Cookie: csrftoken=Nd5JxE3OHT0WjwyNRZovQFldz7gYRQqCdExkNFNlmJul9U01kNZ9kAOda6tsWRaN' \
--data-raw '{
"tags": [
{
"slug": "bgp"
},
{
"slug": "alcatel"
}
]
}'
curl --location --request GET
This is a GET request. You need to make a PATCH request.
Sorry posted the wrong example.
curl --location --request PATCH 'http://netbox-dev.contoso.com/api/dcim/interfaces/16380/' \
--header 'Authorization: Token fe83d4e3ca6296fb681e1b821278c22ab9e0de3e' \
--header 'Content-Type: application/json' \
--header 'Cookie: csrftoken=Nd5JxE3OHT0WjwyNRZovQFldz7gYRQqCdExkNFNlmJul9U01kNZ9kAOda6tsWRaN' \
--data-raw '{
"tags": [
{
"slug": "bgp"
},
{
"slug": "alcatel"
}
]
}'
Response is
{
"id": 16380,
"url": "http://netbox-dev.contoso.com/api/dcim/interfaces/16380/",
"device": {
"id": 845,
"url": "http://netbox-dev.contoso.com/api/dcim/devices/845/",
"name": "IPLVINEA18W-OOT-SAS-E-15",
"display_name": "IPLVINEA18W-OOT-SAS-E-15"
},
"name": "1/1/4",
"label": "",
"type": {
"value": "1000base-t",
"label": "1000BASE-T (1GE)"
},
"enabled": true,
"lag": null,
"mtu": null,
"mac_address": null,
"mgmt_only": false,
"description": "",
"connected_endpoint_type": null,
"connected_endpoint": null,
"connection_status": null,
"cable": null,
"mode": null,
"untagged_vlan": null,
"tagged_vlans": [],
"tags": [],
"count_ipaddresses": 0
}
I'm not able to reproduce this on v2.9.7
Trying it again and it works now, Gonna chalk this up to maybe something weird being cached. Sorry for chasing ghosts.
Environment
Steps to Reproduce
PATCH specifed interface with data below
Expected Behavior
Update interface to reflect selected tags. Example API Response after adding the tags via the WebUI.
Observed Behavior
No changes are made to the interface. A 200 OK is received and the response indicates no changes are made.