As part of the changes for RepositoryVersions [0], we are adding some tools to the plugin API that will allow plugins to define their own celery tasks, as well as deploy them. The changes to the plugin API are made in this PR [1] and are summarized below.
Added: Allow plugin writers to create celery tasks `pulpcore.plugin.tasks.UserFacingTask` working directory context manager for tasks that use the file system `pulpcore.plugin.tasks.working_dir_context` Allow plugin viewsets to return HTTP 202 with the href for a task `pulpcore.plugin.viewsets.OperationPostponedResponse` Allow plugin viewsets to dispatch tasks `pulpcore.plugin.viewsets.tags` Removed: This function used to raise a NotImplementedError. It is now removed from the model and defined as a celery task in each plugin. `pulpcore.plugin.models.Importer.sync` The ImporterViewset used to proved a sync detail route at `v3/importers/<type>/<id>/sync/`. MyPluginImporterViewset can (and probably should) define this endpoint by creating a detail route called sync. For example, see the file plugin's implementation [2] `pulpcore.plugin.viewsets.ImporterViewset.sync` The File plugin has an open PR to use the updated plugin API [3]. More information is available on the the issue [4]. [0]: https://pulp.plan.io/issues/3209 [1]: https://github.com/pulp/pulp/pull/3259/ [2]: https://github.com/pulp/pulp_file/pull/24/files#diff-4ea13541b01c775a55f25a8c4fab0aebR29 [3]: https://github.com/pulp/pulp_file/pull/24 [4]: https://pulp.plan.io/issues/3074
_______________________________________________ Pulp-dev mailing list Pulp-dev@redhat.com https://www.redhat.com/mailman/listinfo/pulp-dev