def extend_api_router(root_router: DefaultRouterPlusPlus, *, projects_router: NestedRegistryItem): root_router.register(r"license", license.LicenseViewSet) root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries, "debug_ch_queries") projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"]) projects_router.register(r"explicit_members", explicit_team_member.ExplicitTeamMemberViewSet, "project_explicit_members", ["team_id"])
def extend_api_router(root_router: DefaultRouterPlusPlus, *, projects_router: NestedRegistryItem, project_dashboards_router: NestedRegistryItem) -> None: root_router.register(r"license", license.LicenseViewSet) root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries, "debug_ch_queries") projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"]) projects_router.register(r"explicit_members", explicit_team_member.ExplicitTeamMemberViewSet, "project_explicit_members", ["team_id"]) project_dashboards_router.register( r"collaborators", dashboard_collaborator.DashboardCollaboratorViewSet, "project_dashboard_collaborators", ["team_id", "dashboard_id"], )
team, user, ) @decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]) @decorators.authentication_classes([]) @decorators.permission_classes([]) def api_not_found(request): raise exceptions.NotFound(detail="Endpoint not found.") router = DefaultRouterPlusPlus() # Legacy endpoints (to be removed eventually) router.register(r"annotation", annotation.AnnotationsViewSet) router.register(r"feature_flag", feature_flag.FeatureFlagViewSet) router.register(r"dashboard", dashboard.DashboardsViewSet) router.register(r"dashboard_item", dashboard.DashboardItemsViewSet) router.register(r"plugin_config", plugin.PluginConfigViewSet) router.register(r"personal_api_keys", personal_api_key.PersonalAPIKeyViewSet, "personal_api_keys") router.register(r"sessions_filter", sessions_filter.SessionsFilterViewSet) # Nested endpoints projects_router = router.register(r"projects", team.TeamViewSet) project_plugins_configs_router = projects_router.register( r"plugin-configs", plugin.PluginConfigViewSet, "project_plugins_configs", ["team_id", "plugin_config_id"] ) project_plugins_configs_router.register( r"logs", plugin_log_entry.PluginLogEntryViewSet, "project_plugins_config_logs", ["team_id", "plugin_config_id"] )
personal_api_key, plugin, team, ) @decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]) @decorators.authentication_classes([]) @decorators.permission_classes([]) def api_not_found(request): raise exceptions.NotFound(detail="Endpoint not found.") router = DefaultRouterPlusPlus() # legacy endpoints (to be removed eventually) router.register(r"annotation", annotation.AnnotationsViewSet) router.register(r"feature_flag", feature_flag.FeatureFlagViewSet) router.register(r"funnel", funnel.FunnelViewSet) router.register(r"dashboard", dashboard.DashboardsViewSet) router.register(r"dashboard_item", dashboard.DashboardItemsViewSet) router.register(r"cohort", cohort.CohortViewSet) router.register(r"plugin", plugin.PluginViewSet) router.register(r"plugin_config", plugin.PluginConfigViewSet) router.register(r"personal_api_keys", personal_api_key.PersonalAPIKeyViewSet, "personal_api_keys") projects_router = router.register(r"projects", team.TeamViewSet) organizations_router = router.register(r"organizations", organization.OrganizationViewSet) organizations_router.register( r"members", organization_member.OrganizationMemberViewSet,
team, user, ) @decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]) @decorators.authentication_classes([]) @decorators.permission_classes([]) def api_not_found(request): raise exceptions.NotFound(detail="Endpoint not found.") router = DefaultRouterPlusPlus() # Legacy endpoints shared (to be removed eventually) router.register(r"annotation", annotation.LegacyAnnotationsViewSet) # Should be completely unused now router.register(r"feature_flag", feature_flag.LegacyFeatureFlagViewSet) # Should be completely unused now router.register(r"dashboard", dashboard.LegacyDashboardsViewSet) # Should be completely unused now router.register(r"dashboard_item", dashboard.LegacyInsightViewSet) # To be deleted - unified into insight viewset router.register(r"plugin_config", plugin.LegacyPluginConfigViewSet) # Nested endpoints shared projects_router = router.register(r"projects", team.TeamViewSet) project_plugins_configs_router = projects_router.register( r"plugin_configs", plugin.PluginConfigViewSet, "project_plugin_configs", ["team_id"] ) project_plugins_configs_router.register( r"logs", plugin_log_entry.PluginLogEntryViewSet, "project_plugins_config_logs", ["team_id", "plugin_config_id"] ) projects_router.register( r"feature_flag_overrides", feature_flag.FeatureFlagOverrideViewset, "project_feature_flag_overrides", ["team_id"]
def extend_api_router(root_router: DefaultRouterPlusPlus, *, projects_router: NestedRegistryItem): root_router.register(r"license", license.LicenseViewSet) projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"])
user, ) @decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"]) @decorators.authentication_classes([]) @decorators.permission_classes([]) def api_not_found(request): raise exceptions.NotFound(detail="Endpoint not found.") router = DefaultRouterPlusPlus() # Legacy endpoints shared (to be removed eventually) router.register( r"annotation", annotation.LegacyAnnotationsViewSet) # Should be completely unused now router.register( r"feature_flag", feature_flag.LegacyFeatureFlagViewSet) # Should be completely unused now router.register( r"dashboard", dashboard.LegacyDashboardsViewSet) # Should be completely unused now router.register(r"dashboard_item", dashboard.LegacyDashboardItemViewSet ) # To be deleted - unified into insight viewset router.register(r"plugin_config", plugin.LegacyPluginConfigViewSet) router.register(r"sessions_filter", sessions_filter.LegacySessionsFilterViewSet) # Nested endpoints shared projects_router = router.register(r"projects", team.TeamViewSet)