Skip to content

Commit

Permalink
New endpoint returning all collections unpaginated
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Jan 27, 2021
1 parent f353ca0 commit a9ac759
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/7940.feature
@@ -0,0 +1 @@
Introduces a new ``v3/metadata/collections/`` endpoint returning all collections unpaginated.
6 changes: 6 additions & 0 deletions pulp_ansible/app/galaxy/v3/views.py
Expand Up @@ -224,6 +224,12 @@ def update(self, request, *args, **kwargs):
return Response(serializer.data)


class UnpaginatedCollectionViewSet(CollectionViewSet):
"""Unpaginated ViewSet for Collections."""

pagination_class = None


class CollectionUploadViewSet(
ExceptionHandlerMixin, viewsets.GenericViewSet, UploadGalaxyCollectionMixin
):
Expand Down
5 changes: 5 additions & 0 deletions pulp_ansible/app/urls.py
Expand Up @@ -73,6 +73,11 @@
views_v3.CollectionImportViewSet.as_view({"get": "retrieve"}),
name="collection-imports-detail",
),
path(
"metadata/collections/",
views_v3.UnpaginatedCollectionViewSet.as_view({"get": "list"}),
name="metadata-collection-list",
),
]

urlpatterns = [
Expand Down

0 comments on commit a9ac759

Please sign in to comment.