Find a file
Stefan Hanreich f5a439d194 ipam: netbox: factor out common api methods and unify error handling
Create a helper method that abstracts the common code used in making
netbox requests. Move all api_request incovations over to using the
helper method. This saves us from writing lots of repeated code.

This also updates the helpers and introduces error checking there.
Helpers didn't catch any errors and the invoking methods didn't as
well. This meant that functions with $noerr set to 1 would still error
out. We now pass $noerr to the helper functions and they behave the
same as the parent methods. This requires some additional checks in
the call sites of the helpers.

Also canonicalize all URLs, since Netbox does that and it saves us a
redirect.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Link: https://lore.proxmox.com/20250310085103.30549-1-s.hanreich@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 17:43:31 +02:00
debian d/control: break the circular build-dependency with pve-firewall, and more 2025-04-07 12:47:23 +02:00
src ipam: netbox: factor out common api methods and unify error handling 2025-04-07 17:43:31 +02:00
.gitignore gitignore: build artifacts from sbuild 2024-04-04 16:50:08 +02:00
Makefile split into implementation and API endpoint packages 2024-11-18 18:17:20 +01:00