Am 24.05.22 um 16:45 schrieb Stefan Hrdlicka: > this enables forwarding of request to the correct node if a node is set > > Signed-off-by: Stefan Hrdlicka <s.hrdli...@proxmox.com> > --- > PVE/API2/Storage/Config.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm > index 6bd770e..82b73ca 100755 > --- a/PVE/API2/Storage/Config.pm > +++ b/PVE/API2/Storage/Config.pm > @@ -146,6 +146,13 @@ __PACKAGE__->register_method ({ > protected => 1, > path => '', > method => 'POST', > + proxyto_callback => sub { > + my ($rpcenv, $proxyto, $uri_param) = @_; > + my $node = delete $uri_param->{node};
Messing with the uri params here is hacky. It destroys the consistency between the API schema and what the API call actually handles. It's not really required to proxy the call to a specific node. The only downside is that we don't do an early storage access check if the storage is not enabled for the current node. > + $node = "localhost" if !$node; > + > + return $node; > + }, > description => "Create a new storage.", > permissions => { > check => ['perm', '/storage', ['Datastore.Allocate']], _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel