pulp.app.urls¶
pulp URL Configuration
-
class
pulpcore.app.urls.
ViewSetNode
(viewset=None)¶ Each node is a tree that can register nested ViewSets with DRF nested routers.
The structure of the tree becomes the url heirarchy when the ViewSets are registered.
Example Structure:
RootNode ├─ RepositoryViewSet │ ├─ PluginPublisherViewSet (non-nested) │ │ └─ PluginPublisherVDistributionViewSet │ ├─ AnotherPluginPublisherViewSet │ │ └─ AnotherPluginDistributionViewSet │ └─ FileRemoteViewSet └─ some-non-nested viewset
Create a new node.
- Parameters
viewset (pulpcore.app.viewsets.base.NamedModelViewSet) – If provided, represent this viewset. If not provided, this is the root node.
-
add_decendent
(node)¶ Add a VSNode to the tree. If node is not a direct child, attempt to add the to each child.
- Parameters
node (ViewSetNode) – A node that represents a viewset and its decendents.
-
register_with
(router)¶ Register this tree with the specified router and create new routers as necessary.
- Parameters
router (routers.DefaultRouter) – router to register the viewset with.
created_routers (list) – A running list of all routers.
- Returns
List of new routers, including those created recursively.
- Return type
list
-
pulpcore.app.urls.
root_router
= <rest_framework.routers.DefaultRouter object>¶ The Pulp Platform v3 API router, which can be used to manually register ViewSets with the API.