all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api] API: Mailtracker: add values to rstatus and dstatus description
@ 2021-08-12 15:30 Aaron Lauterer
  2021-08-13  7:44 ` Mira Limbeck
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2021-08-12 15:30 UTC (permalink / raw)
  To: pmg-devel

The possible values were only documented within the source code. Having
them as part of the API description will help people wanting to use the
tracker API endpoint interpreting the results.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 src/PMG/API2/MailTracker.pm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/PMG/API2/MailTracker.pm b/src/PMG/API2/MailTracker.pm
index 187decf..952abc8 100644
--- a/src/PMG/API2/MailTracker.pm
+++ b/src/PMG/API2/MailTracker.pm
@@ -38,6 +38,14 @@ my $statmap = {
     Q => 'quarantine',
 };
 
+my $print_statmap = sub {
+    my $map = "";
+    foreach my $key (sort keys %$statmap) {
+	$map .= "$key: $statmap->{$key}\n";
+    }
+    return $map;
+};
+
 my $run_pmg_log_tracker = sub {
     my ($args, $includelog) = @_;
 
@@ -247,13 +255,15 @@ my $email_log_property_desc = {
 	type => 'integer',
     },
     dstatus => {
-	description => "Delivery status.",
+	description => "Delivery status. Can be one of the following values:\n" .
+	$print_statmap->(),
 	type => 'string',
 	minLength => 1,
 	maxLength => 1,
     },
     rstatus => {
-	description => "Delivery status of relayed mail.",
+	description => "Delivery status of relayed mail. Can be one of the " .
+	"following values:\n" . $print_statmap->(),
 	type => 'string',
 	minLength => 1,
 	maxLength => 1,
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-13  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 15:30 [pmg-devel] [PATCH pmg-api] API: Mailtracker: add values to rstatus and dstatus description Aaron Lauterer
2021-08-13  7:44 ` Mira Limbeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal