]> git.proxmox.com Git - pve-http-server.git/blobdiff - PVE/APIServer/AnyEvent.pm
add some inline docs
[pve-http-server.git] / PVE / APIServer / AnyEvent.pm
index c319c0722de861fce07dd2fc77adea8964f94f1b..acf43a0347345b16c3a7ef3e400ff852b8dee0d4 100755 (executable)
@@ -1557,7 +1557,7 @@ sub new {
 
     my $class = ref($this) || $this;
 
-    foreach my $req (qw(base_handler_class socket lockfh lockfile)) {
+    foreach my $req (qw(socket lockfh lockfile)) {
        die "misssing required argument '$req'" if !defined($args{$req});
     }
 
@@ -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 {