Skip to content

Commit

Permalink
[api] Device location: improve consistency and document #199
Browse files Browse the repository at this point in the history
Closes #199

Co-authored-by: Federico Capoano <federico.capoano@gmail.com>
  • Loading branch information
NoumbissiValere and nemesifier committed Aug 19, 2020
1 parent 822b96c commit 0d81b9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -9,7 +9,10 @@ Version 0.8.0 [unreleased]
- [feature] Added possibility to `extend openwisp-controller <https://github.com/openwisp/openwisp-controller#extending-openwisp-controller>`_
- [support] Increased minimum `django-x509 <https://github.com/openwisp/django-x509>`_ version to 0.7.0
- [change] Increased minimum `django-taggit <https://github.com/jazzband/django-taggit>`_ version to 1.3.0

- [api] Changed API of device_location view for consistency: ``/api/device-location/{id}/``
becomes ``/api/v1/device/{id}/location/``, the old URL is kept for backward compatibility
but will be removed in the future
- [api] Added `API documentation <https://github.com/openwisp/openwisp-controller#geo-app>`_
- improved documentation

Version 0.7.0.post1 [2020-07-01]
Expand Down
8 changes: 7 additions & 1 deletion README.rst
Expand Up @@ -161,7 +161,13 @@ and allows to define the geographic coordinates of the devices,
as well as their indoor coordinates on floorplan images.

This module also provides an API through which mobile devices can update
their coordinates.
their coordinates. See below for further details:

.. code-block:: text
GET /api/v1/device/{id}/location/
PUT /api/v1/device/{id}/location/
Settings
--------
Expand Down
7 changes: 6 additions & 1 deletion openwisp_controller/geo/utils.py
Expand Up @@ -4,8 +4,13 @@
def get_geo_urls(geo_views):
return [
url(
r'^api/device-location/(?P<pk>[^/]+)/$',
r'^api/v1/device/(?P<pk>[^/]+)/location/$',
geo_views.device_location,
name='api_device_location',
),
url(
r'^api/device-location/(?P<pk>[^/]+)/$',
geo_views.device_location,
name='api_device_location_deprecated',
),
]

0 comments on commit 0d81b9a

Please sign in to comment.