i2Rest API Implementation process

From i2Rest
Jump to: navigation, search

In order to convert existing *PGM or *SRVPGM object to REST OAuth2 enabled web service, you have to complete following steps:

  1. Prepare file describing your program in PCML format. You can do it manually or generate PCML automatically using CRTRPGMOD (PGMINFO and INFOSTMF fields)
  2. (Optional) Enhance PCML description with extended i2Rest PCML attributes and tags
  3. Publish PCML description to i2Rest Server using ADD_PCML API or add it to i2Rest Server Configuration file

You don't have to do any changes in your RPGLE code, existing programs can still untouched.

Upon deployment, you will be able to call all RPGLE programs described in some PCML file as an APIs at following URL:

http(s)://<your_i2rest_server_main_gate>/<mount_point>/<program_name>

Where:

  • your_i2rest_server_main_gate - name and optional port of i2Rest Server's main gate
  • mount_point - common mount point name for all programs in this PCML
  • program_name - value of 'name' attribute of program as described in PCML

The specification file for this PCML will be available at:

OpenAPI 3.0 format:

http(s)://<your_i2rest_server_main_gate>/openapi30/<mount_point>

Swagger 2.0 format:

http(s)://<your_i2rest_server_main_gate>/swagger20/<mount_point>