Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename resource names #189

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pdc/apps/contact/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class PersonViewSet(viewsets.PDCModelViewSet):
You can use ``curl`` in terminal, with -X _method_ (GET|POST|PUT|PATCH|DELETE),
-d _data_ (a json string). or GUI plugins for
browsers, such as ``RESTClient``, ``RESTConsole``.

Please access this endpoint by
[%(HOST_NAME)s/%(API_PATH)s/contacts/people/](/%(API_PATH)s/contacts/people/).
Endpoint
[%(HOST_NAME)s/%(API_PATH)s/persons/](/%(API_PATH)s/persons/) is deprecated.
"""

def create(self, request, *args, **kwargs):
Expand Down Expand Up @@ -152,14 +157,19 @@ class MaillistViewSet(viewsets.PDCModelViewSet):
"""
##Overview##

This page shows the usage of the **Maillist API**, please see the
This page shows the usage of the **Mailing list API**, please see the
following for more details.

##Test tools##

You can use ``curl`` in terminal, with -X _method_ (GET|POST|PUT|PATCH|DELETE),
-d _data_ (a json string). or GUI plugins for
browsers, such as ``RESTClient``, ``RESTConsole``.

Please access this endpoint by
[%(HOST_NAME)s/%(API_PATH)s/contacts/mailing-lists/](/%(API_PATH)s/contacts/mailing-lists/).
Endpoint
[%(HOST_NAME)s/%(API_PATH)s/maillists/](/%(API_PATH)s/maillists/) is deprecated.
"""

def create(self, request, *args, **kwargs):
Expand Down
16 changes: 16 additions & 0 deletions pdc/apps/repository/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ class ContentCategoryViewSet(StrictQueryParamMixin,
viewsets.GenericViewSet):
"""
API endpoint that allows content_category to be viewed.

Please access this endpoint by [%(HOST_NAME)s/%(API_PATH)s/content-delivery-content-categories/](/%(API_PATH)s/
content-delivery-content-categories/).
Endpoint [%(HOST_NAME)s/%(API_PATH)s/content-delivery-content-category/](/%(API_PATH)s/
content-delivery-content-category/) is deprecated.
"""
serializer_class = serializers.ContentCategorySerializer
queryset = models.ContentCategory.objects.all()
Expand All @@ -329,6 +334,12 @@ class ContentFormatViewSet(StrictQueryParamMixin,
viewsets.GenericViewSet):
"""
API endpoint that allows content_format to be viewed.

Please access this endpoint by
[%(HOST_NAME)s/%(API_PATH)s/content-delivery-content-formats/](/%(API_PATH)s/content-delivery-content-formats/).
Endpoint
[%(HOST_NAME)s/%(API_PATH)s/content-delivery-content-format/](/%(API_PATH)s/content-delivery-content-format/)
is deprecated.
"""
serializer_class = serializers.ContentFormatSerializer
queryset = models.ContentFormat.objects.all()
Expand All @@ -351,6 +362,11 @@ class ServiceViewSet(StrictQueryParamMixin,
viewsets.GenericViewSet):
"""
API endpoint that allows service to be viewed.

Please access this endpoint by
[%(HOST_NAME)s/%(API_PATH)s/content-delivery-services/](/%(API_PATH)s/content-delivery-services/).
Endpoint
[%(HOST_NAME)s/%(API_PATH)s/content-delivery-service/](/%(API_PATH)s/content-delivery-service/) is deprecated.
"""
serializer_class = serializers.ServiceSerializer
queryset = models.Service.objects.all()
Expand Down
21 changes: 17 additions & 4 deletions pdc/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
router.register(r'base-products', release_views.BaseProductViewSet)
router.register(r'release-types', release_views.ReleaseTypeViewSet, base_name='releasetype')

# TODO: these two end-points will be removed
router.register(r'persons', contact_views.PersonViewSet, base_name='persondeprecated')
router.register(r'maillists', contact_views.MaillistViewSet, base_name='maillistdeprecated')

# register contact view sets
router.register(r'persons', contact_views.PersonViewSet)
router.register(r'maillists', contact_views.MaillistViewSet)
router.register(r'contacts/people', contact_views.PersonViewSet, base_name='person')
router.register(r'contacts/mailing-lists', contact_views.MaillistViewSet, base_name='maillist')
router.register(r'contact-roles', contact_views.ContactRoleViewSet)
router.register(r'role-contacts', contact_views.RoleContactViewSet)

Expand Down Expand Up @@ -147,11 +151,20 @@
release_views.ReleaseVariantViewSet)
router.register(r'variant-types', release_views.VariantTypeViewSet,
base_name='varianttype')

# TODO: these three end-points will be removed
router.register(r'content-delivery-content-category', repo_views.ContentCategoryViewSet,
base_name='contentdeliverycontentcategory')
base_name='contentcategorydeprecated')
router.register(r'content-delivery-content-format', repo_views.ContentFormatViewSet,
base_name='contentdeliverycontentformat')
base_name='contentformatdeprecated')
router.register(r'content-delivery-service', repo_views.ServiceViewSet,
base_name='contentservicedeprecated')

router.register(r'content-delivery-content-categories', repo_views.ContentCategoryViewSet,
base_name='contentdeliverycontentcategory')
router.register(r'content-delivery-content-formats', repo_views.ContentFormatViewSet,
base_name='contentdeliverycontentformat')
router.register(r'content-delivery-services', repo_views.ServiceViewSet,
base_name='contentdeliveryservice')

router.register(r'osbs', osbs_views.OSBSViewSet,
Expand Down