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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jan 9 14:05:01 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>
---
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 92d8fcbe..75748504 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