Skip to content

Installing or Updating the MDRest4i SDK

The MDRest4i SDK web interface runs as a web application served by an HTTP server on IBM i. The MDREST4i SDK web application uses REST APIs (Built using MDREST4i) which are exposed via the same instance of this Apache HTTP server.

To install SDK web UI application, run the MDRSDKINS command

To update an existing installation, first stop the MDRST server instance and any server instance created over MDRST for running your API’s, and then run the MDRSDKUPD command.

Invoking the MDRSDKINS command

  • ADDLIBLE MDRST
  • Prompt MDRSDKINS

The following screen will appear:

                       Install MDRest4i SDK (MDRSDKINS)                       

Type choices, press Enter.                                                    

SDK HTTP PORT  . . . . . . . . . PORT           4545                          
Start SDK HTTP Instance  . . . . STRSRV         Y                             
Default SDK Administrator  . . . ADMPRF       > DFTPROFILE                    
Default Generator Library  . . . DFTLIB         MDRAPIDFT                     
Default Hostname or IP . . . . . DFTHOST        'ibmi.yourdomain.com'         

Create Default API Server  . . . CRTSRVA        Y                             
Default API Server . . . . . . . APISRV         MDRAPISRV                     
Default API Server PORT  . . . . PORTA          4546                          


                                                                         Bottom
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel                                                                   

MDRSDKINS Parameter Table

PORT HTTP Instance PORT Number Port number the HTTP server instance for the SDK web UI runs under. 4545 is a default value and should be set as per your own port preferences on the IBM i server
STRSRV Start HTTP Instance Select Y to start the SDK HTTP server instance.
ADMPRF Default SDK Administrator MDRest4i SDK uses hierarchal authority classes for users. An administrator user must be created when installing MDRest4i SDK, so additional users can be authorized.

The value supplied in this parameter MUST be a valid, existing IBM i user, that can login to the IBM i.

No special IBM i authority is required for this user.

This default Admin user has authority to Manage SDK Users, including authorizing new users.
DFTLIB Default Generator Library A default library to contain generated Provider and Consumer programs and their source. MDRSDKINS creates this library if it does not exist.

DFTLIB is used when creating the Default API Server below as one of the libraries in the JOBD for this default API Server.

DFTLIB is also used for setting default values, for default the SDK user profile. See Default User MDRDFTUSR below for more details.
DFTHOST Default Hostname or IP This is the host name or IP address of the IBM i server, where MDRest4i Providers will run from.

It is used to to add the DFT Server value for new users. See Default User MDRDFTUSR below for more details.
CRTSRVA Create Default API Server Specify Y to create an HTTP instance to host REST Providers created by MDRest4i SDK.

MDRSDKINS calls the MDRHTTPAPI command to create this HTTP server instance.

MDRSDKINS will start the Default API Server after installation completes.
APISRV Default API Server The name of the HTTP instance created as a default Provider(API) server.

A job description of the same name will also be created in MDRST, and used by this HTTP instance.
PORTA Default API Server PORT Port number that the Default API Server created above will listen on.

Default User MDRDFTUSR

A dummy user: MDRDFTUSR is created by MDRSDKINS.

When a new SDK user signs up using the Signup link in the SDK Login page, this MDRDFTUSR record is copied to create the new user profile record, in file MDRST/MDRDUSER.

Default values are set in this dummy profile by MDRSDKINS. Individual users default values can be edited later from the Edit User screen in the SDK UI. The default values set by MDRSDKINS are:

  • The default value for Object Library is set with the DFTLIB value.

  • The default Source File for code generation is set as MDRDFTSRC using the library specified in DFTLIB above. For example: DFTLIB = MYAPILIB. The default source file value will be set as /QSYS.LIB/MYAPILIB.LIB/MDRDFTSRC.FILE

  • The default Server URL value added to the OAPI/SWAGGER definition when a new Provider or Consumer is created in the SDK UI.

See the SDK Edit Profile for editing the default values set for a user during Signup.

The default values for MDRDFTUSR can be edited at a later date, using the MDRSDKUSR command.

Note

The Owner of the SDK web UI objects in the IFS is set the same owner used to install the product via the MDREST4INS command.

Running MDRest4i SDK Web UI

Use the following url to connect to the web UI

HTTP://youribmiserver:yourport/cons/

This will bring up the following interface:

alt text

Login with user profile provided in the MDRSDKIN.ADMPRF command parameter above

Once logged in, click on any “?” in the UI to bring up the online help

Updating the SDK Web Application

The MDRSDKUPD command has no parameters. It only executes if the SDK has already been installed. It backs up the existing config files for the MDRest4i SDK web UI, installs the new code base, and copies back the SDK web UI config files.

Warning

If unsure if the SDK has already been installed, check the value of data area MDRST/MDRSDKROOT. If this is blank, then command MDRSDKINS MUST be run, not MDRSDKUPD

MDRSDKUPD backs up the SDK web UI application to IFS folder: /mdrest4i/sdkbu-mdrst

Note

The backup path is based uon the instance name for MDRest4i. If the MDRest4i instance is 'V14' for example, the backup folder for te SDK update will be: /mdrest4i/sdkbu-mdrst

To run command MDRSDKUPD:

  • ADDLIBLE MDRST
  • MDRSDKUPD command and enter