Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d0ee324
[feature] Implemented device deactivation and reactivation #625
pandafy Feb 29, 2024
a8aa0b5
[feature] Do not delete related Certs when device is deactivated
pandafy Feb 29, 2024
6bdffdc
[feature] Set device status to deactivated if current status is deact…
pandafy Feb 29, 2024
259f31f
[fix] Fixed readonlyfields for ConfigInline
pandafy Feb 29, 2024
f47edd2
[feature] Return 404 checksum for deactivated devices
pandafy Feb 29, 2024
8c60f7d
[tests] Added test for device controller views
pandafy Mar 1, 2024
778a729
[feature] Added activate and deactivate button on the device page
pandafy Mar 1, 2024
a08c85e
[chores] Added migrations for Config.status
pandafy Mar 1, 2024
0af9d2d
[chores] Added migrations for sample app
pandafy Mar 1, 2024
834c822
[tests] Fixed tests
pandafy Mar 1, 2024
df822ce
[qa] Fixed QA issues
pandafy Mar 1, 2024
5f2a0a3
[fix] Fixed issues with DeviceAdmin.get_extra_context
pandafy Mar 1, 2024
318b169
[feature] Added "config_deactivating" signal
pandafy Mar 1, 2024
02395be
[admin] Added error handling to activate and deactivate actions
pandafy Mar 4, 2024
332cf50
[change] Show delete action after deactivate action
pandafy Mar 5, 2024
8bc75f1
[feature] Emit device_deactivated signal when device is deactivated
pandafy Mar 5, 2024
eb363d1
[fix] Fixed activate button on top submitting device-form
pandafy Mar 5, 2024
b2e8325
[req-changes] Added deactivated warning message to device's change page
pandafy Mar 7, 2024
091de5e
[change] Upadted Config.status helptext
pandafy Mar 7, 2024
6da3756
[fix] Don't show any extra form on deactivated devices
pandafy Mar 7, 2024
eb6c36d
[tests] Added admin tests for device change page
pandafy Mar 7, 2024
7b6ab6b
[refactor] Refactored logic for sending activate/deactivate message t…
pandafy Mar 7, 2024
8dc6096
[tests] Added test for device changelist admin action
pandafy Mar 7, 2024
acde704
[temp] Upgraded openwisp-utils
pandafy Mar 7, 2024
8df3e0b
[chores] Added migrations
pandafy Mar 7, 2024
a6148b4
[chores] Upgraded openwisp-utils
pandafy Mar 7, 2024
5339254
[chores] Fixed formatting
pandafy Mar 7, 2024
2710b46
[req-changes] Updated config status on device admin
pandafy Apr 4, 2024
b6b3fac
[req-changes] Refactored code for device status message
pandafy Apr 4, 2024
6942cac
[req-changes] Display warning when user delete active devices from ad…
pandafy Apr 5, 2024
3e8bcf7
[chores] Miscellaneous uppdates
pandafy Aug 1, 2024
3c6b551
[fix] Fixed selenium test
pandafy Aug 1, 2024
de5a90a
WIP: 6eea7bc2 [fix] Fixed selenium test
pandafy Aug 2, 2024
bdb4485
[fix] Fixed implementation of submit inline buttons
pandafy Aug 2, 2024
26f058a
[tests] Fixed tests
pandafy Aug 2, 2024
e2edfb6
[req-changes] Formatted code and updated docs
pandafy Aug 8, 2024
ecccf77
[change] Clear management IP when device is deactivated
pandafy Aug 8, 2024
1d43fb5
[change] Added API endpoints for activating/deactivating device
pandafy Aug 8, 2024
56e801c
[change] Updated device delete API endpoint
pandafy Aug 8, 2024
5d7f122
[change] Disable API operations on deactivated devices
pandafy Aug 9, 2024
13c6783
[tests] Fixed tests
pandafy Aug 9, 2024
2523671
Merge branch 'master' into issues/625-device-deactivation
nemesifier Nov 7, 2024
1afd75a
[ci] Removed branched openwisp-utils
nemesifier Nov 7, 2024
924c1d3
[tests] Fixed failing tests
pandafy Nov 8, 2024
c1849b1
[req-changes] Clear management IP after device is deactivated
pandafy Nov 11, 2024
10ef8df
[req-change] Eliminated extra query
pandafy Nov 11, 2024
e358125
[req-changes] Fixed colors
pandafy Nov 13, 2024
81d7106
[fix] Added "device_activated" signal
pandafy Nov 14, 2024
e1e97fc
[fix] Fixed edge cases
pandafy Nov 15, 2024
ca8eab9
[req-changes] Added device config status
pandafy Nov 19, 2024
8561843
[req-changes] Updated API docs
pandafy Nov 19, 2024
a94f851
[fix] Don't allow PUT/PATCH request for deactivated device
pandafy Nov 19, 2024
8c12801
[docs] Minor docs improvements
nemesifier Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/developer/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,55 @@ object are changed, but only on ``post_add`` or ``post_remove`` actions,
``post_clear`` is ignored for the same reason explained in the previous
section.

``config_deactivating``
~~~~~~~~~~~~~~~~~~~~~~~

**Path**: ``openwisp_controller.config.signals.config_deactivating``

**Arguments**:

- ``instance``: instance of the object being deactivated
- ``previous_status``: previous status of the object before deactivation

This signal is emitted when a configuration status of device is set to
``deactivating``.

``config_deactivated``
~~~~~~~~~~~~~~~~~~~~~~

**Path**: ``openwisp_controller.config.signals.config_deactivated``

**Arguments**:

- ``instance``: instance of the object being deactivated
- ``previous_status``: previous status of the object before deactivation

This signal is emitted when a configuration status of device is set to
``deactivated``.

``device_deactivated``
~~~~~~~~~~~~~~~~~~~~~~

**Path**: ``openwisp_controller.config.signals.device_deactivated``

**Arguments**:

- ``instance``: instance of the device being deactivated

This signal is emitted when a device is flagged for deactivation.

``device_activated``
~~~~~~~~~~~~~~~~~~~~

**Path**: ``openwisp_controller.config.signals.device_activated``

**Arguments**:

- ``instance``: instance of the device being activated

This signal is emitted when a device is flagged for activation (after
deactivation).

.. _config_backend_changed:

``config_backend_changed``
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ the OpenWISP architecture.
:maxdepth: 1

user/intro.rst
user/device-config-status.rst
user/templates.rst
user/variables.rst
user/device-groups.rst
Expand Down
38 changes: 38 additions & 0 deletions docs/user/device-config-status.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Device Configuration Status
===========================

The device's configuration status (`Device.config.status`) indicates the
current state of the configuration as managed by OpenWISP. The possible
statuses and their meanings are explained below.

``modified``
------------

The device configuration has been updated in OpenWISP, but these changes
have not yet been applied to the device. The device is pending an update.

``applied``
-----------

The device has successfully applied the configuration changes made in
OpenWISP. The current configuration on the device matches the latest
changes.

``error``
---------

An issue occurred while applying the configuration to the device, causing
the device to revert to its previous working configuration.

``deactivating``
----------------

The device is in the process of being deactivated. The configuration is
scheduled to be removed from the device.

``deactivated``
---------------

The device has been deactivated. The configuration applied through
OpenWISP has been removed, and any other operation to manage the device
will be prevented or rejected.
19 changes: 19 additions & 0 deletions docs/user/rest-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,29 @@ from the config of a device,
Delete Device
~~~~~~~~~~~~~

.. note::

A device must be deactivated before it can be deleted. Otherwise, an
``HTTP 403 Forbidden`` response will be returned.

.. code-block:: text

DELETE /api/v1/controller/device/{id}/

Deactivate Device
~~~~~~~~~~~~~~~~~

.. code-block:: text

POST /api/v1/controller/device/{id}/deactivate/

Activate Device
~~~~~~~~~~~~~~~

.. code-block:: text

POST /api/v1/controller/device/{id}/activate/

List Device Connections
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
Loading