blob: 53a5270023c2ce09cd030033d3d4bb4d60051550 [file] [log] [blame]
Mitja Nikolaus6a679132018-08-30 14:35:29 +02001"""URLs for accessing devices, crashreports, logfiles and heartbeats."""
2
Dirk Vogt7160b5e2016-10-12 17:04:40 +02003from django.conf.urls import url
Dirk Vogtf2a33422016-10-11 17:17:26 +02004from . import rest_api_devices
5from . import rest_api_crashreports
Dirk Vogtc9e10ab2016-10-12 13:58:15 +02006from . import rest_api_heartbeats
Dirk Vogt7160b5e2016-10-12 17:04:40 +02007from . import rest_api_logfiles
8
Dirk Vogtf130c752016-08-23 14:45:01 +02009
10urlpatterns = [
Dirk Vogt36635692016-10-17 12:19:10 +020011 # crashreports
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020012 url(
13 r"^api/v1/crashreports/$",
Dirk Vogte1784882016-10-13 16:09:38 +020014 rest_api_crashreports.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020015 name="api_v1_crashreports",
16 ),
17 url(
18 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/$",
Dirk Vogte1784882016-10-13 16:09:38 +020019 rest_api_crashreports.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020020 name="api_v1_crashreports_by_uuid",
21 ),
22 url(
23 r"^api/v1/crashreports/(?P<id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020024 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020025 name="api_v1_crashreport",
26 ),
27 url(
28 r"^api/v1/devices/(?P<device__uuid>[a-f0-9-]+)/crashreports/"
29 + "(?P<device_local_id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020030 rest_api_crashreports.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020031 name="api_v1_crashreport_by_uuid",
32 ),
Dirk Vogt36635692016-10-17 12:19:10 +020033 # logfiles
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020034 url(
35 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/"
36 + "(?P<device_local_id>[0-9]+)/logfile_put/(?P<filename>[^/]+)/$",
Dirk Vogt36635692016-10-17 12:19:10 +020037 rest_api_logfiles.logfile_put,
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020038 name="api_v1_putlogfile_for_device_id",
39 ),
40 url(
41 r"^api/v1/logfiles/$",
Mitja Nikolaus0343baf2018-09-03 11:56:31 +020042 rest_api_logfiles.ListView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020043 name="api_v1_logfiles",
44 ),
45 url(
46 r"^api/v1/logfiles/(?P<pk>[0-9]+)/$",
Dirk Vogt83107df2017-05-02 12:04:19 +020047 rest_api_logfiles.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020048 name="api_v1_logfiles_by_id",
49 ),
Dirk Vogt36635692016-10-17 12:19:10 +020050 # heartbeats
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020051 url(
52 r"^api/v1/heartbeats/$",
Dirk Vogte1784882016-10-13 16:09:38 +020053 rest_api_heartbeats.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020054 name="api_v1_heartbeats",
55 ),
56 url(
57 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/$",
Dirk Vogte1784882016-10-13 16:09:38 +020058 rest_api_heartbeats.ListCreateView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020059 name="api_v1_heartbeats_by_uuid",
60 ),
61 url(
62 r"^api/v1/heartbeats/(?P<id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020063 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020064 name="api_v1_heartbeat",
65 ),
66 url(
67 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/"
68 + "(?P<device_local_id>[0-9]+)/$",
Dirk Vogte1784882016-10-13 16:09:38 +020069 rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020070 name="api_v1_heartbeat_by_uuid",
71 ),
Dirk Vogt36635692016-10-17 12:19:10 +020072 # devices
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020073 url(
74 r"^api/v1/devices/$",
75 rest_api_devices.ListCreateDevices.as_view(),
76 name="api_v1_list_devices",
77 ),
78 url(
79 r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/$",
Dirk Vogt7160b5e2016-10-12 17:04:40 +020080 rest_api_devices.RetrieveUpdateDestroyDevice.as_view(),
Mitja Nikolauscb50f2c2018-08-24 13:54:48 +020081 name="api_v1_retrieve_device",
82 ),
83 url(
84 r"^api/v1/devices/register/$",
85 rest_api_devices.register_device,
86 name="api_v1_register_device",
87 ),
Dirk Vogtd1345212016-09-14 14:31:45 +020088]