Story #3209
Updated by bmbouter almost 7 years ago
h2. Motivation
The ContentUnits added to a repository change over time, but Pulp only stores the current state. This prevents a lot of great things like rolling back to a particluar snapshot, or understanding exactly what content is in place at any given time.
h2. Solution
Introducing the Repository Version, which represents the ContentUnits in a repository after any given operation. For example, each of the following operations will produce a repository version.
* Sync from an importer
* Add a set of units to a repository
* Remove a set of units from a repository
Any repository version can be deleted. Publications are changed to publish a specific RepositoryVersion, not just the latest content in a given repo.
h2. API examples
<pre>
POST /api/v3/repositories/{repo_id}/versions/ # create the new RepositoryVersion. specify the importer here, and/or units to add, and/or units to remove
GET /api/v3/repository/{repo_id}/versions/{number} # The resource for a single repo version
GET /api/v3/repositories/{repo_id}/versions/<id>/content/ # paginated list of all content in particular version
GET /api/v3/repositories/{repo_id}/versions/<id>/added_content/ # paginated list of content added when a particular version was created
GET /api/v3/repositories/{repo_id}/versions/<id>/removed_content/ # paginated list of content removed when a particular version was created
</pre>