cant create vm mac-address via api #10638

Closed
opened 2025-12-29 21:33:59 +01:00 by adam · 0 comments
Owner

Originally created by @ITJamie on GitHub (Jan 9, 2025).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.2.1

Python Version

3.10

Steps to Reproduce

  1. create an interface on a vm
  2. attempt to use the api to create a mac address linked to the interface id (curl example from swagger)
curl -X 'POST' \
  'https://netbox.dev.domain/api/dcim/mac-addresses/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN:{removed}' \
  -d '{
  "mac_address": "BC:24:11:7E:0E:BF",
  "assigned_object_type": "virtualization.vminterface",
  "assigned_object_id": 1
}'

Expected Behavior

mac address gets created

Observed Behavior

400 response:

Error: Bad Request

Response body
Download
{
  "assigned_object_id": [
    "This field cannot be null."
  ]
}
Originally created by @ITJamie on GitHub (Jan 9, 2025). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.2.1 ### Python Version 3.10 ### Steps to Reproduce 1. create an interface on a vm 2. attempt to use the api to create a mac address linked to the interface id (curl example from swagger) ``` curl -X 'POST' \ 'https://netbox.dev.domain/api/dcim/mac-addresses/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'X-CSRFTOKEN:{removed}' \ -d '{ "mac_address": "BC:24:11:7E:0E:BF", "assigned_object_type": "virtualization.vminterface", "assigned_object_id": 1 }' ``` ### Expected Behavior mac address gets created ### Observed Behavior 400 response: ``` Error: Bad Request Response body Download { "assigned_object_id": [ "This field cannot be null." ] } ```
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:33:59 +01:00
adam closed this issue 2025-12-29 21:33:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10638