[pve-devel] [PATCH pve-network 2/5] api: add state standard option

Stefan Hanreich s.hanreich at proxmox.com
Fri Feb 28 15:01:33 CET 2025


GET calls on SDN entities with pending=1 show the state of the entity.
Define a common option for this, since it is the same across all SDN
entities. This will be used for improving the API documentation later
on.

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

diff --git a/src/PVE/Network/SDN.pm b/src/PVE/Network/SDN.pm
index 0f6754a..cedbfd8 100644
--- a/src/PVE/Network/SDN.pm
+++ b/src/PVE/Network/SDN.pm
@@ -52,6 +52,13 @@ PVE::Cluster::cfs_register_file(
     sub { my ($filename, $data) = @_; return $data; }
 );
 
+PVE::JSONSchema::register_standard_option('pve-sdn-config-state', {
+    type => 'string',
+    enum => ['new', 'changed', 'deleted'],
+    description => 'State of the SDN configuration object.',
+    optional => 1,
+});
+
 PVE::JSONSchema::register_standard_option('pve-sdn-lock-secret', {
     type => 'string',
     description => "the secret for unlocking the global SDN configuration",
-- 
2.39.5




More information about the pve-devel mailing list