Session System Object

From i2Rest
Jump to: navigation, search

Object representing session system settings

Do not forget to define system_* scope for Session Systems with names other than *ANONYMOUS and *LOCAL

Field Type Description Default value
name string REQUIRED, Name of the system

Name to be used as an identity for this session system. To call APIs with this system settings, clients will have to obtain authority with special scope system_<system_name>. This scope is not required when calling for APIs on systems with special names:

*LOCAL corresponds to this IBM i server
*ANONYMOUS for that API which is allowed to call without user/client authorization
submit string
REQUIRED, Command to submit session

Specifies command to be used on submitting job which will process client's requests. Typically, it would be one of: SBMJOB or SBMRMTCMD. But i2Rest does not limit to use external non-IBMi systems which will act as session processor.
To be more flexible in terms of defining submitted job characteristics, i2Rest will substitute following substrings with appropriate values:

${uid} session ID (value of OAuth2 access token or automatically generated ID of anonymous session)
${surl} session gate URL
${user} user ID
${token} OAuth2 token value
${anonymous} Y for anonymous sessions, N for others
${scopes} List of scopes used to used to create the token

Examples:

SBMJOB JOB(I2RESTS) USER(${user})
       CMD(CALL I2REST PARM(
             '-session'
             '-url' '${surl}'
             '-uid' '${uid}'
             '-user' '${user}'
             '-swap_to_user'
             '-scopes' '${scopes}'
             '-init' 'ADDLIBLE MYLIB'))
       INLLIBL(LIBX LIBY)

SBMRMTCMD DDMFILE(QGPL/RMTSYS)
       CMD('SBMJOB CMD(CALL I2REST PARM(''-session''
          ''-url'' ''${surl}''
          ''-uid'' ''${uid}''))')

See also i2Rest -session

non_ibmi boolean Non-IBMi system?

For IBMi systems, you have to prepare special "submit" command and session processing program. Submit command should be able to start session processor task on remote non-IBMi system.

Please contact us for additional information

false