Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
empusas opened this issue Aug 25, 2023 · 0 comments · Fixed by #13561
Closed

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

empusas opened this issue Aug 25, 2023 · 0 comments · Fixed by #13561
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@empusas
Copy link

empusas commented Aug 25, 2023

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

@empusas empusas added the type: feature Introduction of new functionality to the application label Aug 25, 2023
@abhi1693 abhi1693 self-assigned this Aug 25, 2023
@abhi1693 abhi1693 added the status: accepted This issue has been accepted for implementation label Aug 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants