implement check API route for automation
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
3d2849dddc
commit
b4909ce192
|
@ -19,3 +19,11 @@ This plugin requries one environment variable:
|
|||
```sh
|
||||
STATUS_GO_CANARY_PATH=<path_to_status_go_canary_binary>
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
The plugin exposes the standard check API under:
|
||||
```
|
||||
/plugins/cabot_check_status_go/api/status_go_checks/
|
||||
```
|
||||
Which accepts the standard `GET`/`POST`/`OPTIONS` methods.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import socket
|
||||
import logging
|
||||
import subprocess
|
||||
from os import path
|
||||
from os import environ as env
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
from django.conf.urls import url
|
||||
from django.conf.urls import include, url
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from cabot.rest_urls import create_viewset, status_check_fields
|
||||
|
||||
from .views import (StatusGoCheckCreateView, StatusGoCheckUpdateView, duplicate_check)
|
||||
from .models import StatusGoStatusCheck
|
||||
|
||||
api_router = DefaultRouter()
|
||||
api_router.register(r'status_go_checks', create_viewset(
|
||||
arg_model=StatusGoStatusCheck,
|
||||
arg_fields=status_check_fields + (
|
||||
'node_type',
|
||||
'enode',
|
||||
),
|
||||
))
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
|
@ -14,6 +27,7 @@ urlpatterns = [
|
|||
|
||||
url(r'^statusgocheck/duplicate/(?P<pk>\d+)/',
|
||||
view=duplicate_check,
|
||||
name='duplicate-status-go-check')
|
||||
name='duplicate-status-go-check'),
|
||||
|
||||
url(r'^api/', include(api_router.urls)),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue