Project

Profile

Help

Story #2873

closed

As an authenticated user, I can associate a Content unit with a Repository

Added by dkliban@redhat.com over 7 years ago. Updated over 5 years ago.

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

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

For an API user to associate a Content unit to a Repository, Pulp 3 needs to have the following:

- viewset for the RepositoryContent model that can handle CRD operations
- serializer for the viewset which will return all serialized fields of the RepositoryContent model.
- API endpoint at /api/v3/repositories/<repo-id>/content/
- POST request to the /api/v3/repositories/<repo-id>/content/ endpoint creates Content. The body of the request contains a dictionary that looks like the following:

{
"contents": ["< content >", "< content2 >"]
}

RepositoryContent is created for each content specified in the payload. The repo-id is derived from the URL.

- GET request to the /api/v3/repositories/<repo-id>/content/<content-id> returns serialized RepositoryContent

- DELETE request to the /api/v3/repositories/<repo-id>/content/<content-id> removes the RepositoryContent from the database.

- PUT/PATCH requests to the /api/v3/content/units/<content unit id>/ raises an exception (409 unsupported method)

RepositoryContent is a through model[0].

[0] https://docs.djangoproject.com/en/1.9/topics/db/models/#intermediary-manytomany


Related issues

Related to Pulp - Story #2672: As a user, I can associate content with repositories using the content APICLOSED - WONTFIX

Actions

Also available in: Atom PDF