Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use django-rest-framework for processor views.
- Make endpoints more RESTful. - Return HTTP 202 Accepted for creating and deleting datasets. - Use DELETE method to delete datasets. - Use status code instead of {"status": "ok"}. - Return empty dict instead of None or int.
- Loading branch information
1 parent
27fec76
commit 6ecab3d
Showing
8 changed files
with
165 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
from django.urls import path | ||
from django.urls import include, path | ||
from processor import views | ||
from rest_framework.routers import SimpleRouter | ||
|
||
from .views import ( | ||
create_dataset_filter, | ||
dataset_availability, | ||
dataset_id, | ||
dataset_metadata, | ||
dataset_progress, | ||
dataset_start, | ||
dataset_wipe, | ||
) | ||
router = SimpleRouter() | ||
router.register(r"datasets", views.DatasetViewSet, basename="dataset") | ||
|
||
urlpatterns = [ | ||
path("api/create_dataset_filter", create_dataset_filter, name="create_dataset_filter"), | ||
path("api/dataset_status/<dataset_id>", dataset_progress, name="dataset_status"), | ||
path("api/dataset_id", dataset_id, name="dataset_id"), | ||
path("api/dataset_availability/<dataset_id>", dataset_availability, name="dataset_availability"), | ||
path("api/dataset_metadata/<dataset_id>", dataset_metadata, name="dataset_metadata"), | ||
path("api/dataset_start", dataset_start, name="dataset_start"), | ||
path("api/dataset_wipe", dataset_wipe, name="dataset_wipe"), | ||
path("api/create_dataset_filter", views.create_dataset_filter, name="create_dataset_filter"), | ||
path("", include(router.urls)), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.