[pve-devel] [PATCH pve-firewall] api: rules: add descriptions to fields in rule return type

Hannes Laimer h.laimer at proxmox.com
Thu Oct 23 16:15:46 CEST 2025


This change would make also sense on its own, but adding this
specifically because we need a description to be present for
the rust code generation.

Fixes: b8d021291 ("api: rules: add return type to list_rules endpoint")
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 src/PVE/API2/Firewall/Rules.pm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/PVE/API2/Firewall/Rules.pm b/src/PVE/API2/Firewall/Rules.pm
index baed539..785ad05 100644
--- a/src/PVE/API2/Firewall/Rules.pm
+++ b/src/PVE/API2/Firewall/Rules.pm
@@ -21,21 +21,26 @@ my $api_properties = {
 
 my $rule_return_properties = {
     action => {
+        description => "Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name",
         type => 'string',
     },
     comment => {
+        description => 'Descriptive comment',
         type => 'string',
         optional => 1,
     },
     dest => {
+        description => 'Restrict packet destination address',
         type => 'string',
         optional => 1,
     },
     dport => {
+        description => 'Restrict TCP/UDP destination port',
         type => 'string',
         optional => 1,
     },
     enable => {
+        description => 'Flag to enable/disable a rule',
         type => 'integer',
         optional => 1,
     },
@@ -46,37 +51,50 @@ my $rule_return_properties = {
         },
     ),
     'icmp-type' => {
+        description =>
+            "Specify icmp-type. Only valid if proto equals 'icmp' or 'icmpv6'/'ipv6-icmp'",
         type => 'string',
         optional => 1,
     },
     iface => {
+        description =>
+            'Network interface name. You have to use network configuration key names for VMs and containers',
         type => 'string',
         optional => 1,
     },
     ipversion => {
+        description =>
+            'IP version (4 or 6) - automatically determined from source/dest addresses',
         type => 'integer',
         optional => 1,
     },
     macro => {
+        description => 'Use predefined standard macro',
         type => 'string',
         optional => 1,
     },
     pos => {
+        description => 'Rule position in the ruleset',
         type => 'integer',
     },
     proto => {
+        description =>
+            "IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'",
         type => 'string',
         optional => 1,
     },
     source => {
+        description => 'Restrict packet source address',
         type => 'string',
         optional => 1,
     },
     sport => {
+        description => 'Restrict TCP/UDP source port',
         type => 'string',
         optional => 1,
     },
     type => {
+        description => 'Rule type',
         type => 'string',
     },
 };
-- 
2.47.3





More information about the pve-devel mailing list