Remove unneeded views

This commit is contained in:
R. Miles McCain 2022-08-28 15:07:05 -07:00
parent c23f44d7b7
commit b286c80754
4 changed files with 5 additions and 15 deletions

View File

@ -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 <user API 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 <user API 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'```
---

View File

@ -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(),

View File

@ -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()

View File

@ -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")),
]