Skip to content

Commit

Permalink
Rename endpoints for content to be in plural form
Browse files Browse the repository at this point in the history
For consistency, now:
modulemd -> modulemds
packageenvironmwent -> packageenvironments
packagecategory -> packagecategories
packagegroup -> packagegroups

closes #5679
https://pulp.plan.io/issues/5679
  • Loading branch information
CodeHeeler committed Nov 8, 2019
1 parent 3be7c04 commit 052424b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGES/5679.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Rename endpoints for content to be in plural form consistently

Endpoints removed -> added:

/pulp/api/v3/content/rpm/modulemd/ -> /pulp/api/v3/content/rpm/modulemds/
/pulp/api/v3/content/rpm/packagecategory/ -> /pulp/api/v3/content/rpm/packagecategories/
/pulp/api/v3/content/rpm/packageenvironment/ -> /pulp/api/v3/content/rpm/packageenvironments/
/pulp/api/v3/content/rpm/packagegroup/ -> /pulp/api/v3/content/rpm/packagegroups/
6 changes: 3 additions & 3 deletions pulp_rpm/app/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class PackageCategorySerializer(NoArtifactContentSerializer):
required=False,
queryset=PackageGroup.objects.all(),
many=True,
view_name='content-rpm/packagegroup-detail'
view_name='content-rpm/packagegroups-detail'
)

class Meta:
Expand Down Expand Up @@ -676,15 +676,15 @@ class PackageEnvironmentSerializer(NoArtifactContentSerializer):
required=False,
queryset=PackageGroup.objects.all(),
many=True,
view_name='content-rpm/packagegroup-detail'
view_name='content-rpm/packagegroups-detail'
)
optionalgroups = RelatedField(
help_text=_("Groups optionally related to this Environment."),
allow_null=True,
required=False,
queryset=PackageGroup.objects.all(),
many=True,
view_name='content-rpm/packagegroup-detail'
view_name='content-rpm/packagegroups-detail'
)

class Meta:
Expand Down
8 changes: 4 additions & 4 deletions pulp_rpm/app/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class PackageGroupViewSet(ReadOnlyContentViewSet,
PackageGroup ViewSet.
"""

endpoint_name = 'packagegroup'
endpoint_name = 'packagegroups'
queryset = PackageGroup.objects.all()
serializer_class = PackageGroupSerializer

Expand All @@ -255,7 +255,7 @@ class PackageCategoryViewSet(ReadOnlyContentViewSet,
PackageCategory ViewSet.
"""

endpoint_name = 'packagecategory'
endpoint_name = 'packagecategories'
queryset = PackageCategory.objects.all()
serializer_class = PackageCategorySerializer

Expand All @@ -266,7 +266,7 @@ class PackageEnvironmentViewSet(ReadOnlyContentViewSet,
PackageEnvironment ViewSet.
"""

endpoint_name = 'packageenvironment'
endpoint_name = 'packageenvironments'
queryset = PackageEnvironment.objects.all()
serializer_class = PackageEnvironmentSerializer

Expand Down Expand Up @@ -311,7 +311,7 @@ class ModulemdViewSet(SingleArtifactContentUploadViewSet):
ViewSet for Modulemd.
"""

endpoint_name = 'modulemd'
endpoint_name = 'modulemds'
queryset = Modulemd.objects.all()
serializer_class = ModulemdSerializer

Expand Down

0 comments on commit 052424b

Please sign in to comment.