Story #4279
Updated by ttereshc almost 6 years ago
Plugins currently write out the plugin name or some identifier to namespace their endpoints manually as part of 'endpoint_name' when they write their viewsets, e.g. for @PackageViewSet@: @endpoint_name = 'rpm/packages'@, for @UpdateRecordViewSet@: @endpoint_name = 'rpm/errata'@, etc. Currently it's mostly a problem for ContentViewSets and less of a problem for Remotes, Publishers, etc, since it's common for a single plugin to support multiple content types. The suggestion is to prepend endpoint_name of a viewset of any detail model automagically with a plugin name which is defined as a Django app label. name, e.g.: For the plugins it is recommended to drop the 'pulp_' part of their Django app label. E.g.: For @PackageViewSet@: @endpoint_name@ will be @'packages'@, and the Django label @'packages'@ And endpoint will change "pulp_rpm" -> "rpm", so for there is no change in content endpoints: this way: <pre> /api/v3/content/rpm/packages/ --> /api/v3/content/pulp_rpm/packages/ </pre> For Remotes'/Publishers'/other "detail" endpoints will change this way (first "rpm" is a Django label, second "rpm" is @endpoint_name@ defined on a viewset): as well, for consistency: <pre> /api/v3/remotes/rpm/ --> /api/v3/content/remotes/rpm/rpm/ /api/v3/content/remotes/pulp_rpm/rpm/ /api/v3/publishers/rpm/ --> /api/v3/content/publishers/rpm/rpm/ /api/v3/content/publishers/pulp_rpm/rpm/ </pre>