Retrieving information about synchronization events
The HTTP API described here retrieves information about synchronization events. Events shown on the Db2 Data Gate dashboard depend on the response that is issued by this API.
The result of a successful event information retrieval is an array of JSON objects:
{
"resStatus": "SUCCESS",
"result": [{object1}, {object2}, ...]
}
Endpoint URLs
The root URL accepts different query strings. The parameters that you can add to the query string are described below. The most important of these parameters are mutually exclusive:
- A range definition with the
start=
andend=
parameters - A starting point definition with the
interval=
parameter
A query string containing the start=
and end=
parameters
defines a time interval (range) for the event information to be retrieved. That is, the response
outputs information about events that occurred during the specified time interval. For example:
https://{cpd_cluster_host}/icp4data-databases/dg-{data_gate_instance_id}/
{openshift_project_where_data_gate_service_is_installed}/
clone_system/clone_engine/alert?severity=warning&start=1683715916440&end=1686307916441
A query string containing the interval=
parameter defines a starting point in
the past. That is, the response outputs information about events that occurred in the interval
between the specified point in the past and the current time. For example:
https://{cpd_cluster_host}/icp4data-databases/dg-{data_gate_instance_id}/
{openshift_project_where_data_gate_service_is_installed}/
clone_system/clone_engine/alert?severity=warning&interval=LAST_1_DAY
where:
- {cpd_cluster_host}
- Is the name of your deployed Cloud Pak for Data system.
- {data_gate_instance_id}
- Is the ID of your deployed Db2 Data Gate instance.
- {openshift_project_where_data_gate_service_is_installed}
- Is the name of the OpenShift® project where the Db2 Data Gate project is installed.
- filter=
- Adding the
filter=
substring to the query string, you can specify a text string. This limits the number of event information objects in the response to those objects that contain the specified string in the "message": text. - severity=
- This works as a filter on the severity classification of the event information. Possible values are:
- error
- Error events only
- information
- Information events only
- information_error
- Information events and error events
- warning
- Warning events only
- warning_error
- Warning events and error events
- warning_information
- Warning events and information events
- warning_information_error
- All types of events (warning, information, and error)
- start=
- If you use a
start=
andend=
query string, set the value to a timestamp that marks the beginning of the time interval.Remember: You cannot usestart=
andend=
in conjunction with theinterval=
query string. - end=
- If you use a
start=
andend=
query string, set the value to a timestamp that marks the end of the time interval.Remember: You cannot usestart=
andend=
in conjunction with theinterval=
query string.Tip: You can specifystart=-1
andend=-1
to obtain all available event information (same effect asinterval=ALL_EVENTS
) - interval=
- If you use an
interval=
query string, specify one of the following values. The placeholderx
stands for an integer number:- LAST_x_MINUTE
- LAST_x_MINUTES
- To retrieve information about events that occurred during the last
x
minutes. - LAST_x_HOUR
- LAST_x_HOURS
- To retrieve information about events that occurred during the last
x
hours. - LAST_x_DAY
- LAST_x_DAYS
- To retrieve information about events that occurred during the last
x
days. - ALL_EVENTS
- To retrieve all the event information that can be retrieved.
Remember: You cannot use theinterval=
query string in conjunction with astart=
andend=
query string.
Responses
Responses vary with respect to the query string that you used in the endpoint URL.
Example of a response obtained by using a start=
and end=
query
string with severity=warning_information
:
{ "resStatus": "SUCCESS", "result": [ { "severity": "WARNING", "message": "Replication started successfully.", "eventID": "1", "originator": "StartReplicationForDatabaseSystem", "time": 1685505431346, "uniqueKey": "1" }, { "severity": "WARNING", "message": "Fetch request for session 605993C88DEF2201 stalled since 52 seconds", "eventID": "1", "originator": "ApplyServerInstance", "time": 1685505737435, "uniqueKey": "2" }, { "severity": "INFORMATION", "message": "Integrated Synchronization status: Latency 0 seconds. Latest commit RBA/LRSN 0x00DD6C02EE4C5F6E52000000. Number of open transactions 0. Parsed source operations: 14276800 insert, 4276560 update, 15494069 delete. Applied target operations: 18553120 insert, 19551202 delete. ", "eventID": "1", "originator": "MonitoringEventCreatorThread", "time": 1686306806876, "uniqueKey": "326" } ] }
Example of a response obtained by using an interval=
query string with
severity=warning
:
{ "resStatus": "SUCCESS", "result": [ { "severity": "WARNING", "message": "/W1002/ Db2 on z/OS log reader unexpectedly returned HTTP code: 400, JSON response: {\"StatusCode\":400,\"StatusDescription\":\"Server closed connection. Error Location:1:1\"}", "eventID": "1", "originator": "Db2ZHTTPLogAPI", "time": 1686230171405, "uniqueKey": "1" }, { "severity": "WARNING", "message": "/W4043/ Replication started successfully.", "eventID": "1", "originator": "StartReplicationForDatabaseSystem", "time": 1686230201123, "uniqueKey": "2" }, { "severity": "WARNING", "message": "/W1002/ Db2 on z/OS log reader unexpectedly returned HTTP code: 400, JSON response: {\"StatusCode\":400,\"StatusDescription\":\"Server closed connection. Error Location:1:1\"}", "eventID": "1", "originator": "Db2ZHTTPLogAPI", "time": 1686230281996, "uniqueKey": "3" }, { "severity": "WARNING", "message": "/W4043/ Replication started successfully.", "eventID": "1", "originator": "StartReplicationForDatabaseSystem", "time": 1686230307116, "uniqueKey": "4" } ] }
where:
- "severity":
- Repeats the severity classification of an event.
- "message":
- Contains the message number and the message text. In case of a retrieval failure, the message
contains a JSON response object that contains the following elements:
- \"StatusCode\"
- An error code like 400.
- \"StatusDescription\":
- A brief description of the error.
- "eventID":
- A number used for the classification of an event.
- "originator":
- The program component that caused an event.
- "time":
- A timestamp that shows when an event has occurred.
- "uniqueKey":
- A unique identification key assigned to each event (an integer number).