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

🐛 Fix Prefix Bulk Update #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

keshy7
Copy link

@keshy7 keshy7 commented May 12, 2023

Background

Currently, IpamPrefixesBulkUpdate() endpoint accepts single WritablePrefix object as input data. When this is used to update a prefix, Netbox returns the following error:

[PUT /ipam/prefixes/][400] ipam_prefixes_bulk_update default  map[non_field_errors:[Expected a list of items but got type "dict".]]

Also, because it only accepts single WritablePrefix object, there is no way to bulk update using this endpoint.

Fix

Replace IpamPrefixesBulkUpdate()'s input parameter to accept array of WritablePrefix. Also update its 200 response to return array of Prefixes.

Background:
Currently, IpamPrefixesBulkUpdate() endpoint accepts single
WritablePrefix object as input data. When this is used to update a
prefix, Netbox returns the following error:
[PUT /ipam/prefixes/][400] ipam_prefixes_bulk_update default  map[non_field_errors:[Expected a list of items but got type "dict".]]

Also, because it only accepts single WritablePrefix object, there is no
way to bulk update using this endpoint.

Fix:
Replace IpamPrefixesBulkUpdate()'s input parameter to accept array of
WritablePrefix. Also update its 200 response to return array of
Prefixes.
@keshy7
Copy link
Author

keshy7 commented May 12, 2023

This issue also occurs for other bulk endpoints such as get, post, patch, and delete. If this PR is approved, another set of PR's can be submitted for these endpoints.

Thank you for your kind guidance and review!

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

Successfully merging this pull request may close these issues.

1 participant