Skip to content

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

@empusas

Description

@empusas

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

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions