[pve-devel] [PATCH pve-manager v2 4/4] api: add replication config read return schema

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Oct 2 10:51:52 CEST 2025


Am 24.09.25 um 13:59 schrieb n.frey at proxmox.com:
> From: Nicolas Frey <n.frey at proxmox.com>
> 
> removed delete from schema for return types, as it is only used
> in update/PUT.
> 
> Signed-off-by: Nicolas Frey <n.frey at proxmox.com>
> ---
>  PVE/API2/ReplicationConfig.pm | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/API2/ReplicationConfig.pm b/PVE/API2/ReplicationConfig.pm
> index 307ebe69..d6451d85 100644
> --- a/PVE/API2/ReplicationConfig.pm
> +++ b/PVE/API2/ReplicationConfig.pm
> @@ -17,6 +17,10 @@ use PVE::API2::Replication;
>  
>  use base qw(PVE::RESTHandler);
>  
> +my $replication_config_return_type = PVE::ReplicationConfig->createSchema();
> +# delete only used in update endpoint
> +delete $replication_config_return_type->{delete};
> +

Which makes one rather wonder why it gets returned for the create schema in
the first place – after all we do have a updateSchema

>  __PACKAGE__->register_method({
>      name => 'index',
>      path => '',
> @@ -33,10 +37,7 @@ __PACKAGE__->register_method({
>      },
>      returns => {
>          type => 'array',
> -        items => {
> -            type => "object",
> -            properties => {},
> -        },
> +        items => $replication_config_return_type,
>          links => [{ rel => 'child', href => "{id}" }],
>      },
>      code => sub {
> @@ -75,7 +76,7 @@ __PACKAGE__->register_method({
>              id => get_standard_option('pve-replication-id'),
>          },
>      },
> -    returns => { type => 'object' },
> +    returns => $replication_config_return_type,
>      code => sub {
>          my ($param) = @_;
>  





More information about the pve-devel mailing list