Mercurial > hg > orthanc-book
comparison Sphinx/source/users/rest.rst @ 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 | 88503c6e549f |
children | bc8fa2bf4cf7 |
comparison
equal
deleted
inserted
replaced
666:9461a56f225f | 667:be71b56c90ab |
---|---|
431 ... | 431 ... |
432 | 432 |
433 .. highlight:: bash | 433 .. highlight:: bash |
434 | 434 |
435 Such a configuration would enable Orthanc to connect to two other | 435 Such a configuration would enable Orthanc to connect to two other |
436 Orthanc instances that listens on the | 436 Orthanc instances that listens on the localhost on the ports 8043 |
437 localhost on the port 8043 & 8044. The peers that are known to Orthanc | 437 and 8044. The peers that are known to Orthanc can be queried:: |
438 can be queried:: | |
439 | 438 |
440 $ curl http://localhost:8042/peers?expand | 439 $ curl http://localhost:8042/peers?expand |
441 | 440 |
442 The peers can then be updated through the API too:: | 441 Instead of using the configuration file, peers can be created or |
442 updated through the REST API using the ``PUT`` method of HTTP:: | |
443 | 443 |
444 $ curl -v -X PUT http://localhost:8042/peers/sample -d '{"Url" : "http://127.0.0.1:8043"}' | 444 $ curl -v -X PUT http://localhost:8042/peers/sample -d '{"Url" : "http://127.0.0.1:8043"}' |
445 | 445 |
446 | 446 One peer can also be removed using the ``DELETE`` method as follows:: |
447 Note that, by default, peers are stored in Orthanc configuration files | 447 |
448 and are updated in Orthanc memory only. If you want your modifications | 448 $ curl -v -X DELETE http://localhost:8042/peers/sample |
449 to be persistent, you should configure Orthanc to store its peers | 449 |
450 in the database. This is done through this configuration:: | 450 Note that, by default, peers are read from the Orthanc configuration |
451 files and are updated in Orthanc memory only. If you want your | |
452 modifications to be persistent, you should configure Orthanc to store | |
453 its peers in the database. This is done through this configuration:: | |
451 | 454 |
452 ... | 455 ... |
453 "OrthancPeersInDatabase" : true, | 456 "OrthancPeersInDatabase" : true, |
454 ... | 457 ... |
455 | 458 |
560 localhost on the port 2000 & 2001. The modalities that are known to Orthanc | 563 localhost on the port 2000 & 2001. The modalities that are known to Orthanc |
561 can be queried:: | 564 can be queried:: |
562 | 565 |
563 $ curl http://localhost:8042/modalities?expand | 566 $ curl http://localhost:8042/modalities?expand |
564 | 567 |
565 The modalities can then be updated through the API too:: | 568 Instead of using the configuration file, modalities can be created or |
569 updated through the REST API using the ``PUT`` method of HTTP:: | |
566 | 570 |
567 $ curl -v -X PUT http://localhost:8042/modalities/sample -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}' | 571 $ curl -v -X PUT http://localhost:8042/modalities/sample -d '{"AET" : "ORTHANCC", "Host": "127.0.0.1", "Port": 2002}' |
568 | 572 |
569 | 573 One modality can also be removed using the ``DELETE`` method as follows:: |
570 Note that, by default, modalities are stored in Orthanc configuration files | 574 |
571 and are updated in Orthanc memory only. If you want your modifications | 575 $ curl -v -X DELETE http://localhost:8042/modalities/sample |
572 to be persistent, you should configure Orthanc to store its modalities | 576 |
573 in the database. This is done through this configuration:: | 577 Note that, by default, modalities are read from the Orthanc |
578 configuration files and are updated in Orthanc memory only. If you | |
579 want your modifications to be persistent, you should configure Orthanc | |
580 to store the modalities in the database. This is done through this | |
581 configuration:: | |
574 | 582 |
575 ... | 583 ... |
576 "DicomModalitiesInDatabase" : true, | 584 "DicomModalitiesInDatabase" : true, |
577 ... | 585 ... |
578 | 586 |