[pve-devel] [PATCH pve-network 6/9] api: nodes: fabrics: add endpoint for querying interface status

Stefan Hanreich s.hanreich at proxmox.com
Thu Oct 30 16:48:31 CET 2025


This endpoint returns the state of interfaces that are part of the
fabric. For more information on the returned values, consult the
proxmox-perl-rs commit. It is used by the NetworkBrowser panel.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 src/PVE/API2/Network/SDN/Nodes/Fabric.pm | 47 ++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/src/PVE/API2/Network/SDN/Nodes/Fabric.pm b/src/PVE/API2/Network/SDN/Nodes/Fabric.pm
index b5971c7..90ea5e4 100644
--- a/src/PVE/API2/Network/SDN/Nodes/Fabric.pm
+++ b/src/PVE/API2/Network/SDN/Nodes/Fabric.pm
@@ -138,3 +138,50 @@ __PACKAGE__->register_method({
     },
 });
 
+__PACKAGE__->register_method({
+    name => 'interfaces',
+    path => 'interfaces',
+    method => 'GET',
+    description => "Get neighbors of all fabrics.",
+    protected => 1,
+    permissions => {
+        check => ['perm', '/sdn/fabrics/{fabric}', ['SDN.Audit']],
+    },
+    proxyto => 'node',
+    parameters => {
+        additionalProperties => 0,
+        properties => {
+            node => get_standard_option('pve-node'),
+            fabric => get_standard_option('pve-sdn-fabric-id'),
+        },
+    },
+    returns => {
+        type => 'array',
+        items => {
+            type => "object",
+            properties => {
+                name => {
+                    description => "The name of the network interface.",
+                    type => 'string',
+                },
+                type => {
+                    description =>
+                        "The type of this interface in the fabric (e.g. Point-to-Point, Broadcast, ..).",
+                    type => 'string',
+                },
+                state => {
+                    description => "The current state of the interface.",
+                    type => 'string',
+                },
+            },
+        },
+    },
+    code => sub {
+        my ($param) = @_;
+
+        my $fabric_id = extract_param($param, 'fabric');
+        return PVE::RS::SDN::Fabrics::interfaces($fabric_id);
+    },
+});
+
+1;
-- 
2.47.3




More information about the pve-devel mailing list