Difference between revisions of "I2Rest API Implementation"
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{DISPLAYTITLE: | + | {{DISPLAYTITLE:i2Rest API Implementation process}} |
In order to convert existing *PGM or *SRVPGM object to REST OAuth2 enabled web service, you have to complete following steps: | In order to convert existing *PGM or *SRVPGM object to REST OAuth2 enabled web service, you have to complete following steps: | ||
− | + | # Prepare file describing your program in [https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzahh/pcml.htm PCML format]. You can do it manually or generate PCML automatically using CRTRPGMOD (PGMINFO and INFOSTMF fields) | |
− | + | # (Optional) Enhance PCML description with extended [[I2Rest_PCML_syntax|i2Rest PCML attributes and tags]] | |
− | + | # Publish PCML description to i2Rest Server using [[Management_APIs#ADD_PCML_API|ADD_PCML API]] or add it to [[I2Rest_Config#pcmls|i2Rest Server Configuration file]] | |
You don't have to do any changes in your RPGLE code, existing programs can still untouched. | 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: | ||
+ | <pre>http(s)://<your_i2rest_server_main_gate>/<mount_point>/<program_name></pre> | ||
+ | Where: | ||
+ | * your_i2rest_server_main_gate - name and optional port of i2Rest Server's main gate | ||
+ | * <div id="mount_point></div>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: <pre>http(s)://<your_i2rest_server_main_gate>/openapi30/<mount_point></pre> | ||
+ | Swagger 2.0 format: <pre>http(s)://<your_i2rest_server_main_gate>/swagger20/<mount_point></pre> |
Latest revision as of 16:34, 12 July 2020
In order to convert existing *PGM or *SRVPGM object to REST OAuth2 enabled web service, you have to complete following steps:
- Prepare file describing your program in PCML format. You can do it manually or generate PCML automatically using CRTRPGMOD (PGMINFO and INFOSTMF fields)
- (Optional) Enhance PCML description with extended i2Rest PCML attributes and tags
- 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>