Inconsistent status field in API for virtual-device-context #13556
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
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
The text was updated successfully, but these errors were encountered: