Mac address backward compatibility #10795

Closed
opened 2025-12-29 21:36:01 +01:00 by adam · 2 comments
Owner

Originally created by @ninabel on GitHub (Feb 22, 2025).

Maybe you know, that some versions ago mac_address was just a string field. So you could create an interface with mac address with one API query. Now it's impossible. You have to create an interface, after that create a mac address for that interface and only late set that mac address as primary. Three posts instead of one.

Deployment Type

Self-hosted

NetBox Version

v4.2.2

Python Version

3.10

Steps to Reproduce

curl -X 'POST'
'NETBOX_URL'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-H 'X-CSRFTOKEN: TOKEN'
-d '{
"device": {
"name": "NAME"
},
"type": "100base-tx",
"name": "Lan2",
"mac_address": "#########"
}'

Expected Behavior

{
"id": ##,
"url": "https://nbtest.sg01.com/api/dcim/interfaces/##/",
...
"mac_address": "#########",
"primary_mac_address": {
"id": ###,
"url": "https://nb.sg01.com/api/dcim/mac-addresses/###/",
"display": "#########",
"mac_address": "#########",
"description": ""
},
"mac_addresses": [
{
"id": ###,
"url": "https://nb.sg01.com/api/dcim/mac-addresses/###/",
"display": "#########",
"mac_address": "#########",
"description": ""
}
],
...
}

Observed Behavior

{
"id": ##,
"url": "https://nbtest.sg01.com/api/dcim/interfaces/##/",
...
"mac_address": null,
...
}

Originally created by @ninabel on GitHub (Feb 22, 2025). Maybe you know, that some versions ago mac_address was just a string field. So you could create an interface with mac address with one API query. Now it's impossible. You have to create an interface, after that create a mac address for that interface and only late set that mac address as primary. Three posts instead of one. ### Deployment Type Self-hosted ### NetBox Version v4.2.2 ### Python Version 3.10 ### Steps to Reproduce curl -X 'POST' \ 'NETBOX_URL' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'X-CSRFTOKEN: TOKEN' \ -d '{ "device": { "name": "NAME" }, "type": "100base-tx", "name": "Lan2", "mac_address": "#########" }' ### Expected Behavior { "id": ##, "url": "https://nbtest.sg01.com/api/dcim/interfaces/##/", ... "mac_address": "#########", "primary_mac_address": { "id": ###, "url": "https://nb.sg01.com/api/dcim/mac-addresses/###/", "display": "#########", "mac_address": "#########", "description": "" }, "mac_addresses": [ { "id": ###, "url": "https://nb.sg01.com/api/dcim/mac-addresses/###/", "display": "#########", "mac_address": "#########", "description": "" } ], ... } ### Observed Behavior { "id": ##, "url": "https://nbtest.sg01.com/api/dcim/interfaces/##/", ... "mac_address": null, ... }
adam closed this issue 2025-12-29 21:36:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 24, 2025):

Closing this out as no context has been provided. If you'd like to invest more effort in your bug report, please first rewrite it to provide meaningful context, and then request that it be re-evaluated.

@jeremystretch commented on GitHub (Feb 24, 2025): Closing this out as no context has been provided. If you'd like to invest more effort in your bug report, please first rewrite it to provide meaningful context, and then request that it be re-evaluated.
Author
Owner

@ninabel commented on GitHub (Feb 25, 2025):

@jeremystretch I've add information, please reopen the bug.

@ninabel commented on GitHub (Feb 25, 2025): @jeremystretch I've add information, please reopen the bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10795