mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	This adds a new API for sending basic analytics data (number of users, number of messages sent) from a Zulip server to the Zulip Cloud central analytics database, which will make it possible for servers to elect to have their usage numbers counted in published stats on the size of the Zulip ecosystem.
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
from typing import Any
 | 
						|
 | 
						|
from django.conf.urls import include, url
 | 
						|
 | 
						|
import zilencer.views
 | 
						|
from zerver.lib.rest import rest_dispatch
 | 
						|
 | 
						|
i18n_urlpatterns = []  # type: Any
 | 
						|
 | 
						|
# Zilencer views following the REST API style
 | 
						|
v1_api_and_json_patterns = [
 | 
						|
    url('^remotes/push/register$', rest_dispatch,
 | 
						|
        {'POST': 'zilencer.views.register_remote_push_device'}),
 | 
						|
    url('^remotes/push/unregister$', rest_dispatch,
 | 
						|
        {'POST': 'zilencer.views.unregister_remote_push_device'}),
 | 
						|
    url('^remotes/push/notify$', rest_dispatch,
 | 
						|
        {'POST': 'zilencer.views.remote_server_notify_push'}),
 | 
						|
 | 
						|
    # Push signup doesn't use the REST API, since there's no auth.
 | 
						|
    url('^remotes/server/register$', zilencer.views.register_remote_server),
 | 
						|
 | 
						|
    # For receiving InstallationCount data and similar analytics.
 | 
						|
    url('^remotes/server/analytics$', rest_dispatch,
 | 
						|
        {'POST': 'zilencer.views.remote_server_post_analytics'}),
 | 
						|
    url('^remotes/server/analytics/status$', rest_dispatch,
 | 
						|
        {'GET': 'zilencer.views.remote_server_check_analytics'}),
 | 
						|
]
 | 
						|
 | 
						|
urlpatterns = [
 | 
						|
    url(r'^api/v1/', include(v1_api_and_json_patterns)),
 | 
						|
    url(r'^json/', include(v1_api_and_json_patterns)),
 | 
						|
]
 |