Project

Profile

Help

Task #3033

closed

Task #2868: Platform support for publishing.

Add Publication API Endpoint.

Added by jortel@redhat.com about 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 29
Quarter:

Description

Add Publication API endpoint to support listing and deleting publications. The URL should be nested under the publisher. Publications are immutable but can be deleted when not referenced by a Distribution. This will be enforced by the integrity constraints.

Use Cases:

  • As a user, I want to create a publication.
  • The POST to publisher/<id>/publications/ will trigger a publish which will create a publication and return 202 and a task href.
  • On completion, the Task.created_resources will contain the created publication (unless the publisher fails).
  • As a user, I want to list publications created by a publisher to support:
  • Knowing what publications have been created.
  • Manually update a Distribution. (manual promotion).
  • Identify publications to be deleted.
  • As a user, I want to delete publications:
  • A Specific publication. URL something like: "../publishers/<id>/publications/<id>/"

The Distribution FK to Publication is currently on_delete=SET_NULL but thinking we should probably change it to on_delete=PROTECT to ensure that an active publication isn't ruined by mistake.

In the future, one-time publisher options will be stored on the Publication.

A new CreatedResources model:

  • task
  • resource (Generic FK)

The Task serializer will include the Task.created_resources

The publish task will create the Publication as defined by the POST document and passed to the plugin Publisher.publish(). On success, the created publication is added to CreatedResources. This should all be done in a single DB transaction to ensure that broken publications are not saved to the DB.


Related issues

Blocked by Pulp - Task #3102: Make Distribution a top level resource in the API.CLOSED - CURRENTRELEASEjortel@redhat.com

Actions

Also available in: Atom PDF