@@ -604,105 +604,189 @@ class Config(BaseAPI):
604604 prefix = '/rest/config/'
605605
606606 def config (self ):
607+ """ Returns the full config
608+ """
607609 return self .get ('' )
608610
609611 def put_config (self , config ):
612+ """ Replaces the entire object
613+ """
610614 return self .put ('' , data = config )
611615
612616 def restart_required (self ):
617+ """ Returns whether a restart of Syncthing is required for the current config to take effect
618+ """
613619 return self .get ('restart-required' )
614620
615621 def folders (self , id = None ):
622+ """ Returns all folders. Optionally supply an ID to return the folder matching that ID
623+ """
616624 if (id ):
617625 return self .get ('folders/' + id )
618626 else :
619627 return self .get ('folders' )
620628
621629 def put_folders (self , config , id = None ):
630+ """ Replaces the entire object
631+ """
622632 if (id ):
623633 return self .put ('folders/' + id , data = config )
624634 else :
625635 return self .put ('folders' , data = config )
626636
627637 def post_folders (self , config ):
638+ """ Add a single folder
639+ """
628640 return self .post ('folders' , data = config )
629641
630642 def patch_folders (self , config , id ):
643+ """ Replaces only the given child objects
644+ """
631645 return self .patch ('folders/' + id , data = config )
632646
633647 def delete_folders (self , id ):
648+ """ Delete a single folder matching the given ID
649+ """
634650 return self .delete ('folders/' + id )
635651
636652 def devices (self , id = None ):
653+ """ Returns all devices. Optionally specificy an ID to return a single object
654+ """
637655 if (id ):
638656 return self .get ('devices/' + id )
639657 else :
640658 return self .get ('devices' )
641659
642660 def put_devices (self , config , id = None ):
661+ """ Replaces the entire object
662+ """
643663 if (id ):
644664 return self .put ('devices/' + id , data = config )
645665 else :
646666 return self .put ('devices' , data = config )
647667
648668 def post_devices (self , config ):
669+ """ Add a single devices
670+ """
649671 return self .post ('devices' , data = config )
650672
651673 def patch_devices (self , config , id ):
674+ """ Replaces only the given child objects
675+ """
652676 return self .patch ('devices/' + id , data = config )
653677
654678 def delete_devices (self , id ):
679+ """ Delete a device with a given ID
680+ """
655681 return self .delete ('devices/' + id )
656682
657683 def defaults_folder (self ):
684+ """ Get default folder object
685+
686+ Returns:
687+ dict
688+ """
658689 return self .get ('defaults/folder' )
659690
660691 def put_defaults_folder (self , config ):
692+ """ Replaces the entire object
693+ """
661694 return self .put ('defaults/folder' , data = config )
662695
663696 def patch_defaults_folder (self , config ):
697+ """ Replaces only the given child objects
698+ """
664699 return self .patch ('defaults/folder' , data = config )
665700
666701 def defaults_device (self ):
702+ """ Get default device object
703+
704+ Returns:
705+ dict
706+ """
667707 return self .get ('defaults/device' )
668708
669709 def put_defaults_device (self , config ):
710+ """ Replaces the entire object
711+ """
670712 return self .put ('defaults/device' , data = config )
671713
672714 def patch_defaults_device (self , config ):
715+ """ Replaces only the given child objects
716+ """
673717 return self .patch ('defaults/device' , data = config )
674718
675719 def defaults_ignores (self ):
720+ """ Get default ignores object
721+
722+ Returns:
723+ dict
724+ """
676725 return self .get ('defaults/ignores' )
677726
678727 def put_defaults_ignores (self , config ):
728+ """ Replaces the entire object
729+ """
679730 return self .put ('defaults/ignores' , data = config )
680731
681732 def options (self ):
733+ """ Get default options object
734+
735+ Returns:
736+ dict
737+ """
682738 return self .get ('options' )
683739
684740 def put_options (self , config ):
741+ """ Replaces the entire object
742+ """
685743 return self .put ('options' , data = config )
686744
687745 def patch_options (self , config ):
746+ """ Replaces only the given child objects
747+ """
688748 return self .patch ('options' , data = config )
689749
690750 def ldap (self ):
751+ """ Returns the LDAP object
752+
753+ Returns:
754+ dict
755+ """
691756 return self .get ('ldap' )
692757
693758 def put_ldap (self , config ):
759+ """ Replaces the entire object
760+ """
694761 return self .put ('ldap' , data = config )
695762
696763 def patch_ldap (self , config ):
764+ """ Replaces only the given child objects
765+ """
697766 return self .patch ('ldap' , data = config )
698767
699768 def gui (self ):
769+ """ Returns the GUI object
770+
771+ Returns:
772+ dict
773+ """
700774 return self .get ('gui' )
701775
702776 def put_gui (self , config ):
777+ """ Replaces the entire object
778+ """
703779 return self .put ('gui' , data = config )
704780
705781 def patch_gui (self , config ):
782+ """ Replaces only the given child objects
783+ >>> s = _syncthing().config
784+ >>> s.patch_gui({'address': '0.0.0.0:8384'})
785+ ''
786+ >>> gui = s.gui()
787+ >>> '0.0.0.0' in gui['address']
788+ True
789+ """
706790 return self .patch ('gui' , data = config )
707791
708792class Cluster (BaseAPI ):
0 commit comments