Start or Stop or restart a syncthing Instance using REST API and command line
Artica is capable of fully managing each Syncthing instance—starting, stopping, and restarting them—either by invoking the Syncthing binary directly on the command line or by calling Syncthing’s built-in REST API.
Artica is capable of fully managing each Syncthing instance—starting, stopping, and restarting them—either by invoking the Syncthing binary directly on the command line or by calling Syncthing’s built-in REST API.
Basically, you can control each Syncthing instance via its init scripts or systemd units using the instance ID (1, 2, 3, etc.).
The scripts are named syncthing-<ID>, where <ID> is the unique identifier for that instance.
For example:
/etc/init.d/syncthing-2 restart
/etc/init.d/syncthing-2 stop
/etc/init.d/syncthing-2 start
will manage instance 2.
Likewise, you can use systemd:
systemctl restart syncthing-2
systemctl stop syncthing-2
systemctl start syncthing-2
Or Artica directly
/usr/sbin/artica-phpfpm-service -stop-syncthing -instance 2
/usr/sbin/artica-phpfpm-service -start-syncthing -instance 2
/usr/sbin/artica-phpfpm-service -restart-syncthing -instance 2
The command
/usr/sbin/artica-phpfpm-service -list-syncthing displays instance with instance's respective ID.
REST API
Here to start/start/restart using the Artica API Service
GET http://1.2.3.4:9503/syncthing/stop/[ID]
GET http://1.2.3.4:9503/syncthing/start/[ID]
GET http://1.2.3.4:9503/syncthing/restart/[ID]
The API
GET http://1.2.3.4:9503/syncthing/list
List all instances in json format