Start of change

Query Monitor API Server

Query Monitor API Server (CQM API) is a generic REST API that retrieves information that is collected by IBM® Db2 Query Monitor for z/OS®.

CQM API allows integration between Db2 Query Monitor and other products and applications, such as IBM Db2 Administration Foundation for z/OS or your own applications. For example, your applications can call CQM API to get current and historical data from Db2 Query Monitor and then format, filter, and aggregate the data as needed.

Setup

Before you can use CQM API, complete the following actions:

  1. Ensure that IBM Java™ 17 is installed.

    You can download IBM Semeru Runtime Open Edition Java 17 by clicking the MSI link next to JRE and install it.

  2. Copy the CQMAPI member from SAMPLIB to your system concatenated PROCLIB.

    The JCL job in this member starts the Query Monitor API Server.

  3. Edit your copy of CQMAPI according to the instructions in the comments and your shop standards.

    For a description of the parameters, see CQMAPI parameters.

  4. Start the Query Monitor API Server by using the MVS start command:
    S CQMAPI
  5. Ensure that any user IDs that use the CQM API address space (to run this API) have read access to BPX.SERVER in the FACILITY class.

You can later stop the Query Monitor API Server by using the MVS stop command:

P CQMAPI

Authentication

The default URL for CQM API is:

https://hostname:port/api/v1
where:
hostname
The name of the server on which the API service is running.
port
The number that identifies the network port where the API is listening.

To authenticate to CQM API, specify the URL for your CQM API and send a POST request with your username and password in the body:

{
   "username": "string",
   "password": "string"
}

If authentication is successful, the server responds with a JSON web token (JWT), which is valid for an hour

Endpoints

The endpoints for CQM API are documented in the swagger doc that is available at the following URL after set up CQM API is set up:

https://hostname:port/swagger-ui/index.html
where:
hostname
The name of the server on which the API service is running.
port
The number that identifies the network port where the API is listening.
End of change