summaryrefslogtreecommitdiff
path: root/src/PVE/API2/Network/SDN.pm
diff options
context:
space:
mode:
authorStefan Hanreich <s.hanreich@proxmox.com>2025-07-16 15:08:09 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2025-07-17 00:10:43 +0200
commit21d2ad3f7b6d37a8974127aabc07459ba5166b1f (patch)
tree55e11efab76c40284830ba222468f3fccea7ef6e /src/PVE/API2/Network/SDN.pm
parent4b7a87353497457ee8f8d4093259bad5703916c9 (diff)
api: fabrics: add root-level module
There is one endpoint (/all) at the top-level that fetches both types of fabric entities (fabrics & nodes) and lists them separately. This is used for the main view, in order to avoid having to do two API calls. It works analogous to the existing root-level SDN API calls with the running / pending parameters. Also, since the interfaces key is used in the node sections, we need to add it to the function encoding the values so they are compared and returned from the API properly, when the pending parameter is set. Co-authored-by: Gabriel Goller <g.goller@proxmox.com> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com> Link: https://lore.proxmox.com/20250716130837.585796-49-g.goller@proxmox.com
Diffstat (limited to 'src/PVE/API2/Network/SDN.pm')
-rw-r--r--src/PVE/API2/Network/SDN.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/PVE/API2/Network/SDN.pm b/src/PVE/API2/Network/SDN.pm
index 0824410..6645f28 100644
--- a/src/PVE/API2/Network/SDN.pm
+++ b/src/PVE/API2/Network/SDN.pm
@@ -17,6 +17,7 @@ use PVE::API2::Network::SDN::Vnets;
use PVE::API2::Network::SDN::Zones;
use PVE::API2::Network::SDN::Ipams;
use PVE::API2::Network::SDN::Dns;
+use PVE::API2::Network::SDN::Fabrics;
use base qw(PVE::RESTHandler);
@@ -46,6 +47,11 @@ __PACKAGE__->register_method({
});
__PACKAGE__->register_method({
+ subclass => "PVE::API2::Network::SDN::Fabrics",
+ path => 'fabrics',
+});
+
+__PACKAGE__->register_method({
name => 'index',
path => '',
method => 'GET',
@@ -76,6 +82,7 @@ __PACKAGE__->register_method({
{ id => 'controllers' },
{ id => 'ipams' },
{ id => 'dns' },
+ { id => 'fabrics' },
];
return $res;