VM Status bug #2074

Closed
opened 2025-12-29 17:22:02 +01:00 by adam · 0 comments
Owner

Originally created by @FedorArbuzov on GitHub (Oct 22, 2018).

Hello! I recently started using api netbox and as it seems to me I found an error in the post method /virtualization/virtual-machines/.

Here api request and response:
url: api/virtualization/virtual-machines/
request body: { "name": "vm-3", "cluster": 1, "status" 2}

answer:
500 error

We have 500 error at the output, but it seems that the insertion into the database still happens. Because after this, all the get requests fall with a 500 error (KeyError: 2). I did a little analysis and found out that in the constant VM_STATUS_ CLASS you have a dictionary {0: 'warning', 1: 'success', 3: 'primary'}. It seems to me that this is the whole point.

Environment

Python version: 3.5.4
NetBox version: 2.4.3

Originally created by @FedorArbuzov on GitHub (Oct 22, 2018). Hello! I recently started using api netbox and as it seems to me I found an error in the post method /virtualization/virtual-machines/. Here api request and response: url: api/virtualization/virtual-machines/ request body: { "name": "vm-3", "cluster": 1, "status" 2} answer: 500 error We have 500 error at the output, but it seems that the insertion into the database still happens. Because after this, all the get requests fall with a 500 error (KeyError: 2). I did a little analysis and found out that in the constant VM_STATUS_ CLASS you have a dictionary {0: 'warning', 1: 'success', 3: 'primary'}. It seems to me that this is the whole point. Environment Python version: 3.5.4 NetBox version: 2.4.3
adam closed this issue 2025-12-29 17:22:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2074