Autorized 0U device creation from API #6874

Closed
opened 2025-12-29 19:46:16 +01:00 by adam · 0 comments
Owner

Originally created by @Pelt10 on GitHub (Aug 25, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.0

Python version

3.10

Steps to Reproduce

  1. Create Manufacturer "Test"
  2. Try creating 0U device from API, command:
curl -X 'POST' \
  'http://127.0.0.1:8000/api/dcim/device-types/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  -d '{
  "manufacturer": 1,
  "model": "test",
  "slug": "test",
  "u_height": 0
}'

Expected Behavior

Creation of device "test" with 0U height like in interface.

It's seems to come from 6c686af1b7/netbox/dcim/api/serializers.py (L313)

Observed Behavior

{"u_height":["Ensure this value is greater than or equal to 0.5."]}%

Originally created by @Pelt10 on GitHub (Aug 25, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.0 ### Python version 3.10 ### Steps to Reproduce 1. Create Manufacturer "Test" 2. Try creating 0U device from API, command: ``` curl -X 'POST' \ 'http://127.0.0.1:8000/api/dcim/device-types/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ --header 'Authorization: Token <token>' \ -d '{ "manufacturer": 1, "model": "test", "slug": "test", "u_height": 0 }' ``` ### Expected Behavior Creation of device "test" with 0U height like in interface. It's seems to come from https://github.com/netbox-community/netbox/blob/6c686af1b70acdc56a8fdbe84451f7012e2b4197/netbox/dcim/api/serializers.py#L313 ### Observed Behavior {"u_height":["Ensure this value is greater than or equal to 0.5."]}%
adam added the type: bugstatus: accepted labels 2025-12-29 19:46:16 +01:00
adam closed this issue 2025-12-29 19:46:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6874