Inconsistent status field in API for virtual-device-context #8513

Closed
opened 2025-12-29 20:37:38 +01:00 by adam · 0 comments
Owner

Originally created by @empusas on GitHub (Aug 25, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.5.8

Feature type

Change to existing functionality

Proposed functionality

When using the API or pynetbox module the status for a virtual-device-context is different from the response for a device or virtual-machine.
This lead to parsing errors and requires different parsing of status fields for a vdc.

For example in pynetbox working with a device or virtual-machine
item.status will give back "Active"
item.status.label will give back "Active"
item.status.value will give back "active"

API Response for a device or virtual-machine looks like this:
"status": {
"value": "active",
"label": "Active"
},

For a virtual-device-context there are not value an label fields
item.status will give back "active"

API Response for a device or virtual-device-context looks like this:
"status": "active",

Simple solution is to use str(item.status).lower()

Use case

It would improve the overall consistency of the API to align the status field for a VDC with the status fields for other objects.

Database changes

no

External dependencies

no

Originally created by @empusas on GitHub (Aug 25, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.5.8 ### Feature type Change to existing functionality ### Proposed functionality When using the API or pynetbox module the status for a virtual-device-context is different from the response for a device or virtual-machine. This lead to parsing errors and requires different parsing of status fields for a vdc. For example in pynetbox working with a device or virtual-machine item.status will give back "Active" item.status.label will give back "Active" item.status.value will give back "active" API Response for a device or virtual-machine looks like this: "status": { "value": "active", "label": "Active" }, For a virtual-device-context there are not value an label fields item.status will give back "active" API Response for a device or virtual-device-context looks like this: "status": "active", Simple solution is to use str(item.status).lower() ### Use case It would improve the overall consistency of the API to align the status field for a VDC with the status fields for other objects. ### Database changes no ### External dependencies no
adam added the status: acceptedtype: feature labels 2025-12-29 20:37:38 +01:00
adam closed this issue 2025-12-29 20:37:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8513