ayon-backend icon indicating copy to clipboard operation
ayon-backend copied to clipboard

REST: allow production placeholder instead of version in addons custom endpoints

Open alainxi opened this issue 11 months ago • 2 comments

Current situation :

Currently, paths to addon endpoints always contain the addon version, since all endpoints from all versions are always exposed. Example : http:// myserverayon:5000/api/addons/my_addon/0.1.2/get-test-data/myProjectName

Problem :

If we code a custom endpoint, to be used by other departments, we can’t tell them it’s a moving target, they need a fixed url, as in usual REST APIs. Because other departments can’t use self.version or similar, as the calls are done from other softwares.

Proposal

Please provide a “production" placeholder, that would replace the version. Example : /api/addons/my_addon/production/my_endpoint

Context :

It was discussed here :

https://community.ynput.io/t/custom-endpoint/2149

alainxi avatar Jan 22 '25 09:01 alainxi

I wonder if we can generizlie it in this way:

/api/addons/my_addon/{bundle_variant}/my_endpoint

I believe this can be tricky becasue atm addons are independet of the bundles they are added to. also, the same addon can be used in different bundle variant and also add checks to update the endpoints on each bundle status change. e.g. when setting a bundle to production, staging and dev.

https://github.com/ynput/ayon-backend/blob/0d0e503ad7472cf58a20164ffc74bdaec10fa7dd/ayon_server/api/lifespan.py#L72-L84

MustafaJafar avatar May 12 '25 17:05 MustafaJafar

Hello @martastain !

For this feature request, I would like to know if it is in the roadmap, and how high it is ?

alainxi avatar Nov 17 '25 09:11 alainxi