All operations from the execution screen can also be launched and monitored remotely through an web service API.
Example usage with curl:
Run a task on the default database:
curl -u <user>:<password> http(s)://<server>:<port>/execute/api/<command>/
--data "<argument1>=<value1>&<argument2>=<value2>"
Run a task on a scenario database:
curl -u <user>:<password> http(s)://<server>:<port>/<scenario>/execute/api/<command>/
--data "<argument1>=<value1>&<argument2>=<value2>"
The following URLS are available.
Example usage with curl to retrieve status for active task:
curl -u admin:admin http://localhost:8000/execute/api/status/
Example usage with curl to retrieve status of task with id 26:
curl -u admin:admin http://localhost:8000/execute/api/status/?id=26
Example usage with curl:
curl -u admin:admin --data "constraint=15&plantype=1&env=fcst,invplan,balancing,supply" http://localhost:8000/execute/api/frepple_run/
Example usage with curl:
curl -u admin:admin --data "models=input.demand,input.operationplan" http://localhost:8000/execute/api/frepple_flush/
Example usage with curl:
curl -u admin:admin -X POST http://localhost:8000/execute/api/frepple_importfromfolder/
Example usage with curl:
curl -u admin:admin -X POST http://localhost:8000/execute/api/frepple_exporttofolder/
Example usage with curl:
curl -u admin:admin --data "fixture=manufacturing_demo" http://localhost:8000/execute/api/loaddata/
Example usage with curl:
curl -u admin:admin --data "copy=1&source=production&destination=scenario1&force=1" http://localhost:8000/execute/api/frepple_copy/
Example usage with curl:
curl -u admin:admin -X POST http://localhost:8000/execute/api/frepple_backup/
All these APIs return a JSON object and they are synchronous, i.e. they don’t wait for the actual command to finish. In case you need to wait for a task to finish, you will need to use a loop which periodically polls the /execute/api/status URL to monitor the status.
For security reasons we strongly recommend the use of a HTTPS configuration of the frePPLe server when using this API.