blob: b876aaf7900f04add59ba6563f3667f1cd0023d0 [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
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020010 url(
11 r"^api/v1/crashreports/$",
Dirk Vogte1784882016-10-13 16:09:38 +020012 rest_api_crashreports.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020013 name="api_v1_crashreports",
14 ),
15 url(
16 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/$",
Dirk Vogte1784882016-10-13 16:09:38 +020017 rest_api_crashreports.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020018 name="api_v1_crashreports_by_uuid",
19 ),
20 url(
21 r"^api/v1/crashreports/(?P<id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020022 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020023 name="api_v1_crashreport",
24 ),
25 url(
26 r"^api/v1/devices/(?P<device__uuid>[a-f0-9-]+)/crashreports/"
27 + "(?P<device_local_id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020028 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020029 name="api_v1_crashreport_by_uuid",
30 ),
Dirk Vogt36635692016-10-17 12:19:10 +020031 # logfiles
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020032 url(
33 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/"
34 + "(?P<device_local_id>[0-9]+)/logfile_put/(?P<filename>[^/]+)/$",
Dirk Vogt36635692016-10-17 12:19:10 +020035 rest_api_logfiles.logfile_put,
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020036 name="api_v1_putlogfile_for_device_id",
37 ),
38 url(
39 r"^api/v1/logfiles/$",
40 rest_api_logfiles.ListCreateView.as_view(),
41 name="api_v1_logfiles",
42 ),
43 url(
44 r"^api/v1/logfiles/(?P<pk>[0-9]+)/$",
Dirk Vogt83107df2017-05-02 12:04:19 +020045 rest_api_logfiles.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020046 name="api_v1_logfiles_by_id",
47 ),
Dirk Vogt36635692016-10-17 12:19:10 +020048 # heartbeats
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020049 url(
50 r"^api/v1/heartbeats/$",
Dirk Vogte1784882016-10-13 16:09:38 +020051 rest_api_heartbeats.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020052 name="api_v1_heartbeats",
53 ),
54 url(
55 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/$",
Dirk Vogte1784882016-10-13 16:09:38 +020056 rest_api_heartbeats.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020057 name="api_v1_heartbeats_by_uuid",
58 ),
59 url(
60 r"^api/v1/heartbeats/(?P<id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020061 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020062 name="api_v1_heartbeat",
63 ),
64 url(
65 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/"
66 + "(?P<device_local_id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020067 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020068 name="api_v1_heartbeat_by_uuid",
69 ),
Dirk Vogt36635692016-10-17 12:19:10 +020070 # devices
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020071 url(
72 r"^api/v1/devices/$",
73 rest_api_devices.ListCreateDevices.as_view(),
74 name="api_v1_list_devices",
75 ),
76 url(
77 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/$",
Dirk Vogt7160b5e2016-10-12 17:04:40 +020078 rest_api_devices.RetrieveUpdateDestroyDevice.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020079 name="api_v1_retrieve_device",
80 ),
81 url(
82 r"^api/v1/devices/register/$",
83 rest_api_devices.register_device,
84 name="api_v1_register_device",
85 ),
Dirk Vogtd1345212016-09-14 14:31:45 +020086]