[Pulp-dev] creating repository version resources using a single REST endpoint

Austin Macdonald amacdona at redhat.com
Mon Jan 8 19:39:59 UTC 2018


I like the concept of single REST endpoint that is responsible for all the
ways to create a RepositoryVersion, but I don't quite understand how this
would work. Since the endpoint is purely pulpcore, how can the
RepositoryVersionViewSet import the plugin defined tasks that correspond to
the action specified by the user? The only way I see is to force plugin
writers to define all their tasks as methods on the Importer or Publisher,
which brings us back to the circular import problem.
https://pulp.plan.io/issues/3074

Also, I think it would be a little unusual that the possible actions
specified in the POST body to a pulpcore endpoint would vary depending on
the plugin it is being used with. How would we document how to use this
endpoint?

On Mon, Jan 8, 2018 at 1:45 PM, Dennis Kliban <dkliban at redhat.com> wrote:

> Enable users to POST to /api/v3/repositories/123abc456/versions/ with one
> required parameter 'operation'. This parameter would be an identifier for a
> task Pulp would run to create a new version. Any additional parameters
> passed in by the API user would be passed along to the task.
>
> pulpcore would provide the 'sync' task and the 'add_remove' task. 'sync'
> would accept an 'importer'. 'add_remove' would accept 'remove_content' and
> 'add_content'.
>
> Each plugin could provide any number of tasks for creating a repository
> version.
>
> pulpcore would always create the new repository version, hand it to the
> plugin code, and then mark it as complete after plugin code runs
> successfully. Alleviating the plugin writer of these concern.
>
> REST API users would always use the same end point to create a repository
> version. Plugin writers wouldn't have to worry about creating repository
> versions and managing the 'complete' state.
>
> What do you all think?
>
>
> _______________________________________________
> 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/20180108/8a199cf2/attachment.htm>


More information about the Pulp-dev mailing list