Difference between revisions of "I2Rest quick config"

From i2Rest
Jump to: navigation, search
Line 1: Line 1:
 
{{DISPLAYTITLE:i2Rest configuration in two steps}}
 
{{DISPLAYTITLE:i2Rest configuration in two steps}}
 
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.<br>
 
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.<br>
Create *.json (you can name your file any you like, config.json for example) file and copy-paste to it the next lines:  
+
 
 +
;Step 1
 +
:Create text file named I2RESTECHO.PCML somewhere on IFS, for example "/temp/PCML/i2restecho.pcml". Copy and paste following code. It represents a description for the sample program I2RESTECHO, that is included into i2Rest server installation for demonstration purposes:
 +
<pre>
 +
<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>
 +
</pre>
 +
 
 +
;Step 2
 +
:Contact your system administrator for available host and port on your IBM i for "main" and "management" gates of your first i2Rest Server instance. Create file config.json (you can name it with any name and put it into any available IFS folder). Enter following text, replace host_name, port and pcml_file with appropriate values:  
  
 
<pre>
 
<pre>
Line 32: Line 46:
 
}
 
}
 
</pre>
 
</pre>
;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.<br>
 
;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:
 
<pre>
 
<pcml version="1.0">
 
  
  <program name="echo" path="/QSYS.LIB/%LIBL%.LIB/I2RESTECHO.PGM">
+
Now you are ready to [[I2Rest_Start|start your i2Rest Server instance]].<br>
      <data name="echo" usage="inputoutput" type="char" length="10" trim="both"/>
 
  </program>
 
  
</pcml>
+
If you would like to go deeper, please explore [[I2Rest_Advanced_Setup|more details]] how to configure your i2Rest server.
</pre>
 
: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.<br>
 
Now save your config.json on IFS (for example in i2Rest folder, but it's up to you) and you are ready to [[I2Rest_Start|start your i2Rest Server instance]].<br>
 
Please explore [[I2Rest_Basic_Setup|more details]] how to configure your i2Rest server.
 

Revision as of 16:04, 11 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.

Step 1
Create text file named I2RESTECHO.PCML somewhere on IFS, for example "/temp/PCML/i2restecho.pcml". Copy and paste following code. It represents a description for the sample program I2RESTECHO, that is included into i2Rest server installation for demonstration purposes:
<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>
Step 2
Contact your system administrator for available host and port on your IBM i for "main" and "management" gates of your first i2Rest Server instance. Create file config.json (you can name it with any name and put it into any available IFS folder). Enter following text, replace host_name, port and pcml_file with appropriate values:
{
   "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
      }
   ]
}

Now you are ready to start your i2Rest Server instance.

If you would like to go deeper, please explore more details how to configure your i2Rest server.