Listing the details of a replication set in a Db2 Q Replication configuration
You can retrieve the details of a replication set by using the Db2 Q Replication REST API. Details include summary statistics, table subscription status, and schema subscription status.
Before you begin
This task is done on the cluster host for the replication source. Ensure that you collect the following information before you run the API call:
- The basic authorization token of the source on the cluster host.1
- The host name of the replication source database.
- The external port number of the replication source database.2
- The replication set name (rsName)3
- The consistency group name (cgName)
1 You need to create a basic authorization token to run a cURL request. To create your
token, run this
command:
echo <source_db_username>:<source_db_password> | base642 You can retrieve the external port number of the replication
source database by running the following
command:
oc get svc | grep <db2_instance_id> | grep db2u-engn-svc | grep 50001 | sed 's/.*50001://' | sed 's/\/TCP.*//')3 You can find the replication set name (rsName) and
consistency group name (cgName) by running the following
command:
curl --insecure -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic <your_authorization_token>'
'https://<source_hostname>:<source_rest_port>/dr/v1/replicationset'About this task
Procedure
Request the details of a specific replication set:
curl --insecure -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic <your_authorization_token>'
'https://<source_hostname>:<source_rest_port>/dr/v1/replicationset/<replication_set_name>/<consistency_group_name>'
Results
executionState=COMPLETED and overallJobResult=PASS is returned.
Until these values are returned, examine the error code, message, and resolution in the
response.The following table lists the possible HTTP status codes and response messages for the
replication set details request. It also includes sample code to show the response syntax.
| HTTP Status Code | Reason | Response Model |
|---|---|---|
| 200 | Details for replication | The user request returns a successful response for the completion of the API call (sample
value):
|
| 4xx | Client request error | The user request was not fulfilled due to malformed request syntax or other client
issues: |
| 5xx | Server error | The user request appeared valid, but was not fulfilled due to an issue with the
server: |
Example
RS_MPP_2:curl --insecure -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic ZHNhZG06MDNRVWlMczFhcmoxb3ky'
'https://dr-source1.ibm.com:31023/dr/v1/replicationset/RS_MPP_2/RSMPP20001'