Remove unneeded views
This commit is contained in:
parent
c23f44d7b7
commit
b286c80754
9
GUIDE.md
9
GUIDE.md
@ -211,19 +211,18 @@ Fortunately, Shynet offers a simple method you can call from anywhere within you
|
|||||||
|
|
||||||
### API
|
### 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
|
* `uuid` - to get data only from one service
|
||||||
* `startDate` - to set start date in format YYYY-MM-DD
|
* `startDate` - to set start date in format YYYY-MM-DD
|
||||||
* `endDate` - to set end 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:
|
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:
|
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'```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -26,11 +26,6 @@ urlpatterns = [
|
|||||||
views.ServiceSessionView.as_view(),
|
views.ServiceSessionView.as_view(),
|
||||||
name="service_session",
|
name="service_session",
|
||||||
),
|
),
|
||||||
path(
|
|
||||||
"api-settings/",
|
|
||||||
views.ApiSettingsView.as_view(),
|
|
||||||
name="api_settings",
|
|
||||||
),
|
|
||||||
path(
|
path(
|
||||||
"api-token-refresh/",
|
"api-token-refresh/",
|
||||||
views.RefreshApiTokenView.as_view(),
|
views.RefreshApiTokenView.as_view(),
|
||||||
|
@ -157,10 +157,6 @@ class ServiceSessionView(LoginRequiredMixin, PermissionRequiredMixin, DetailView
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
class ApiSettingsView(LoginRequiredMixin, TemplateView):
|
|
||||||
template_name = "dashboard/pages/api_settings.html"
|
|
||||||
|
|
||||||
|
|
||||||
class RefreshApiTokenView(LoginRequiredMixin, View):
|
class RefreshApiTokenView(LoginRequiredMixin, View):
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
request.user.api_token = _default_api_token()
|
request.user.api_token = _default_api_token()
|
||||||
|
@ -25,5 +25,5 @@ urlpatterns = [
|
|||||||
path("dashboard/", include(("dashboard.urls", "dashboard"), namespace="dashboard")),
|
path("dashboard/", include(("dashboard.urls", "dashboard"), namespace="dashboard")),
|
||||||
path("healthz/", include("health_check.urls")),
|
path("healthz/", include("health_check.urls")),
|
||||||
path("", include(("core.urls", "core"), namespace="core")),
|
path("", include(("core.urls", "core"), namespace="core")),
|
||||||
path("api/", include(("api.urls", "api"), namespace="api")),
|
path("api/v1/", include(("api.urls", "api"), namespace="api")),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user