I have an amendment to this proposal. Instead of namespacing just the plugin task routes, I’d propose we namespace all plugin routes. Thus all plugin routes would be namespaced under something like “/api/v3/plugin/<plugin name>/“. For example, “/api/v3/content/file/” gets moved to “/api/v3/plugin/file/content/” and so on.
For task routes, plugins could still route to a single pulpcore viewset/action: User route: POST /api/v3/plugin/file/repository_version/ add_content=[…] Routes to: POST /api/v3/tasks plugin=file task=create_repository_version add_content=[…] User route: POST /api/v3/plugin/file/syncs/ repo=repo_href importer=importer_href Routes to: POST /api/v3/tasks plugin=file task=sync repo=repo_href importer=importer_href We’d give a way for plugins to specify which URLs map to a task and what the expected parameters are. Benefits: - Avoids all potential conflicts as long as plugin names are unique. For example, if my plugin has multiple content types and one is ‘file’, I can set up “/api/v3/content/file” which will conflict with pulp_file. - No leaky abstraction in our URLs. Users don’t have to know whether a particular URL produces a task or not to find its URL. - It’s easy to find all the plugin routes (not just tasks routes) for a particular plugin. They’re at “/api/v3/plugin/<plugin name>/“. - Plugins have more freedom and aren’t constrained to defining certain predefined routes. David On Wed, Mar 14, 2018 at 3:58 PM, Jeremy Audet <jau...@redhat.com> wrote: > I reviewed this proposal with Austin, mainly from the perspective of an > end user. In my opinion, this proposal is a good one. I find the semantics > intuitive and I think they do a good job of adhering to the Richardson > Maturity Model > <https://www.martinfowler.com/articles/richardsonMaturityModel.html>. And > although I don't have a great knowledge of how plugins work, I think this > will grant more flexibility to plugins. > > _______________________________________________ > Pulp-dev mailing list > Pulp-dev@redhat.com > https://www.redhat.com/mailman/listinfo/pulp-dev > >
_______________________________________________ Pulp-dev mailing list Pulp-dev@redhat.com https://www.redhat.com/mailman/listinfo/pulp-dev