update pve-api-definition.dat
[pve-client.git] / extractapi.pl
index 1971c9c..b2ec7b0 100755 (executable)
@@ -23,7 +23,7 @@ sub remove_code_refs {
                if ($itemclass eq 'CODE') {
                    undef $tree->{$k};
                } elsif ($itemclass eq 'Regexp') {
-                   $tree->{$k} = "$tree"; # return string representation
+                   $tree->{$k} = "$tree->{$k}"; # return string representation
                } else {
                    remove_code_refs($tree->{$k});
                }
@@ -32,9 +32,16 @@ sub remove_code_refs {
     }
 }
 
-my $tree = PVE::RESTHandler::api_dump('PVE::API2', undef, 1);
-
-remove_code_refs($tree);
-Storable::store_fd($tree, \*STDOUT);
+my $root = {
+    path => '/',
+    text => '',
+    children =>  PVE::RESTHandler::api_dump('PVE::API2', undef, 1),
+    info => {
+       GET =>  PVE::API2->map_method_by_name('index'),
+    },
+};
+
+remove_code_refs($root);
+Storable::store_fd($root, \*STDOUT);
 
 exit(0);