Working on issue #3073 [1], there was a discussion that came up about how to best handle updating many-to-many joins in the API. We currently have a many-to-many relationship between repositories and contents which is handled by a RepositoryContent model. The api for this model is at /api/v3/repositorycontents/ (more info here [2]). But we also have an API already at /api/v3/repository/<repo-id>/content as well but it currently only lists the contents for a repository.
I think there are two options for supporting many-to-many joins in the API. First, we could continue to expose the join model and have routes like: POST /api/v3/repositorycontents/ (which takes a repo id and content id) DELETE /api/v3/repositorycontents/<repo-content-id>/ We would have to start exposing the repo content id in the api to get this second link working. However, alternatively, we could use a nested route to handle adding/removing repo contents: POST /api/v3/repositories/<repo-id>/content/ (which takes a content id) DELETE /api/v3/repositories/<repo-id>/content/<content-id>/ This second scheme would essentially hide the RepositoryContent model from API users. I am not sure if that’s a good thing or a bad thing. Thoughts? [1] https://pulp.plan.io/issues/3073 [2] https://pulp.plan.io/issues/2873 David
_______________________________________________ Pulp-dev mailing list [email protected] https://www.redhat.com/mailman/listinfo/pulp-dev
