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

feat: OBS-420 - allow retrieving object state by additional attributes #58

Conversation

Julio-Oliveira-Encora
Copy link
Contributor

No description provided.

Copy link

linear bot commented Apr 3, 2024

OBS-420 Allow retrieving object state by additional attributes

At the moment GET /api/plugins/diode/object-state/ endpoint for the NetBox diode plugin perform filtering by object type and either ID or query, i.e. GET /api/plugins/diode/object-state/?object_type=dcim.devicetype&q=ISR4321 and it returns first result. The problem is that NetBox has object types with nested objects, allowing to create i.e. device type ISR4321 for different manufacturers, but we're not able to retrieve such device type and it's manufacturer.

If possible, please expand ObjectStateView by adding support for optional params attr_name and attr_value and use in the filter query. Example:

  • object_type=dcim.devicetype
  • q=ISR4321
  • attr_name=manufacturer
  • attr_value=Cisco

Copy link
Member

@mfiedorowicz mfiedorowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, thanks! 🚀

@mfiedorowicz mfiedorowicz merged commit 1d4e5ed into develop Apr 4, 2024
14 checks passed
@mfiedorowicz mfiedorowicz deleted the obs-420-allow-retrieving-object-state-by-additional-attributes branch April 4, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants