Create a Db2 service

This scenario shows how you can recreate the Db2® employeeList service using the Db2 service manager in the API toolkit.

Before you begin

To create and test the employeeList service ensure that the following tasks are complete:
  1. Create and enable Db2 Native REST services. The procedure is described in the scenario Prepare the sample Db2 native REST services
  2. Install IBM® z/OS® Connect v3.0.29 or later. For more information, see Installing IBM z/OS Connect.
  3. Install the API Toolkit, see Installing z/OS Explorer and the z/OS Connect API toolkit.
  4. Configure and test your connection to Db2. The procedure is described in the scenario Create a server to connect to Db2 and installs relevant artifacts using the supplied configuration template sampleDb2ProjectManager. This includes the employeeList service.
  5. Use the z/OS Connect API toolkit to Stop and Remove the employeeList service.

About this task

In this case we use screenshots of the API toolkit running on a MacOS workstation to recreate the Db2 employeeList service. This scenario also supports Windows and Linux workstations.
Diagram showing how IBM z/OS Connect connects the user to a Db2 instance.

Procedure

  1. Start IBM Explorer for z/OS and open the z/OS Connect (OpenAPI 2) perspective.
  2. Right click in the project explorer window and select New > Project.... Select the z/OS Connect Service Project wizard.
  3. Enter employeeList for the project name, select Db2 Service for the project type and enter Returns a list of employees. for the description of the new service project.
    Click Finish.
    Screen capture of the IBM z/OS Connect Service Project entry screen
    The Service Project Editor opens.
    Screen capture of the IBM z/OS Connect Service Project defenition page
  4. Click Import from Db2 service manager...
    The Import Db2 service from service manager dialog opens.
  5. Select New Db2 service manager connection...
    Screen capture of the Db2 service manager screen
  6. Enter the host name and port number for Db2. If Db2 uses a secure connection, select secure connection (TLS/SSL).
    Click Save and Connect.
    Screen capture of the Db2 service manager connection screen
  7. Enter your credentials to connect to Db2.
    Click OK.
    Screen capture of the Db2 service manager credentials screen
    A green circle indicates that the connection was successful.
    Screen capture of the Db2 service manager table
    The Db2 native REST services for the connection are shown in the table.
  8. Use the search tool in the top left corner to find the Db2 native REST service employeeList.
    Select the employeeList service in the table and click Import.
    Screen capture of the employeeList service in the Db2 service manager screen
  9. The fields Collection ID, Db2 native REST service name, Db2 native REST service version, Request JSON schema and Response JSON schema have been filled.
    SScreen capture of the IBM z/OS Connect Service Project defenition page
    You can view the contents of the selected request-schema.json and response-schema.json schemas in the Project Explorer view as shown on the left hand side.
  10. Click the Configuration tab at the bottom of the screen.
    Add the connection reference db2Conn.
    The Configuration page in the service Project Editor.
  11. Save the employeeList service.

Results

The employeeList service is now ready to be deployed.

What to do next

Deploy and test your newly created employeeList service.