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

Custom device statuses fail to unmarshal, causing entire call to fail #179

Open
TomFletcher0 opened this issue Jul 2, 2024 · 2 comments

Comments

@TomFletcher0
Copy link

TomFletcher0 commented Jul 2, 2024

We have a custom device status, "Racked" set up using the normal method in Netbox (no code change required in Netbox), but then when I search (client.DcimAPI.DcimDevicesList(ctx)) for devices (with or without filters) the client throws error:

DcimDevicesList failed, racked is not a valid DeviceStatusValue

My workaround is to add the custom statuses to model_device_status_label.go & model_device_status_value.go, but this requires a fork and change to generated code.

It would be good even if it failed to unmarshal those particular devices with custom statuses, at least the rest of the devices from the search (those with supported statuses) could be returned.

@ljb2of3
Copy link

ljb2of3 commented Jul 31, 2024

I've also run into this. I have multiple custom statuses. This seems like a systemic problem since netbox allows custom choices for many different fields so this could happen with any number of fields, not just device status.

@faildruid
Copy link

Also experiencing this issue. It appears that the library cannot read values defined in FIELD_CHOICES config value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants