changeset 667:be71b56c90ab

example to delete peer/modality using rest
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 30 Apr 2021 07:56:16 +0200
parents 9461a56f225f
children 15a0635eef4b
files Sphinx/source/users/rest.rst
diffstat 1 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/users/rest.rst	Thu Apr 29 14:10:29 2021 +0200
+++ b/Sphinx/source/users/rest.rst	Fri Apr 30 07:56:16 2021 +0200
@@ -433,21 +433,24 @@
 .. highlight:: bash
 
 Such a configuration would enable Orthanc to connect to two other
-Orthanc instances that listens on the
-localhost on the port 8043 & 8044. The peers that are known to Orthanc
-can be queried::
+Orthanc instances that listens on the localhost on the ports 8043
+and 8044. The peers that are known to Orthanc can be queried::
 
     $ curl http://localhost:8042/peers?expand
 
-The peers can then be updated through the API too::
+Instead of using the configuration file, peers can be created or
+updated through the REST API using the ``PUT`` method of HTTP::
 
     $ curl -v -X PUT http://localhost:8042/peers/sample -d '{"Url" : "http://127.0.0.1:8043"}'
 
+One peer can also be removed using the ``DELETE`` method as follows::
+    
+    $ curl -v -X DELETE http://localhost:8042/peers/sample
 
-Note that, by default, peers are stored in Orthanc configuration files
-and are updated in Orthanc memory only.  If you want your modifications
-to be persistent, you should configure Orthanc to store its peers
-in the database.  This is done through this configuration::
+Note that, by default, peers are read from the Orthanc configuration
+files and are updated in Orthanc memory only. If you want your
+modifications to be persistent, you should configure Orthanc to store
+its peers in the database.  This is done through this configuration::
 
     ...
     "OrthancPeersInDatabase" : true,
@@ -562,15 +565,20 @@
 
     $ curl http://localhost:8042/modalities?expand
 
-The modalities can then be updated through the API too::
+Instead of using the configuration file, modalities can be created or
+updated through the REST API using the ``PUT`` method of HTTP::
 
     $ curl -v -X PUT http://localhost:8042/modalities/sample -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}'
 
+One modality can also be removed using the ``DELETE`` method as follows::
+    
+    $ curl -v -X DELETE http://localhost:8042/modalities/sample
 
-Note that, by default, modalities are stored in Orthanc configuration files
-and are updated in Orthanc memory only.  If you want your modifications
-to be persistent, you should configure Orthanc to store its modalities
-in the database.  This is done through this configuration::
+Note that, by default, modalities are read from the Orthanc
+configuration files and are updated in Orthanc memory only. If you
+want your modifications to be persistent, you should configure Orthanc
+to store the modalities in the database.  This is done through this
+configuration::
 
     ...
     "DicomModalitiesInDatabase" : true,