[pbs-devel] [PATCH v6 proxmox-backup 12/29] api/api-types: refactor api endpoint version, add api types

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 22 13:42:29 CET 2024


Am 21.11.24 um 17:15 schrieb Christian Ebner:
> On 11/21/24 17:01, Thomas Lamprecht wrote:
>> Am 21.11.24 um 10:58 schrieb Christian Ebner:
>>> On 11/21/24 10:23, Thomas Lamprecht wrote:
>>> Well, that is something I did not consider at all! So with that
>>> viewpoint, adding this to PBS specifically is surely not the best way.
>>> As discussed with Fabain off list, version based matching will be the
>>> best way forward here, and dropping the incompatibility check once EOL
>>> is reached.
>>
>> If we add such a thing that you proposed we should definitively get the
>> story somewhat straight w.r.t. how we want to handle this for all projects,
>> and define when to define a feature and when not, with some extra care on
>> the interfaces, as those are relatively set in stone.
> 
> Regarding this, have we considered exposing the API schema to the 
> client, something like [0]?

Well, if, I'd go for the JSON schema directly (i.e., like our API viewer
consumes) and yes IIRC there weere some very informal/shallow talks about
this once or twice in the last five years or so IIRC, but nothing came out
of it.

> Fetching the remote API schema and therefore knowing which parameters 
> are available would have not only covered the additional check, but also 
> allowed to see what response value to expect.

As long as the schema is somewhat complete (a bit better for PBS/rust, not
perfect for PVE)

> 
> Although, I guess this boils down to the same set of maintenance burden 
> in the end, hard to maintain code because of to many condition checks.

That API would be auto-generated and only the client side would take the
burden of checking, and that would not be so bad.
If done nicely and such that general tooling can work with it we would
also help external API consumers a lot.

But IMO a bigger project, at least if we want to have most uses cases
covered and implemented honor industry standards closely.




More information about the pbs-devel mailing list