[Pulp-dev] Plugin relationship to tasks

David Davis daviddavis at redhat.com
Thu Mar 15 14:53:02 UTC 2018

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

User route: POST /api/v3/plugin/file/repository_version/ add_content=[…]
Routes to: POST /api/v3/tasks plugin=file task=create_repository_version

User route: POST /api/v3/plugin/file/syncs/ repo=repo_href
Routes to: POST /api/v3/tasks plugin=file task=sync  repo=repo_href

We’d give a way for plugins to specify which URLs map to a task and what
the expected parameters are.

- 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.


On Wed, Mar 14, 2018 at 3:58 PM, Jeremy Audet <jaudet at 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 at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20180315/2a476fc1/attachment.htm>

More information about the Pulp-dev mailing list