annotate Sphinx/source/plugins/delayed-deletion-plugin.rst @ 945:11d7d30ca273

updated auth plugin doc
author Alain Mazy <am@osimis.io>
date Wed, 26 Apr 2023 12:07:30 +0200
parents c3e169fe22da
children 683f238333cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
861
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
1 .. _delayed-deletion-plugin:
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
2
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
3
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
4 Delayed deletion plugin (new in Orthanc 1.11.1)
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
5 ===============================================
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
6
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
7 This page describes the **official sample plugin** that performs
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
8 delayed deletions of storage files.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
9
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
10 On some file systems, the deletion of files can be quite long and therefore,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
11 a ``DELETE`` request on a study with thousands of instances can last minutes.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
12
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
13 The Delayed deletion plugin handles file deletion asynchronously by pushing
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
14 the files to delete into a queue that is handled asynchronously.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
15 This queue is stored in a SQLite DB stored on disk which allows the plugin
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
16 to resume deletions if Orthanc is stopped/restarted while deleting files.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
17
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
18
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
19 Configuration
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
20 -------------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
21
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
22 .. highlight:: json
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
23
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
24 Here's a sample configuration section for this plugin with its default values::
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
25
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 {
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
27 "DelayedDeletion": {
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
28
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 // Enables/disables the plugin
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 "Enable": false,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
31
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 // Delay (in milliseconds) between deletion of 2 files
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 // This avoids overloading Orthanc disk with the deletion
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
34 // of files and leaves room for other operations.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
35 // '0' means no throttling.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 "ThrottleDelayMs": 0,
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
37
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
38 // Force the path of the SQLite DB
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 // By default, this value is generated by the plugin base on
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
40 // the "StorageDirectory" and "DatabaseServerIdentifier"
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 // configurations.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 // If running multiple Orthanc on the same storage, make
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 // sure that they use different "Path" for the DelayedDeletion DB
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 // "Path": "/my/path/delayed-deletion.db"
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
45 }
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
46 }
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
47
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 Working with multiple Orthanc instances
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
49 ---------------------------------------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
50
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
51 When running multiple instance on the same DB (e.g a PostgreSQL DB), each
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
52 Delayed Deletion plugin will maintain its own list of files to delete and
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
53 store it in its own SQLite DB. To make sure each instance has its own
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
54 DB, the plugin uses the ``DatabaseServerIdentifier`` configuration to
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
55 generate the name of the SQLite DB.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
56
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
57
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
58
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
59 Status
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
60 ------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
61
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
62 You can get a progress status of the plugin by calling the ``/delayed-deletion/status`` API route.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
63
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
64
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
65 Compilation
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
66 -----------
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
67
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
68 This plugin is part of the Orthanc core repository and is included in the Orthanc makefile.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
69 It is compiled with Orthanc itself and is distributed together with Orthanc binaries.
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
70
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
71
c3e169fe22da delayed deletion
Alain Mazy <am@osimis.io>
parents:
diff changeset
72