Starting / Stopping a PAS - OE 11.6

Posted by atuldalvi123 on 12-Sep-2017 00:07

Hello All,

Is there an API or a way to control PAS programmatically ? I would like to avoid starting / stopping PAS manually.

Regards,

Atul Dalvi

Posted by Mike Fechner on 12-Sep-2017 01:56
Ruben, can the OEMANAGER web app be used to start an instance?
 
My understanding is, that it’s part of the instance and the only ways to that the instance are
 
  • OEM
  • tcman start
  • Windows Service
 
Posted by Ruben Dröge on 12-Sep-2017 02:57

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

All Replies

Posted by Mike Fechner on 12-Sep-2017 01:22

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.

Posted by atuldalvi123 on 12-Sep-2017 01:38

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.

Posted by Ruben Dröge on 12-Sep-2017 01:44

Yes, you can call the REST api using ABL.

Use the OpenEdge httpclient to do so:

documentation.progress.com/.../index.html

Posted by Mike Fechner on 12-Sep-2017 01:46
OS-COMMAND ?
 
Posted by atuldalvi123 on 12-Sep-2017 01:50

Thanks Ruben.

I don't have much idea on the REST api.

Do you have any sample code to understand  this or any documentation ?

Posted by Mike Fechner on 12-Sep-2017 01:56
Ruben, can the OEMANAGER web app be used to start an instance?
 
My understanding is, that it’s part of the instance and the only ways to that the instance are
 
  • OEM
  • tcman start
  • Windows Service
 
Posted by Ruben Dröge on 12-Sep-2017 02:57

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

Posted by Peter Judge on 12-Sep-2017 07:40
What do you mean by “manually”?
Posted by Akshay Guleria on 12-Sep-2017 07:53

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.

Posted by atuldalvi123 on 13-Sep-2017 02:25

Thanks guyz.

How can we execute tcman (cli) in OS-COMMAND and control  ( start / stop ) PAS from client side. Do you have any sample script ?

Posted by Akshay Guleria on 13-Sep-2017 04:51

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".

OS-COMMAND VALUE(lcCommand).

// <CATALINA_BASE> default in windows (OE ver 11.7) -> C:\OpenEdge\WRK\oepas1. Check you own.

Posted by atuldalvi123 on 13-Sep-2017 05:51

Thanks Akshay,

Also is this possible to start and stop PAS server instances from remote location or from client session using Access URL ?

Posted by Peter Judge on 13-Sep-2017 09:48
The $CATALINA_BASE location is the instance’s root folder.  Alternatively you can call the pasman command with the -I (alias) switch.  All of these are documented in the Administrative Tools section of the doc at documentation.progress.com/.../administrative-tools.html . For PASOE there is a lot of doc for admin and tools
 
Remote admin is another issue altogether; you may want to look at using OE Management/OE Explorer and the REST APIs for it.
Posted by atuldalvi123 on 13-Sep-2017 23:04

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.

Posted by Akshay Guleria on 14-Sep-2017 01:15

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.

Example: 

<hostA_shell_prompt>$ ssh username@hostB "<command to start/stop PASOE instance>"
This thread is closed