Preparing a sample Db2 native REST service
How to enable and create Db2 native REST services
that use the Db2 sample tables. These services are then used
by the sample OpenAPI definition,
EmployeesApi.yaml, that's part of the sample-db2-api download.
Before you begin
zosConnect-3.0 Applies to zosConnect-3.0.
Containers Applies to z/OS Connect container deployments.
This procedure is one of the prerequisites for creating a new z/OS® Connect API.
About this task
You create two Db2 native REST services:
getEmployees- Returns a list of employees.getEmployee- Returns the details of an individual employee.
addEmployee- Add the details of an individual employee.updateEmployee- Update the details of an individual employee.deleteEmployee- Removes the details of an individual employee.
These services are created by using the Db2 Service
Manager native REST service. Alternatively, the BIND SERVICE subcommand can be used to create a new
Db2 native REST service. For each request, replace
<db2_host_name> with the hostname of your Db2 instance and <db2_port> with the port of your Db2 instance. You might also need to include authentication credentials such as
the Authorization HTTP header.
The services that are created in this sample scenario use the default Db2 collection SYSIBMSERVICE.
Procedure
Results
getEmployee, and getEmployees are Db2 native REST services, created as part of the
SYSIBMSERVICE collection in Db2.