Is there an API or a way to control PAS programmatically ? I would like to avoid starting / stopping PAS manually.
Architect of the SmartComponent Library and WinKit
Agree Mike, it's not possible to start/stop an instance using the REST API.
It can be used to kill sessions, cancel requests etc. Basically all related to the agent/session manager and not the instance. I guess OS-COMMAND would be the way to go
Check for the tcman start/stop command in your PASOE instances bin folder.
On Windows you may also register an PASOE instance as a Windows service and use net start/stop
To do the same as a "trip" on the classic AppServer, please read the PASOE documentation for the OEMANAGER web application. This provides a RESTful API to delete AppServer agents etc.
Thanks Mike Fechner.
Could it be possible with OpenEdge code where we can pass parameters to the procedure or object and start/stop PAS. I don't want to use any windows service or web application for this.
Yes, you can call the REST api using ABL.
Use the OpenEdge httpclient to do so:
I don't have much idea on the REST api.
Do you have any sample code to understand this or any documentation ?
IMHO it would be nice if you could define you problem first i.e. what are the issues you are facing with using OEMANAGER (web interface) or tcman (cli)?
Even if you write an API or shell script or something else to do this, someone has to execute those. Or maybe you can add it to your cronjob if you want to automate it totally. But again it depends on your needs.
How can we execute tcman (cli) in OS-COMMAND and control ( start / stop ) PAS from client side. Do you have any sample script ?
Below is a simple example of 4GL code to start a PASOE instance (depending on OS).
DEF VAR lcCommand AS CHAR NO-UNDO.
IF OPSYS = "UNIX" THEN lcCommand = "<CATALINA_BASE>/bin/tcman.sh pasoestart -timeout 120 -json -silent -archive".ELSE IF OPSYS = "WIN32" THEN lcCommand = "<CATALINA_BASE>\bin\tcman.bat pasoestart -timeout 120 -json -silent -archive".ELSE MESSAGE OPSYS "is an unsupported operating system".
// <CATALINA_BASE> default in windows (OE ver 11.7) -> C:\OpenEdge\WRK\oepas1. Check you own.
Also is this possible to start and stop PAS server instances from remote location or from client session using Access URL ?
Thanks Peter !
But I don't think its possible with REST API to start / stop the PASOE instances by remotely and I am looking exactly for the same.
1. PASOE API based hack solution (not good):
Well theoretically speaking you can have 1 PASOE instance (let's call it `manageOthers`) just for starting and stopping other PASOE instances using PASMAN -I <instance_name>. But then you would never be able to start and stop will not give any response when PASOE instance manageOthers tries to manage itself via API call. I don't personally like this kind of solutions which are simply a hack around the problem and can create more problem rather than solve the first one.
2. Other decent solution options:
Other solutions could be to use a totally different API call (Message queues or RPC) that could manage PASOE instances. If you do not have any of those implemented already and still decide to do this then remember to first figure out the economic feasibility of the solution. And remember this can be done with other technologies too :)
3. Shell scripting solution (my choice):
But probably the most cost & resource efficient, easiest and probably the best is to write a small shell script which can be executed from any remote server.
<hostA_shell_prompt>$ ssh username@hostB "<command to start/stop PASOE instance>"