Control Process

Description:

This is a method for external applications to control Orchestrator processes such as Engine, Monitor, Mongrel, or Worker.

Request for Engine and Monitor
http://localhost/aspera/orchestrator/api/control_process/<process_name>.xml?login=admin&password=pass&command=<command>
For example:
http://localhost/aspera/orchestrator/api/control_process/engine.xml?login=admin&password=pass&command=’kill’
The following are the commands for each process:
Process Available Commands
Engine kill, start, stop
Monitor kill, start, stop
Mongrel kill, start unlock_port
Worker kill, start, stop
Note: If a control process command is executed, the API call is successful; however it can take few moments to to take effect.
Usage for mongrel:
http://localhost/aspera/orchestrator/api/control_process/process_name.xml?login=admin&password=pass&command=command&port=port
For example:
http://localhost:3000/aspera/orchestrator/api/control_process/mongrel.json?login=admin&password=admin&command=kill&port=3002
Usage for worker:
http://localhost/aspera/orchestrator/api/control_process/<process_name>.xml?login=admin&password=pass&command=<command>&worker_id=<worker_id>
For example:
http://localhost/aspera/orchestrator/api/control_process/worker.xml?login=admin&password=pass&command=kill&worker_id=4
Response example for engine start (XML):
<processes time="2015-12-03 10:29:19 UTC" action="status" engine_id="0">
<process class="engine" pid="83296" status="running"/>
<process class="mongrel" pid="83301" status="running" port="3000"/>
<process class="mongrel" pid="83303" status="running" port="3001"/>
<process class="mongrel" pid="83305" status="running" port="3002"/>
<process class="monitor" pid="83299" status="running"/>
<process class="worker" id="0" pid="83312" status="running" type="asynchronous"/>
<process class="worker" id="1" pid="83314" status="running" type="asynchronous"/>
<process class="worker" id="2" pid="83316" status="running" type="normal"/>
<process class="worker" id="3" pid="83318" status="running" type="normal"/>
<process class="worker" id="4" pid="83320" status="running" type="normal"/>
<process class="worker" id="5" pid="83310" status="running" type="normal"/>
</processes>
Response example for mongrel kill on port 3002 (XML):
{  
   "processes":{  
      "process":[  
         {  
            "pid":25907,
            "class":"engine",
            "status":"running"
         },
         {  
            "pid":25912,
            "port":3000,
            "class":"mongrel",
            "status":"running"
         },
         {  
            "pid":25914,
            "port":3001,
            "class":"mongrel",
            "status":"running"
         },
         {  
            "pid":"-",
            "port":3002,
            "class":"mongrel",
            "status":"not running"
         },
         {  
            "pid":25910,
            "class":"monitor",
            "status":"running"
         },
         {  
            "id":"0",
            "type":"asynchronous",
            "pid":25923,
            "class":"worker",
            "status":"running"
         },
         {  
            "id":"1",
            "type":"asynchronous",
            "pid":25925,
            "class":"worker",
            "status":"running"
         },
         {  
            "id":"2",
            "type":"normal",
            "pid":25927,
            "class":"worker",
            "status":"running"
         },
         {  
            "id":"3",
            "type":"normal",
            "pid":25929,
            "class":"worker",
            "status":"running"
         },
         {  
            "id":"4",
            "type":"normal",
            "pid":25931,
            "class":"worker",
            "status":"running"
         },
         {  
            "id":"5",
            "type":"normal",
            "pid":25921,
            "class":"worker",
            "status":"running"
         }
      ],
      "engine_id":0,
      "action":"status",
      "time":"2016-01-12 23:34:03"
   }
}