[pve-devel] [PATCH v3 manager 3/5] task index: fix return schema annotations

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jan 23 14:56:33 CET 2019


both task sources use PVE::Tools::upid_decode, which ensures all of the
':' delimited fields are set.

this only leaves 'status' and 'endtime' as optional, which are not set
for currently running tasks.

reorder them in the code for easier matching with their on-disk format.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Acked-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Notes:
    new in v2

 PVE/API2/Tasks.pm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/PVE/API2/Tasks.pm b/PVE/API2/Tasks.pm
index 8cdc534d..73e398eb 100644
--- a/PVE/API2/Tasks.pm
+++ b/PVE/API2/Tasks.pm
@@ -78,15 +78,15 @@ __PACKAGE__->register_method({
 	    type => "object",
 	    properties => {
 		upid =>  { type => 'string', title => 'UPID', },
-		id => { type => 'string', optional => 1, title => 'ID', },
-		pid => { type => 'integer', optional => 1, title => 'PID', },
-		pstart => { type => 'integer', optional => 1, },
-		status =>  { type => 'string', optional => 1, title => 'Status', },
-		type =>  { type => 'string', optional => 1, title => 'Type', },
-		node =>  { type => 'string', optional => 1, title => 'Node', },
-		user =>  { type => 'string', optional => 1, title => 'User', },
-		starttime =>  { type => 'integer', optional => 1, title => 'Starttime', },
+		node =>  { type => 'string', title => 'Node', },
+		pid => { type => 'integer', title => 'PID', },
+		pstart => { type => 'integer', },
+		starttime =>  { type => 'integer', title => 'Starttime', },
+		type =>  { type => 'string', title => 'Type', },
+		id => { type => 'string', title => 'ID', },
+		user =>  { type => 'string', title => 'User', },
 		endtime =>  { type => 'integer', optional => 1, title => 'Endtime', },
+		status =>  { type => 'string', optional => 1, title => 'Status', },
 	    },
 	},
 	links => [ { rel => 'child', href => "{upid}" } ],
-- 
2.20.1





More information about the pve-devel mailing list