Skip to content

🐛 Fix Prefix Bulk Update#29

Open
keshy7 wants to merge 1 commit into
fbreckle:masterfrom
keshy7:PrefixBulkUpdateFix
Open

🐛 Fix Prefix Bulk Update#29
keshy7 wants to merge 1 commit into
fbreckle:masterfrom
keshy7:PrefixBulkUpdateFix

Conversation

@keshy7

@keshy7 keshy7 commented May 12, 2023

Copy link
Copy Markdown

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

keshy7 commented May 12, 2023

Copy link
Copy Markdown
Author

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