Difference between revisions of "I2Rest quick config"

From i2Rest
Jump to: navigation, search
Line 34: Line 34:
 
       }
 
       }
 
   ],
 
   ],
 
 
   "pcmls":
 
   "pcmls":
 
   [
 
   [

Revision as of 16:12, 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. We will start with simplest non-encrypted connections, so please leave http as a protocol:
{
  "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"          : "<complete path of i2restecho.pcml on IFS (for example /tmp/i2rest/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.