6 Replication Service APIs
These APIs are used to monitor and manage cnDBTier data replication across sites, including replication status, health, recovery, and related configuration details.
6.1 Switch Over API
This API is used to initiate a cnDBTier switchover operation.
Note:
The "base-uri" will be "<db-replication-svc Loadbalancer IP>: <db-replication-svc Loadbalancer PORT>".
Example:
# If HTTP is enabled in cnDBTier cluster
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl -X PUT http://$IP:$PORT/ocdbtier/georeplication/switchover/start/sitename/{siteName}
# If HTTPS is enabled in cnDBTier cluster
# Obtain the Client certificate which is present in the secret configured by user in "/global/https/secrets/clientSecret". For Ex - client-cert.pem and client-key.pem
# Obtain the CA certificate which is present in the secret configured by user in "/global/https/secrets/caSecret". For Ex - combine-ca.pem
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl --cert client-cert.pem --cert-type PEM --key client-key.pem --key-type PEM --cacert combine-ca.pem -X PUT https://$IP:$PORT/ocdbtier/georeplication/switchover/start/sitename/{siteName}Site with remote site and group id Specific Replication Switchover Start API
URI: http://base-uri/ocdbtier/georeplication/switchover/start/sitename/{siteName}/remotesitename/{remoteSiteName}/replchannelgroupid/{replChannelGroupId}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
|
| 400 Bad Request | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
Site with remote site and group id Specific Replication Switchover Stop API
URI: http://base-uri/ocdbtier/georeplication/switchover/stop/sitename/{siteName}/remotesitename/{remoteSiteName}/replchannelgroupid/{replChannelGroupId}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
Site with remote site Specific Replication Switchover Start API
URI: http://base-uri/ocdbtier/georeplication/switchover/start/sitename/{siteName}/remotesitename/{remoteSiteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
Site with remote site Specific Replication Switchover Stop API
URI: http://base-uri/ocdbtier/georeplication/switchover/stop/sitename/{siteName}/remotesitename/{remoteSiteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
Site Specific Replication Switchover Start API
URI: http://base-uri/ocdbtier/georeplication/switchover/start/sitename/{siteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
Site Specific Replication Switchover Stop API
URI: http://base-uri/ocdbtier/georeplication/switchover/stop/sitename/{siteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| replicationSwitchOver | This attribute indicates the status of the replication switch-over, including actions like starting and stopping. |
DataType: string Constraints: start Default Value: NA |
6.2 Stop Replica API
This section is only for the definition of the Stop Replica API. If you want to stop the replication between the sites follow the section "Procedure to Gracefully Stop Georeplication between Sites" in Oracle Communications Cloud Native Core cnDBTier User Guide.
Note:
The "base-uri" will be "<db-replication-svc Loadbalancer IP>: <db-replication-svc Loadbalancer PORT>"Example:
# If HTTP is enabled in cnDBTier cluster
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl -X PUT http://$IP:$PORT/ocdbtier/georeplication/stopreplica/sitename/{siteName}
# If HTTPS is enabled in cnDBTier cluster
# Obtain the Client certificate which is present in the secret configured by user in "/global/https/secrets/clientSecret". For Ex - client-cert.pem and client-key.pem
# Obtain the CA certificate which is present in the secret configured by user in "/global/https/secrets/caSecret". For Ex - combine-ca.pem
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl --cert client-cert.pem --cert-type PEM --key client-key.pem --key-type PEM --cacert combine-ca.pem -X PUT https://$IP:$PORT/ocdbtier/georeplication/stopreplica/sitename/{siteName}Site with remote site and group id Specific Replication Stop replica Switchover Stop API
URI: http://base-uri/ocdbtier/georeplication/stopreplica/sitename/{siteName}/remotesitename/{remoteSiteName}/replchannelgroupid/{replChannelGroupId}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| stopReplica | This attribute indicates whether replication between corresponding sites has been halted or not. |
DataType: string Constraints: stop Default Value: NA |
Site with remote site Specific Replication Stop replica API
URI: http://base-uri/ocdbtier/georeplication/stopreplica/sitename/{siteName}/remotesitename/{remoteSiteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| stopReplica | This attribute indicates whether replication between corresponding sites has been halted or not. |
DataType: string Constraints: stop Default Value: NA |
Site Specific Replication Stop replica API
URI: http://base-uri/ocdbtier/georeplication/stopreplica/sitename/{siteName}/remotesitename/{remoteSiteName}
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | |
| 404 Not Found | |
|
| 500 Internal Server Error | |
| Fields | Description | Details |
|---|---|---|
| stopReplica | This attribute indicates whether replication between corresponding sites has been halted or not. |
DataType: string Constraints: stop Default Value: NA |
6.3 Listbackups and Heart Beat API
The cnDBTier Listbackups API can be used to determine the backups present in the cnDBTier. These APIs are hosted by the DB Replication service.
Note:
The "base-uri" will be "<db-replication-svc Loadbalancer IP>: <db-replication-svc Loadbalancer PORT>"Example:
# If HTTP is enabled in cnDBTier cluster
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl -i -X GET http://$IP:$PORT/db-tier/backup/site/cluster1/listbackups
# If HTTPS is enabled in cnDBTier cluster
# Obtain the Client certificate which is present in the secret configured by user in "/global/https/secrets/clientSecret". For Ex - client-cert.pem and client-key.pem
# Obtain the CA certificate which is present in the secret configured by user in "/global/https/secrets/caSecret". For Ex - combine-ca.pem
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl --cert client-cert.pem --cert-type PEM --key client-key.pem --key-type PEM --cacert combine-ca.pem -X GET https://$IP:$PORT/db-tier/backup/site/cluster1/listbackupsSite Specific Listing the Backups API
URI: http://base-uri/db-tier/backup/site/{siteName}/listbackups
Method: GET
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK - Fetched the list of backups present in cnDBTier. | |
| 404 NOT FOUND - Improper Site details/table missing |
Site Name is null so cannot list the backup OR Site: <siteName> doesn't match with the current site Name so cannot list the backup OR DBTIER_BACKUP_INFO table doesn't exist in the current site so cannot list the backup |
|
| 500 INTERNAL SERVER ERROR - Could not list the backups | Could not list the backups, <Exception Message> |
| Field | Description | Details |
|---|---|---|
| localSiteName | This attribute displays the name of the current site in which the cnDBTier cluster is deployed. |
DataType: string Constraints: NA Default Value: NA |
| backupDetails | This attribute displays the following information like backup ID, backup size, and backup creation timestamp. |
DataType: List Constraints: NA Default Value: NA |
| backupId | This attribute displays the ID of the stored backup. |
DataType: big integer Constraints: NA Default Value: NA |
| backupSize | This attribute displays the size(in bytes) of the stored backup. |
DataType: big integer Constraints: NA Default Value: NA |
| creationTimeStamp | This attribute displays the time recorded when the backup was stored. |
DataType: timestamp Constraints: NA Default Value: NA |
Site Specific Listing the Heart Beat Status API
URI: http://base-uri/db-tier/status/db-replication-svc/realtime
Method: GET
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK - Fetched the Heart Beat Status of every replication service running on the current cluster | |
| 503 SERVICE_UNAVAILABLE - Not able to query the Data Base | Not able to query the Data Base | |
| 500 INTERNAL_SERVER_ERROR - Could not check the replication service status | Could not check the replication service status, <Exception Message> |
| Field | Description | Details |
|---|---|---|
| localSiteName | This attribute displays the name of the current site in which the cnDBTier cluster is deployed. |
DataType: String Constraints: NA Default Value: NA |
| heartBeatDetails | This attribute displays the following information like remote site name, heartbeat status, heartbeat lag, and replication channel group id. |
DataType: List Constraints: NA Default Value: NA |
| remoteSiteName | This attribute displays the name of the remote site where replication is established. |
DataType: String Constraints: NA Default Value: NA |
| heartBeatStatus | This attribute displays the connectivity status with corresponding sites. |
DataType: String Constraints: SUCCESS, FAILURE Default Value: NA |
| heartBeatLag | This attribute displays the lag or latency in seconds it took to synchronize between sites. |
DataType: String Constraints: NA Default Value: NA |
| replicationChannelGroupId | This attribute displays the ID of the replication channel group. |
DataType: Integer Constraints: NA Default Value: NA |
6.4 Data Memory Usage API
This section provides the Data Memory Usage API that retrieves memory usage details for the cnDBTier cluster, including data memory consumption at the node level.
Site Specific Data Memory Usage API
URI: http://base-uri/db-tier/fetch/datamemory/usage
Method: GET
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK - Fetched the list of backups present in cnDBTier. | |
| 500 INTERNAL SERVER ERROR - Could not list the backups | Error in get_memory_usage: <Exception Message> |
API Configuration
| Field | Description | Details |
|---|---|---|
| total | This attribute displays the name of the total memory. |
DataType: Integer Constraints: NA Default Value: NA |
| used | This attribute displays the total used memory. |
DataType: Integer Constraints: NA Default Value: NA |
| isCompressionEnabled | This attribute displays if compression is enabled or not. |
DataType: Boolean Constraints: true or false Default Value: NA |
6.5 GRR Configuration API
This API is used to configure automatic GRR for cnDBTier.
Note:
The "base-uri" will be "<db-replication-svc Loadbalancer IP>: <db-replication-svc Loadbalancer PORT>"Example:
# If HTTP is enabled in cnDBTier cluster
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl -X GET http://$IP:$PORT/db-tier/site/{siteName}/config/{configNames}
# If HTTPS is enabled in cnDBTier cluster
# Obtain the Client certificate which is present in the secret configured by user in "/global/https/secrets/clientSecret". For Ex - client-cert.pem and client-key.pem
# Obtain the CA certificate which is present in the secret configured by user in "/global/https/secrets/caSecret". For Ex - combine-ca.pem
# Get the replication service LoadBalancer IP for cluster1.
$ IP=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $4}' | head -n 1 )
# Get the replication service LoadBalancer Port for cluster1.
$ PORT=$(kubectl get svc -n cluster1 -l dbtierapp=dbreplicationsvc,servicetype=external --no-headers | awk '{print $5}' | cut -d '/' -f 1 | cut -d ':' -f 1 | head -n 1)
$ curl --cert client-cert.pem --cert-type PEM --key client-key.pem --key-type PEM --cacert combine-ca.pem -X PUT https://$IP:$PORT/db-tier/site/{siteName}/config/{configNames}GRR Config values API (GET)
URL: http://base-uri//db-tier/site/{siteName}/config/{configNames}
Method: GET
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK - Successfully started the On Demand backup | {
"siteName": "<site_name>",
"configEntries": [
{
"configName": "<config_name1>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
},
{
"configName": "<config_name2>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
}
]
} |
| 500 INTERNAL SERVER ERROR | |
|
| 400 BAD REQUEST | |
| Field | Description | Details |
|---|---|---|
| siteName | This attribute displays the siteName. |
DataType: string Constraints: NA Default Value: NA |
| configNames | This attribute displays the Config names for which we want to get the values. |
DataType: List Constraints: BACKUP_SITE_SELECTION_POLICY,PREFERRED_BACKUP_SITE Default Value: NA |
| configEntries | This attribute displays the config entries. |
DataType: List Constraints: NA Default Value: NA |
| configName | This attribute displays the Config name. |
DataType: string Constraints: NA Default Value: NA |
| configValue | This attribute displays the Config value. |
DataType: map Constraints: NA Default Value: NA |
| baseValue | This attribute displays the Config base value. |
DataType: string Constraints: NA Default Value: NA |
| overrideValue | This attribute displays the Config override value. |
DataType: string Constraints: NA Default Value: NA |
GRR Configuration values API (UPDATE)
URL: http://base-uri/db-tier/site/{siteName}/config/{configName}
Method: POST
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
|
200 OK | {
"siteName": "<site_name>",
"configEntries": [
{
"configName": "<config_name1>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
},
{
"configName": "<config_name2>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
}
]
} |
| 500 INTERNAL SERVER ERROR | |
|
| 400 BAD REQUEST | |
| Field | Description | Details |
|---|---|---|
| siteName | This attribute displays the siteName. |
DataType: string Constraints: NA Default Value: NA |
| configNames | This attribute displays the Config names for which we want to get the values. |
DataType: List Constraints: BACKUP_SITE_SELECTION_POLICY,PREFERRED_BACKUP_SITE Default Value: NA |
| configEntries | This attribute displays the config entries. |
DataType: List Constraints: NA Default Value: NA |
| configName | This attribute displays the Config name. |
DataType: string Constraints: NA Default Value: NA |
| configValue | This attribute displays the Config value. |
DataType: map Constraints: NA Default Value: NA |
| baseValue | This attribute displays the Config base value. |
DataType: string Constraints: NA Default Value: NA |
| overrideValue | This attribute displays the Config override value. |
DataType: string Constraints: NA Default Value: NA |
GRR RESET Config override values API
URL: http://base-uri/db-tier/site/{siteName}/config/{configName}/reset }
Method: PUT
API Type: Realtime API
| Request Payload | Response Code | Response Payload |
|---|---|---|
| NA | 200 OK | {
"siteName": "<site_name>",
"configEntries": [
{
"configName": "<config_name1>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
},
{
"configName": "<config_name2>",
"configValue": {
"baseValue": "<config_base_value>",
"overrideValue": "<config_override_value>"
}
}
]
} |
| 500 INTERNAL SERVER ERROR | |
|
| 400 BAD REQUEST | |
|
| 404 NOT FOUND | |
| Field | Description | Details |
|---|---|---|
| siteName | This attribute displays the siteName. |
DataType: string Constraints: NA Default Value: NA |
| configNames | This attribute displays the Config names for which we want to get the values. |
DataType: list Constraints: BACKUP_SITE_SELECTION_POLICY,PREFERRED_BACKUP_SITE Default Value: NA |
| configEntries | This attribute displays the config entries. |
DataType: list Constraints: NA Default Value: NA |
| configName | This attribute displays the Config name. |
DataType: string Constraints: NA Default Value: NA |
| configValue | This attribute displays the Config value. |
DataType: map Constraints: NA Default Value: NA |
| baseValue | This attribute displays the Config base value. |
DataType: string Constraints: NA Default Value: NA |
| overrideValue | This attribute displays the Config override value. |
DataType: string Constraints: NA Default Value: NA |