From c5f0a96ffd34d8ed599b9a5a5b9162bc0c3ab5c0 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 15 Jan 2017 10:54:26 +0100 Subject: [PATCH] add some inline docs --- PVE/APIServer/AnyEvent.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm index bb6caae..acf43a0 100755 --- a/PVE/APIServer/AnyEvent.pm +++ b/PVE/APIServer/AnyEvent.pm @@ -1697,10 +1697,30 @@ sub auth_handler { sub rest_handler { my ($self, $clientip, $method, $rel_uri, $auth, $params) = @_; + # please do not raise exceptions here (always return a result). + return { status => HTTP_NOT_IMPLEMENTED, message => "Method '$method $rel_uri' not implemented", }; + + # this should return the following properties, which + # are then passed to the Formatter + + # status: HTTP status code + # message: Error message + # errors: more detailed error hash (per parameter) + # info: reference to JSON schema definition - useful to format output + # data: result data + + # total: additional info passed to output + # changes: additional info passed to output + + # if you want to proxy the request to another node return this + # { proxy => $remip, proxynode => $node, proxy_params => $params }; + + # to pass the request to the local priviledged daemon use: + # { proxy => 'localhost' , proxy_params => $params }; } sub check_cert_fingerprint {