# HG changeset patch # User Sebastien Jodogne # Date 1619762176 -7200 # Node ID be71b56c90ab8f2741a2503b17684c7f2221523d # Parent 9461a56f225f09179df4f7cc9cfd2a1584a3d361 example to delete peer/modality using rest diff -r 9461a56f225f -r be71b56c90ab Sphinx/source/users/rest.rst --- 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,