Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Adds docs for the stages package
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Bouterse committed Jul 31, 2018
1 parent 0d16d8a commit 55553cf
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/plugins/plugin-api/overview.rst
Expand Up @@ -14,6 +14,7 @@ Plugin API reaches stability with v1.0. For the latest version of the Plugin API
viewsets
tasking
download
stages
changeset

.. automodule:: pulpcore.plugin
Expand Down
66 changes: 66 additions & 0 deletions docs/plugins/plugin-api/stages.rst
@@ -0,0 +1,66 @@
.. _stages-docs:

pulpcore.plugin.stages
======================

Plugin writers can use the Stages API to create a high-performance download-and-saving pipeline
to make writing sync code easier. There are two parts to the API:

1. DeclarativeVersion is a generic pipeline useful for most synchronization use cases.
2. The Stages themselves


.. _declarative-version:

DeclarativeVersion
^^^^^^^^^^^^^^^^^^

.. autoclass:: pulpcore.plugin.stages.DeclarativeVersion

.. autoclass:: pulpcore.plugin.stages.FirstStage

.. autoclass:: pulpcore.plugin.stages.DeclarativeArtifact

.. autoclass:: pulpcore.plugin.stages.DeclarativeContent


.. _stages-api:

Stages API
^^^^^^^^^^

.. autofunction:: pulpcore.plugin.stages.create_pipeline

.. autofunction:: pulpcore.plugin.stages.end_stage


.. _artifact-stages:

Artifact Related Stages
^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: pulpcore.plugin.stages.artifact_downloader

.. autofunction:: pulpcore.plugin.stages.artifact_saver

.. autofunction:: pulpcore.plugin.stages.query_existing_artifacts


.. _content-stages:

Content Related Stages
^^^^^^^^^^^^^^^^^^^^^^

.. autofunction:: pulpcore.plugin.stages.content_unit_saver

.. autofunction:: pulpcore.plugin.stages.query_existing_content_units


.. _content-association-stages:

Content Association and Unassociation Stages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: pulpcore.plugin.stages.content_unit_association

.. autoclass:: pulpcore.plugin.stages.content_unit_unassociation
6 changes: 4 additions & 2 deletions plugin/pulpcore/plugin/stages/association_stages.py
Expand Up @@ -29,7 +29,8 @@ class content_unit_association:
associated. Since it's a stream the total count isn't known until it's finished.
Args:
new_version (RepositoryVersion): The RespositoryVersion this stage associates content with.
new_version (pulpcore.plugin.models.RepositoryVersion): The repo version this stage
associates content with.
Returns:
An object containing the content_unit_association stage to be included in a pipeline.
Expand Down Expand Up @@ -112,7 +113,8 @@ class content_unit_unassociation:
un-associated. Since it's a stream the total count isn't known until it's finished.
Args:
new_version (RepositoryVersion): The RespositoryVersion this stage unassociates content from
new_version (pulpcore.plugin.models.RepositoryVersion): The repo version this stage
unassociates content from
Returns:
An object containing the configured content_unit_unassociation stage to be included in a
Expand Down
3 changes: 2 additions & 1 deletion plugin/pulpcore/plugin/stages/declarative_version.py
Expand Up @@ -92,7 +92,8 @@ def __init__(self, first_stage, repository, sync_mode='mirror'):
Args:
first_stage (FirstStage): The first stage to receive `DeclarativeContent` from
repository (Repository): The repository receiving the new version
repository (pulpcore.plugin.models.Repository): The repository receiving the new
version
sync_mode (str): 'mirror' removes content units from the RepositoryVersion that are not
queued to DeclarativeVersion. 'additive' only adds content units queued to
DeclarativeVersion, and does not remove any pre-existing units in the
Expand Down

0 comments on commit 55553cf

Please sign in to comment.