Mitja Nikolaus | 6a67913 | 2018-08-30 14:35:29 +0200 | [diff] [blame] | 1 | """URLs for accessing devices, crashreports, logfiles and heartbeats.""" |
| 2 | |
Dirk Vogt | 7160b5e | 2016-10-12 17:04:40 +0200 | [diff] [blame] | 3 | from django.conf.urls import url |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 4 | from . import rest_api_devices |
| 5 | from . import rest_api_crashreports |
Dirk Vogt | c9e10ab | 2016-10-12 13:58:15 +0200 | [diff] [blame] | 6 | from . import rest_api_heartbeats |
Dirk Vogt | 7160b5e | 2016-10-12 17:04:40 +0200 | [diff] [blame] | 7 | from . import rest_api_logfiles |
| 8 | |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 9 | |
| 10 | urlpatterns = [ |
Dirk Vogt | 3663569 | 2016-10-17 12:19:10 +0200 | [diff] [blame] | 11 | # crashreports |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 12 | url( |
| 13 | r"^api/v1/crashreports/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 14 | rest_api_crashreports.ListCreateView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 15 | name="api_v1_crashreports", |
| 16 | ), |
| 17 | url( |
| 18 | r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 19 | rest_api_crashreports.ListCreateView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 20 | name="api_v1_crashreports_by_uuid", |
| 21 | ), |
| 22 | url( |
| 23 | r"^api/v1/crashreports/(?P<id>[0-9]+)/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 24 | rest_api_crashreports.RetrieveUpdateDestroyView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 25 | 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 Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 30 | rest_api_crashreports.RetrieveUpdateDestroyView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 31 | name="api_v1_crashreport_by_uuid", |
| 32 | ), |
Dirk Vogt | 3663569 | 2016-10-17 12:19:10 +0200 | [diff] [blame] | 33 | # logfiles |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 34 | url( |
| 35 | r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/crashreports/" |
| 36 | + "(?P<device_local_id>[0-9]+)/logfile_put/(?P<filename>[^/]+)/$", |
Dirk Vogt | 3663569 | 2016-10-17 12:19:10 +0200 | [diff] [blame] | 37 | rest_api_logfiles.logfile_put, |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 38 | name="api_v1_putlogfile_for_device_id", |
| 39 | ), |
| 40 | url( |
| 41 | r"^api/v1/logfiles/$", |
Mitja Nikolaus | 0343baf | 2018-09-03 11:56:31 +0200 | [diff] [blame] | 42 | rest_api_logfiles.ListView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 43 | name="api_v1_logfiles", |
| 44 | ), |
| 45 | url( |
| 46 | r"^api/v1/logfiles/(?P<pk>[0-9]+)/$", |
Dirk Vogt | 83107df | 2017-05-02 12:04:19 +0200 | [diff] [blame] | 47 | rest_api_logfiles.RetrieveUpdateDestroyView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 48 | name="api_v1_logfiles_by_id", |
| 49 | ), |
Dirk Vogt | 3663569 | 2016-10-17 12:19:10 +0200 | [diff] [blame] | 50 | # heartbeats |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 51 | url( |
| 52 | r"^api/v1/heartbeats/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 53 | rest_api_heartbeats.ListCreateView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 54 | name="api_v1_heartbeats", |
| 55 | ), |
| 56 | url( |
| 57 | r"^api/v1/devices/(?P<uuid>[a-f0-9-]+)/heartbeats/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 58 | rest_api_heartbeats.ListCreateView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 59 | name="api_v1_heartbeats_by_uuid", |
| 60 | ), |
| 61 | url( |
| 62 | r"^api/v1/heartbeats/(?P<id>[0-9]+)/$", |
Dirk Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 63 | rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 64 | 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 Vogt | e178488 | 2016-10-13 16:09:38 +0200 | [diff] [blame] | 69 | rest_api_heartbeats.RetrieveUpdateDestroyView.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 70 | name="api_v1_heartbeat_by_uuid", |
| 71 | ), |
Dirk Vogt | 3663569 | 2016-10-17 12:19:10 +0200 | [diff] [blame] | 72 | # devices |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 73 | 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 Vogt | 7160b5e | 2016-10-12 17:04:40 +0200 | [diff] [blame] | 80 | rest_api_devices.RetrieveUpdateDestroyDevice.as_view(), |
Mitja Nikolaus | cb50f2c | 2018-08-24 13:54:48 +0200 | [diff] [blame] | 81 | 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 Vogt | d134521 | 2016-09-14 14:31:45 +0200 | [diff] [blame] | 88 | ] |