blob: 2a1748cd84ff4367483281c20925547b97826057 [file] [log] [blame]
Dirk Vogt7160b5e2016-10-12 17:04:40 +02001from django.conf.urls import url
Dirk Vogtf2a33422016-10-11 17:17:26 +02002from . import rest_api_devices
3from . import rest_api_crashreports
Dirk Vogtc9e10ab2016-10-12 13:58:15 +02004from . import rest_api_heartbeats
Dirk Vogt7160b5e2016-10-12 17:04:40 +02005from . import rest_api_logfiles
6
Dirk Vogtf130c752016-08-23 14:45:01 +02007
8urlpatterns = [
Dirk Vogt36635692016-10-17 12:19:10 +02009 # crashreports
Dirk Vogt7160b5e2016-10-12 17:04:40 +020010 url(r'^api/v1/crashreports/$',
Dirk Vogte1784882016-10-13 16:09:38 +020011 rest_api_crashreports.ListCreateView.as_view(),
Dirk Vogt7160b5e2016-10-12 17:04:40 +020012 name='api_v1_crashreports'),
Dirk Vogte1784882016-10-13 16:09:38 +020013 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/$',
14 rest_api_crashreports.ListCreateView.as_view(),
15 name='api_v1_crashreports_by_uuid'),
16 url(r'^api/v1/crashreports/(?P<id>[0-9]+)/$',
17 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
18 name='api_v1_crashreport'),
Dirk Vogt0d9d5d22016-10-13 16:17:57 +020019 url(r'^api/v1/devices/(?P<device__uuid>[a-f0-9-]+)/crashreports/' +
Dirk Vogte1784882016-10-13 16:09:38 +020020 '(?P<device_local_id>[0-9]+)/$',
21 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
22 name='api_v1_crashreports_by_uuid'),
Dirk Vogtc9e10ab2016-10-12 13:58:15 +020023
Dirk Vogt36635692016-10-17 12:19:10 +020024 # logfiles
25
26 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/' +
27 '(?P<device_local_id>[0-9]+)/logfile_put/(?P<filename>[^/]+)/$',
28 rest_api_logfiles.logfile_put,
29 name='api_v1_putlogfile_for_device_id'),
30
Dirk Vogt83107df2017-05-02 12:04:19 +020031 url(r'^api/v1/logfiles/$',
32 rest_api_logfiles.ListCreateView.as_view(),
33 name='api_v1_logfiles'),
34 url(r'^api/v1/logfiles/(?P<pk>[0-9]+)/$',
35 rest_api_logfiles.RetrieveUpdateDestroyView.as_view(),
36 name='api_v1_logfiles_by_id'),
Dirk Vogt7160b5e2016-10-12 17:04:40 +020037
Dirk Vogt36635692016-10-17 12:19:10 +020038 # heartbeats
Dirk Vogt7160b5e2016-10-12 17:04:40 +020039 url(r'^api/v1/heartbeats/$',
Dirk Vogte1784882016-10-13 16:09:38 +020040 rest_api_heartbeats.ListCreateView.as_view(),
41 name='api_v1_heartbeats'),
42 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/$',
43 rest_api_heartbeats.ListCreateView.as_view(),
44 name='api_v1_heartbeats_by_uuid'),
45 url(r'^api/v1/heartbeats/(?P<id>[0-9]+)/$',
46 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
47 name='api_v1_heatbeat'),
Dirk Vogt36635692016-10-17 12:19:10 +020048 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/' +
Dirk Vogte1784882016-10-13 16:09:38 +020049 '(?P<device_local_id>[0-9]+)/$',
50 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
51 name='api_v1_heartbeat_by_uuid'),
Dirk Vogtf2a33422016-10-11 17:17:26 +020052
Dirk Vogt36635692016-10-17 12:19:10 +020053 # devices
Dirk Vogt7160b5e2016-10-12 17:04:40 +020054 url(r'^api/v1/devices/$', rest_api_devices.ListCreateDevices.as_view(),
55 name='api_v1_list_devices'),
56 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/$',
57 rest_api_devices.RetrieveUpdateDestroyDevice.as_view(),
58 name='api_v1_retrieve_device'),
Dirk Vogt83107df2017-05-02 12:04:19 +020059 url(r'^api/v1/devices/(?P<uuid>[a-f0-9-]+)/stats/$',
60 rest_api_devices.DeviceStat.as_view(),
61 name='api_v1_retrieve_device_stats'),
Dirk Vogt7160b5e2016-10-12 17:04:40 +020062 url(r'^api/v1/devices/register/$', rest_api_devices.register_device,
63 name='api_v1_register_device'),
Dirk Vogtd1345212016-09-14 14:31:45 +020064]