From b286c80754e7973a9487c3f218205780777546b0 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Sun, 28 Aug 2022 15:07:05 -0700 Subject: [PATCH] Remove unneeded views --- GUIDE.md | 9 ++++----- shynet/dashboard/urls.py | 5 ----- shynet/dashboard/views.py | 4 ---- shynet/shynet/urls.py | 2 +- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/GUIDE.md b/GUIDE.md index be2ef7f..2b67ce3 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -211,19 +211,18 @@ Fortunately, Shynet offers a simple method you can call from anywhere within you ### API -All the information displayed on the dashboard can be obtained via API on url ```//shynet.example.com/api/dashboard/```. By default this endpoint will return the full data from all services over the last last 30 days. The `Authentication` header should be set to use user's parsonal API token (```'Authorization: Token '```). +All the information displayed on the dashboard can be obtained via API on url ```//shynet.example.com/api/v1/dashboard/```. By default this endpoint will return the full data from all services over the last last 30 days. The `Authentication` header should be set to use user's parsonal API token (```'Authorization: Token '```). -There are 4 optional query parameters: +There are 3 optional query parameters: * `uuid` - to get data only from one service * `startDate` - to set start date in format YYYY-MM-DD * `endDate` - to set end date in format YYYY-MM-DD - * `basic` - to get only basic data set to '1' or 'true' Example in HTTPie: -```http get '//shynet.example.com/api/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01&basic=1' 'Authorization:Token {{user_api_token}}'``` +```http get '//shynet.example.com/api/v1/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01' 'Authorization:Token {{user_api_token}}'``` Example in cURL: -```curl -H 'Authorization:Token {{user_api_token}}' '//shynet.example.com/api/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01&basic=1'``` +```curl -H 'Authorization:Token {{user_api_token}}' '//shynet.example.com/api/v1/dashboard/?uuid={{service_uuid}}&startDate=2021-01-01&endDate=2050-01-01'``` --- diff --git a/shynet/dashboard/urls.py b/shynet/dashboard/urls.py index e107a13..7aa917b 100644 --- a/shynet/dashboard/urls.py +++ b/shynet/dashboard/urls.py @@ -26,11 +26,6 @@ urlpatterns = [ views.ServiceSessionView.as_view(), name="service_session", ), - path( - "api-settings/", - views.ApiSettingsView.as_view(), - name="api_settings", - ), path( "api-token-refresh/", views.RefreshApiTokenView.as_view(), diff --git a/shynet/dashboard/views.py b/shynet/dashboard/views.py index 080e05d..8039430 100644 --- a/shynet/dashboard/views.py +++ b/shynet/dashboard/views.py @@ -157,10 +157,6 @@ class ServiceSessionView(LoginRequiredMixin, PermissionRequiredMixin, DetailView return data -class ApiSettingsView(LoginRequiredMixin, TemplateView): - template_name = "dashboard/pages/api_settings.html" - - class RefreshApiTokenView(LoginRequiredMixin, View): def get(self, request): request.user.api_token = _default_api_token() diff --git a/shynet/shynet/urls.py b/shynet/shynet/urls.py index 71aabe6..cbec472 100644 --- a/shynet/shynet/urls.py +++ b/shynet/shynet/urls.py @@ -25,5 +25,5 @@ urlpatterns = [ path("dashboard/", include(("dashboard.urls", "dashboard"), namespace="dashboard")), path("healthz/", include("health_check.urls")), path("", include(("core.urls", "core"), namespace="core")), - path("api/", include(("api.urls", "api"), namespace="api")), + path("api/v1/", include(("api.urls", "api"), namespace="api")), ]