Skip to content

pulp.app.urls

pulpcore.app.urls

pulp URL Configuration

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 (NamedModelViewSet, default: None ) –

    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 (DefaultRouter) –

    router to register the viewset with.

  • created_routers (list) –

    A running list of all routers.

Returns: list: List of new routers, including those created recursively.

PulpAPIRootView

Bases: APIRootView

A Pulp-defined APIRootView class with no authentication requirements.

PulpDefaultRouter

Bases: DefaultRouter

A DefaultRouter class that benefits from the customized PulpAPIRootView class.