In this lab, you will learn how a traditional z/OS banking transaction can be modernized and transformed into services (APIs) that can be assessed by a hybrid cloud web application. This application will be deployed using OCP tools and the workload will run on the OCP cluster residing on System Z Linux.
You will perform the following tasks:
- Use the IBM API Portal to subscribe and connect to the set of z/OS banking services for this lab.
- Use your workstation to access your github repository containing the web application locally. Update the source code with the appropriate credentials required to access the z/OS banking services. Use node.js to build and test the web application.
- Use the OCP web console to build and deploy the the web application from github.
This lab accesses a fictitious retail banking system called MPLbank. MPLbank integrates an Account Management System running on IBM Mainframe. On top of this component, an API layer based on z/OS Connect Enterprise Edition and IBM API Connect has been set up to deliver banking APIs. It makes banking services reachable through APIs from all kind of applications.
- The user deploys a Docker image (banking application based microservice) to the OCP.
- The user configures and runs a container based on this Docker image. Once started, the application calls banking APIs published in API Connect.
- API Connect calls the back-end Z Mainframe through a banking API published in z/OS Connect EE.
- z/OS Connect EE calls the Account Management System (AMS) running in CICS. A COBOL program processes the request and returns banking data. Finally, banking data are sent back to the microservice application.
- Red Hat OpenShift Container Platform
- IBM API Connect
- IBM z/OS Connect Enterprise Edition
- IBM CICS Tansaction Server
- IBM Db2
-
Locate your assigned ID number: ________________.
-
Locate your assigned git repository: _______________________________.
-
Launch a terminal (or command prompt in Windows).
-
Clone your git repository to create a local copy of your banking application. Replace xx with your assigned ID number.
git clone https://github.com/zcloud-01/banking-app-xx
-
Examine the directory structure of your imported repository.
cd banking-app-xx
ls (or dir for Windows)
- app.js - Application server code
- public/index.html - Application client code (banking dashboard)
- public/css - Application stylesheet
- public/js - JavaScript libraries
- public/js/bankingAPI.js - Source code that connects to a core banking system through API calls. You will modify this file later.
- package.json - Package dependencies file
- Dockerfile - File to build the Docker image
-
Locate your assigned API Developer Portal account and password.
-
Start a web browser.
-
Go to the API Developer Portal, https://developer-contest-spbodieusibmcom-prod.developer.us.apiconnect.ibmcloud.com/
-
Login to your assigned account.
-
Create a new application.
-
Click Apps from the menu.
-
Click Create new App.
-
Fill in all the required fields. For Title: use myappxx. Replace xx with your assigned ID number.
-
Click Submit.
-
-
Make a note of the following. For Windows, you can copy this info 91FB rmation to notepad or sticky notes, for example. You will need this information later to access the API.
- client ID
- client Secret
-
Before working with the banking API, you need to subscribe to it first. Display the list of available API products.
- Click API Products from the top menu.
- Click Banking Product in the list.
-
Subscribe to the Banking API.
- Click Subscribe to subscribe to the Default Plan.
-
Select the App that you have just created, myappxx.
-
Click Subscribe.
-
Log out of the API Developer Portal.
-
Return to the workstation terminal (or Command prompt)
-
Modify the banking-app-xx/public/js/bankingAPI.js file. You can use notepad, for example.
-
Replace YOUR_CLIENT_ID_HERE with your client ID value from the IBM API developer portal.
-
Replace YOUR_CLIENT_SECRET_HERE with your client Secret value from the IBM API developer portal.
-
-
Go to your banking application folder (if you are not already there)'.
cd banking-app-xx
-
Install the Node.Js package dependencies of the banking application.
npm install
-
Start the banking application.
node app.js
-
Run your application.
- Launch a web browser and enter the URL http://localhost:3000.
-
Test your application.
-
Select a customer ID.
-
The application accesses banking data from z/OS through API Connect.
-
The result is displayed in a JSON structure.
-
-
You have successfully tested the banking application running locally. Stop the Node.js server.
Enter CTRL+C from the terminal.
-
Add the bankingAPI.js file you just modified to the current content index.
git add public/js/bankingAPI.js
-
Commit the modified code to your local repository.
git commit -m "Update of bankingAPI.js (date)"
-
Push the code you commited to your GitHub repository.
git push
- When prompted for a password, contact the instructor.
-
Return to your web browser and go to your GitHub repository.
https://github.com/zcloud-01/banking-app-xx
-
Verify that your code in the bankingAPI.js file has been updated with the commit label Update of BankingAPI.js.
👍 Congratulations! Your banking application locally works and modifications have been pushed to your GitHub repository! Ready for Red Hat OpenShift Container Platform?
When using OpenShift there are a number of different ways you can add an application. We will use the method to Build and deploy from source code contained in a Git repository from a Dockerfile.
-
Locate your assigned OCP portal user and password.
-
Login to the OCP portal with your assigned user and password.
- From a web browser, enter the URL: https://console-openshift-console.apps.ocp.linuxone.io.
-
At the login screen, select ldapidp.
-
Enter your assigned username and password.
-
(If necessary) Select the Developer perspective for the project instead of the Adminstrator perspective
- Select Developer in the left hand side menu.
-
Create a project.
- Click on Project and Create Project
- Enter the name of the project: projectxx.
Important: You must use this exact name with your assigned user number in the project name.
- Click on Create
As the project is currently empty, no workloads should be found and you will be presented with various options for how you can deploy an application.
-
Import your Dockerfile from your git repository to be built and deployed.
- Click the From Dockerfile tile.
-
Enter your git repo URL.
-
Change the Container Port to 3000.
From the name of the repo, the Application Name and deployment Name fields will be automatically populated. The deployment name is used in OpenShift to identify the resources created when the application is deployed. This will include the internal Service name used by other applications in the same project to communicate with it, as well as being used as part of the default hostname for the application when exposed externally to the cluster via a Route. The Application Name field is used to group multiple deployments together under the same name as part of one overall application.
At the bottom of this page you will see that the checkbox for creating a route to the application is selected. This indicates that the application will be automatically given a public URL for accessing it.
-
Click on Create.
This will return you to the Topology view, but this time you will see a representation of the deployment, rather than the options for deploying an application.
You may see the colour of the ring in the visualisation change from white, to light blue and then blue. This represents the phases of deployment as the container for the application starts up.
When the deployment is complete, you will see a green check mark indicating that the deployment was successful.
10.Access the application.
You can access the application via its public URL, by clicking on the URL shortcut icon on the visualisation of the deployment.
11.Test your application.
- Select a customer ID.
- The application requests banking data from IBM Z through API Connect and z/OS Connect EE.
- The result is displayed in a JSON structure.
👍 Congratulations! You have suucessfully deployed your banking application to run on the OCP cluster on System Z Linux server.
This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.