Add some API endpoints

Add:

/api/config/ to display all engines, and all books
/api/config/<engine>/ to display the config for a specific engine
/api/networks/<engine>/ list all of the networks, and the default, for an engine
/api/networks/<engine>/<sha|name>/ download a network, given the sha or the name
This commit is contained in:
andrew committed 2023-09-25 17:00:07 -04:00
1 parent 7c3f4a7203
commit 3cff04bab1
2 files changed
+92

No files matched your search

+6
View File
@@ -79,6 +79,12 @@ urlpatterns = [
django.urls.path(r'clientSubmitError/', OpenBench.views.client_submit_error),
django.urls.path(r'clientSubmitResults/', OpenBench.views.client_submit_results),
# Nice endpoints, which can be hit from the website or with credentials cleanly
django.urls.path(r'api/config/', OpenBench.views.api_configs),
django.urls.path(r'api/config/<str:engine>/', OpenBench.views.api_configs),
django.urls.path(r'api/networks/<str:engine>/', OpenBench.views.api_networks),
django.urls.path(r'api/networks/<str:engine>/<str:identifier>/', OpenBench.views.api_network_download),
# Redirect anything else to the Index
django.urls.path(r'', OpenBench.views.index),