Difference between revisions of "I2Rest quick config"

From i2Rest
Jump to: navigation, search
Line 33: Line 33:
 
</pre>
 
</pre>
 
;Step 1
 
;Step 1
:Contact your system administrator for available host and port for "main" and "management" gates of your first i2Rest Server instance, and set up appropriate settings.<br>
+
:Contact your system administrator for available host and port on your IBM i for "main" and "management" gates of your first i2Rest Server instance, and set up appropriate settings.<br>
 
;Step 2
 
;Step 2
 
:The next thing we have to do to is to set up "pcmls" object that provides program call parameters formal description. Look at such a description for the I2RESTECHO:
 
:The next thing we have to do to is to set up "pcmls" object that provides program call parameters formal description. Look at such a description for the I2RESTECHO:

Revision as of 16:15, 9 June 2020

Our i2Rest Server configuration template will help you to set up you server in a minutes. With this minimal configuration your server instance will be able to process request to test I2RESTECHO program.
Create *.json (you can name your file any you like, config.json for example) file and copy-paste to it the next lines:

{
   "gates":
   {
      "main"       : {"url":"http://<host_name>[:port]"},
      "management" : {"url":"http://<host_name>[:port]"}
   },
   "session_systems":
   [
      {
         "name"   : "*LOCAL",     
         "submit" : "SBMJOB JOB(I2RESTS) USER(${user}) CMD(CALL I2REST PARM('-session' '-url' '${surl}' '-uid' '${uid}' '-user' '${user}')) INLLIBL(I2REST)"
      },
      {
         "name"   : "*ANONYMOUS", 
         "submit" : "SBMJOB JOB(I2RESTA) USER(${user}) CMD(CALL I2REST PARM('-session' '-url' '${surl}' '-uid' '${uid}' '-user' '${user}')) INLLIBL(I2REST)"
      }
   ],

   "pcmls":
   [
      {
         "pcml_mount"         : "echo",
         "pcml_file"          : "<path to i2restecho.pcml on IFS>/i2restecho.pcml", 
         "valid_in_anonymous" : true
      }
   ]
}
Step 1
Contact your system administrator for available host and port on your IBM i for "main" and "management" gates of your first i2Rest Server instance, and set up appropriate settings.
Step 2
The next thing we have to do to is to set up "pcmls" object that provides program call parameters formal description. Look at such a description for the I2RESTECHO:
<pcml version="1.0">

   <program name="echo" path="/QSYS.LIB/%LIBL%.LIB/I2RESTECHO.PGM">
      <data name="echo" usage="inputoutput" type="char" length="10" trim="both"/>
   </program>

</pcml>
Create I2RESTECHO.PCML file and copy-paste the lines above to it, then save file anywhere your like on IFS, for example "/temp/PCML/i2restecho.pcml"
At last make sure you specify the path to your I2RESTECHO.PCML file in config.json correctly.

Now save your config.json on IFS (for example in i2Rest folder, but it's up to you) and you are ready to start your i2Rest Server instance.
Please explore more details how to configure your i2Rest server.