TheThingsIndustries / lorawan-stack-docs

Documentation for The Things Stack
Apache License 2.0
32 stars 65 forks source link

Document soft deleted entities restoration restrictions in The Things Stack #1165

Closed ymgupta closed 1 year ago

ymgupta commented 1 year ago

Summary

In The Things Stack, once entities are soft deleted, they will move to the Deleted (Admin) section within The Things Stack Console. Restoring the entity's access is possible with the admin user account only. If the user hasn't attempted to restore the entities within the 24-hour period, the entity cannot be restored.

Why do we need this ?

To assist users in restoring the accidentally deleted entities in The Things Stack.

What is already there? What do you see now?

Purging Entities

What is missing? What do you want to see?

Add the Information about restoring soft deleted entities in The Things Stack.

How do you propose to document this?

Insights:

Can you do this yourself and submit a Pull Request?

No, @nejraselimovic

nejraselimovic commented 1 year ago

Is it possible to soft delete and restore end devices? I don't see this panel for devices

nejraselimovic commented 1 year ago

Also, is it possible to see soft-deleted apps and gateways? Like for users we have:

ttn-lw-cli user list --deleted --all

If I replace users with applicationfor example, I get this:

error:pkg/identityserver/store:account_not_found (user account with idsnejranot found)

Not sure if I'm trying something that's not really possible.. @nicholaspcr

nicholaspcr commented 1 year ago

Is it possible to soft delete and restore end devices? I don't see this panel for devices

It is not possible to restore deleted end-devices, as those are not soft-deleted but permanently deleted.

Also, is it possible to see soft-deleted apps and gateways? Like for users we have:

ttn-lw-cli user list --deleted --all

If I replace users with applicationfor example, I get this:

error:pkg/identityserver/store:account_not_found (user account with idsnejranot found)

Not sure if I'm trying something that's not really possible.. @nicholaspcr

It should be possible and what you described is a bug (thanks for finding it), I did a bit of debugging and will do a fix for it that should be available in v3.28.0. Probably worth adding the usage of it in the documentation.

While the fix is still in progress the expected output of the command with the --deleted flag has an additional field which is deleted_at.

Example:

go run ./cmd/ttn-lw-cli app list --deleted
INFO    Telemetry is enabled. Check the documentation for more information on what is collected and how to disable it   {"documentation_url": "https://www.thethingsindustries.com/docs/reference/telemetry/cli"}
INFO    Use the flags "--limit=0 --page=1" to get the next page of results      {"total": 1}
[{
  "ids": {
    "application_id": "app-1"
  },
  "created_at": "2023-09-25T10:59:42.150922Z",
  "updated_at": "2023-09-25T10:59:42.150922Z",
  "deleted_at": "2023-09-25T10:59:51.776821Z"
}]