mirror of
https://github.com/luthermonson/go-proxmox.git
synced 2026-04-26 09:25:53 +03:00
[PR #201] [MERGED] Add listing of network interfaces by type #210
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-proxmox#210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/luthermonson/go-proxmox/pull/201
Author: @andyjsmith
Created: 6/10/2025
Status: ✅ Merged
Merged: 6/14/2025
Merged by: @luthermonson
Base:
main← Head:main📝 Commits (5)
2c89d87add listing of networks by type5e5eebdchange NodeNetwork.Active to StringOrInt0ccf80fupdate NetworksOfType test to use string version of Active fieldeb7b4eeswitch network list filter to variadic arg on existing func232d049switch Networks func to use net/url📊 Changes
4 files changed (+69 additions, -10 deletions)
View changed files
📝
nodes_network.go(+15 -2)📝
nodes_network_test.go(+18 -0)📝
tests/mocks/pve8x/nodes.go(+28 -0)📝
types.go(+8 -8)📄 Description
See #200 for reasoning.
This PR adds a new function
NetworksOfTypeto enable listing of networks by a specific type. Requesting a specific type can return more results than just requesting all networks, so this allows you to query all types of networks.One caveat is that in
NodeNetwork, I needed to change theActivefield frominttoStringOrIntsince for some reason some of Proxmox's responses when specifying type are set to strings rather than ints. This may be a breaking change, although StringOrInt is an int under the hood so in most cases it should work as-is. Open to suggestions here.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
omitemptyandboolvalues conflicting with Proxmox API defaults #218