3 Event Details APIs

The Event Details API will facilitate NF applications to get the DB Tier event details. The Event Details API will be hosted by the DB Monitor service.

Note:

  • "base-uri" will be "<db-monitor-svc service name>.<namespace>:8080"
  • The namespace "occne-cndbtier" is given in the documentation only as an indicative purpose.
  • Users must configure the name according to the environment.

Example:

curl -X POST "curl http://mysql-cluster-db-monitor-svc.<namespace>:8080/db-tier/events/eventsPerPage/{eventsPerPage}/page/{page}" -H "Content-Type: application/json" -d 
'{ "startTimestamp": "<startTimeStamp>", "endTimestamp": "<endTimeStamp>" }'
The Event Details APIs support the following formats for startTimestamp and endTimestamp:
yyyy-MM-dd
yyyy-MM-dd HH:mm:ss
yyyy-MM-ddTHH:mm:ss
yyyy-MM-ddTHH:mm:ssZ
yyyy-MM-ddTHH:mm:ss+00:00

3.1 Get all events details for the current site API

This API retrieves all cnDBTier event details for the current site.

API Definition

URI: http://base-uri/db-tier/events/eventsPerPage/{eventsPerPage}/page/{page}

Method: POST

API Type: Realtime API

Request Payload Response Code Response Payload Notes
{
   "startTimestamp": "<startTime>",
    "endTimestamp": "<endTime>"
}
200 OK
{
  "totalRecords": <totalRecords>,
  "totalPages": <totalPages>,
  "currentPage": 1,
  "nextPage": 2,
  "hasMoreEventRecords":"true/false",
  "eventDetails": [

    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    },
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName2>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    }
  ]
}
Default and initial value for the page is 1.
400 Bad Request
{
  "title": "Bad Request",
  "status": 400,
  "detail": "INVALID_REQUEST",
  "cause":  "<cause>"
  "invalidParams": null
}
500 Internal Server Error
{
  "title": "INTERNAL_SERVER_ERROR",
 "status": 500,
  "detail": "INVALID_REQUEST",
  "cause": "<details>",
   "invalidParams": null
}

API Configuration

Field Description Details
limit This attribute is the number of records per page.

DataType: Integer

Constraints: must be greater than 0 and <=1000

Default: NA

page This attribute is the page number.

DataType: Integer

Constraints: must be greater than 0

Default: 1

startTimestamp This attribute displays the start time of the interval for which user wants the event details.

DataType: String

Constraints: NA

Default: NA

endTimestamp This attribute displays the end time of the interval for which user wants the event details.

DataType: String

Constraints: NA

Default: NA

totalRecords This attribute displays the total number of events between the start and end ts.

DataType: Integer

Constraints: NA

Default: NA

eventDetails This attribute displays the event details between the start and end ts.

DataType: list

Constraints: NA

Default: NA

nextPage This attribute displays the next page.

DataType: Integer

Constraints: NA

Default: NA

totalPages This attribute displays the total number of pages.

DataType: Integer

Constraints: NA

Default: NA

currentPage This attribute displays the current page.

DataType: Integer

Constraints: NA

Default: NA

hasMoreEventRecords This attribute displays the whether more events are there or not.

DataType: Boolean

Constraints: true or false

Default: NA

Table 3-1 Event Types

ID Event Type Description
1 REPL_SKIP_ERROR Records a replication SQL error that was skipped, including the affected replication channel, error details, and recovery information.
2 RESTART_SQL_NODES_FOR_BINLOG_THREAD_STALL Records the automatic restart of an ndbmysqld or ndbappmysqld node after detecting a stalled binlog injector thread.
3 GEO_REPLICATION_RECOVERY Records the progress, state transitions, and outcome of a Geo-Replication Recovery (GRR) operation.
4 MATE_SITE_INFO_EXCHANGE Records the exchange of replication-site information and connection details between the local site and its mate site.
5 REPLICATION_CHANNEL_SETUP Records the creation or configuration of replication channels between the local and mate sites, including the replication channel group.
6 REPLICATION_CHANNEL_SWITCHOVER Records replication-channel role transitions, such as switching a channel between active and standby states.
7 CHANGE_REPLICATION_SOURCE_COMMAND Records commands that configure or update the replication source, including source host, port, binlog position, and replica-start operations.
8 GRACEFUL_BINLOG_PURGE Records normal binlog cleanup up to a safe or selected binlog file, considering replication progress where applicable.
9 FORCE_BINLOG_PURGE Records forced binlog cleanup performed to recover SQL-node storage space when the configured threshold is exceeded.
10 TASK_EXECUTION Records command-queue task details when a task is created, updated, or executed by a cnDBTier service.
11 CONFIG_UPDATE Records the insertion or update of a cnDBTier configuration entry, including its target component and configuration value.

3.2 Get all events details for the current site by event name API

This API retrieves cnDBTier event details for the current site, filtered by a specific event name.

API Definition

URI: http://base-uri/db-tier/events/details/{eventName}/eventsPerPage/{limit}/page/{page}

Method: POST

API Type: Realtime API

Request Payload Response Code Response Payload Notes
{
   "startTimestamp": "<startTime>",
   "endTimestamp": "<endTime>"
 }
200 OK
{
  "totalRecords": <totalRecords>,
  "totalPages": <totalPages>,
  "currentPage": 1,
  "nextPage": 2,
  "hasMoreEventRecords":"true/false",
  "eventDetails": [
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    },
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName2>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    }
  ],
}
Default and initial value for the page is 1.
400 Bad Request
{
  "title": "BAD REQUEST",
  "status": 400,
  "detail": "<details>",
  "cause": "<cause>",
  "invalidParams": null
}
500 Internal Server Error
{
  "title": "INTERNAL_SERVER_ERROR",
 "status": 500,
  "detail": "INVALID_REQUEST",
  "cause": "<details>",
   "invalidParams": null
}
404 Not Found
{
  "title": "Not Found",
  "status": 404,
  "detail": "INVALID_REQUEST",
  "cause":  "<cause>"
  "invalidParams": null
}

API Configuration

Field Description Details
limit This attribute is the number of records per page.

DataType: integer

Constraints: must be grater than 0 and <=1000

Default Value: NA

page This attribute is the page number.

DataType: integer

Constraints: must be greater than 0

Default Value: 1

startTimestamp This attribute displays the start time of the inetrval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

endTimestamp This attribute displays the end time of the inetrval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

totalRecords This attribute displays the total number of events between the start and end ts.

DataType: integer

Constraints: NA

Default Value: NA

eventDetails This attribute displays the event details between the start and end ts.

DataType: list

Constraints: NA

Default Value: NA

nextPage This attribute displays the next page.

DataType: integer

Constraints: NA

Default Value: NA

totalPages This attribute displays the total number of pages.

DataType: integer

Constraints: NA

Default Value: NA

currentPage This attribute displays the current page.

DataType: integer

Constraints: NA

Default Value: NA

hasMoreEventRecords This attribute displays the whether more events are there or not.

DataType: boolean

Constraints: true or false

Default Value: NA

3.3 Get all events details for the current site by remote site API

API Definition

URI: http://base-uri/db-tier/events/site/{siteName}/remotesite/{remotesiteName}/eventsPerPage/{limit}/page/{page}

Method: POST

API Type: Realtime API

Request Payload Response Code Response Payload Notes
{

   "startTimestamp": "<startTime>",
   "endTimestamp": "<endTime>"

 }
200 OK
{
 "totalRecords": <totalRecords>,
  "totalPages": <totalPages>,
  "currentPage": 1,
  "nextPage": 2,
  "hasMoreEventRecords":"true/false",
  "eventDetails": [
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    },
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    }
  ]
}
Default and initial value for the page is 1.
400 Bad Request
{
  "title": "BAD REQUEST",
  "status": 400,
  "detail": "<details>",
  "cause": "<cause>",
  "invalidParams": null
}
500 Internal Server Error
{
  "title": "INTERNAL_SERVER_ERROR",
 "status": 500,
  "detail": "INVALID_REQUEST",
  "cause": "<details>",
   "invalidParams": null
}
404 Not Found
{
  "title": "Not Found",
  "status": 404,
  "detail": "INVALID_REQUEST",
  "cause":  "<cause>"
  "invalidParams": null
}

API Configuration

Field Description Details
startTimestamp This attribute displays the start time of the interval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

limit This attribute is the number of records per page.

DataType: integer

Constraints: must be greater than 0 and <=1000

Default Value: NA

page This attribute is the page number.

DataType: integer

Constraints: must be greater than 0

Default Value: 1

endTimestamp This attribute displays the end time of the interval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

totalRecords This attribute displays the total number of events between the start and end ts.

DataType: integer

Constraints: NA

Default Value: NA

eventDetails This attribute displays the event details between the start and end ts.

DataType: list

Constraints: NA

Default Value: NA

nextPage This attribute displays the next page.

DataType: integer

Constraints: NA

Default Value: NA

totalPages This attribute displays the total number of pages.

DataType: integer

Constraints: NA

Default Value: NA

currentPage This attribute displays the current page.

DataType: integer

Constraints: NA

Default Value: NA

hasMoreEventRecords This attribute displays the whether more events are there or not.

DataType: boolean

Constraints: true or false

Default Value: NA

3.4 Get all events details for the current site by remote site and replication channel group ID API

This API retrieves cnDBTier event details for the current site, filtered by a specific remote site and replication channel group ID.

API Definition

URI: http://base-uri/db-tier/events/site/{siteName}/remotesite/{remotesiteName}/replChannelGrpId/{replChannelGrpId}/eventsPerPage/{limit}/page/{page}

Method: POST

API Type: Realtime API

Request Payload Response Code Response Payload Notes
{
   "startTimestamp": "<startTime>",
   "endTimestamp": "<endTime>"
}
200 OK
{
 "totalRecords": <totalRecords>,
  "totalPages": <totalPages>,
  "currentPage": 1,
  "nextPage": 2,
 "hasMoreEventRecords":"true/false",
  "eventDetails": [
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    },
    {
      "siteName": "<siteName>",
      "mateSiteName": "<mateSiteName>",
      "replChannelGroupId": "<replChannelGroupId>",
      "eventId": "<event_id>",
      "eventTypeName": "<event_name>",
      "eventTime": "<event_ts>",
      "description": "<event_description>"
    }
  ]
}
Default and initial value for the page is 1.
400 Bad Request
{
  "title": "BAD REQUEST",
  "status": 400,
  "detail": "<details>",
  "cause": "<cause>",
  "invalidParams": null
}
500 Internal Server Error
{
  "title": "INTERNAL_SERVER_ERROR",
 "status": 500,
  "detail": "INVALID_REQUEST",
  "cause": "<details>",
   "invalidParams": null
}
404 Not Found
{
  "title": "Not Found",
  "status": 404,
  "detail": "INVALID_REQUEST",
  "cause":  "<cause>"
  "invalidParams": null
}

API Configuration

Field Description Details
limit This attribute is the number of records per page.

DataType: integer

Constraints: must be greater than 0 and <=1000

Default Value: NA

page This attribute is the page number.

DataType: integer

Constraints: must be greater than 0

Default Value: 1

startTimestamp This attribute displays the start time of the interval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

endTimestamp This attribute displays the end time of the interval for which user wants the event details.

DataType: string

Constraints: NA

Default Value: NA

totalRecords This attribute displays the total number of events between the start and end ts.

DataType: integer

Constraints: NA

Default Value: NA

eventDetails This attribute displays the event details between the start and end ts.

DataType: list

Constraints: NA

Default Value: NA

nextPage This attribute displays the next page.

DataType: integer

Constraints: NA

Default Value: NA

totalPages This attribute displays the total number of pages.

DataType: integer

Constraints: NA

Default Value: NA

currentPage This attribute displays the current page.

DataType: integer

Constraints: NA

Default Value: NA

hasMoreEventRecords This attribute displays the whether more events are there or not.

DataType: boolean

Constraints: NA

Default Value: true or false