Querying Events
Function
This API is used to query events of a DB instance.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about the request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
rds:event:list |
list |
- |
- |
- |
- |
URI
- URI format
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Definition
Project ID of a tenant in a region.
Constraints
The value cannot be empty.
Range
To obtain the value, see Obtaining a Project ID.
Default Value
N/A
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
Definition Event ID. Constraints N/A Range N/A Default Value N/A |
|
instance_id |
No |
String |
Definition Instance ID. Constraints N/A Range N/A Default Value N/A |
|
status |
No |
String |
Definition Event status. Constraints N/A Range
Default Value Empty |
|
type |
No |
String |
Definition Event type. Constraints N/A Range RESTAT_NODE: Restart an instance node. Default Value Empty |
|
level |
No |
String |
Definition Event severity. Constraints N/A Range
Default Value Empty |
|
sort_field |
No |
String |
Definition Sorting field. Constraints N/A Range planned_execution_time, created_time, and latest_execution_time are supported. Default Value Empty |
|
order |
No |
String |
Definition Sorting order. Constraints N/A Range
Default Value DESC |
|
offset |
No |
Integer |
Definition Index offset. The query starts from the next piece of data indexed by this parameter. Constraints N/A Range The value is greater than or equal to 0. Default Value 0: The query starts from the first data record. |
|
limit |
No |
Integer |
Definition Number of records returned by a query. Constraints N/A Range 1–100 Default Value 10 |
Example Request
Query events of a DB instance.
GET https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/schedule-events
{
"id": "67323a8c-75aa-4d81-941e-02621ccd4d07",
"instance_id": "6970e9cf7adc41a78e0f1f50215c9d3bin03",
"status": "INQUIRING",
"type": "RESTAT_NODE",
"offset": 0,
"limit": 50,
"sort_field": "created_time",
"order": "DESC"
}
Response
- Normal response
Table 3 Response body parameters Parameter
Type
Description
total_count
Integer
Definition
Total number of events.
Range
N/A
inquiring_count
Integer
Definition
Number of events to be authorized.
Range
N/A
schedule_count
Integer
Definition
Number of events to be executed.
Range
N/A
executing_count
Integer
Definition
Number of events being executed.
Range
N/A
failed_count
Integer
Definition
Number of events that failed to be executed.
Range
N/A
events
Array of objects
Definition
Event details list. For details, see Table 4.
Table 4 events field description Parameter
Type
Description
id
String
Definition
Event ID.
Range
N/A
instance_id
String
Definition
Instance ID.
Range
N/A
instance_name
String
Definition
Instance name.
Range
N/A
db_type
String
Definition
DB engine type.
Range
- mysql
- postgresql
- sqlserver
created_time
String
Definition
Event creation time.
Range
N/A
update_time
String
Definition
Event update time.
Range
N/A
type
String
Definition
Event type.
Range
N/A
impact
String
Definition
Impact of the event on the system.
Range
N/A
status
String
Definition
Event status.
Range
- WAITING: The event is waiting.
- INQUIRING: The event is to be authorized.
- SCHEDULED: The event is to be executed.
- EXECUTING: The event is being executed.
- COMPLETED: The event is complete.
- FAILED: The event failed.
- CANCELED: The event is canceled.
reason
String
Definition
Cause of the event.
Range
N/A
level
String
Definition
Event severity.
Range
- CRITICAL
- MAJOR
- MINOR
- INFO
execute_time
String
Definition
Event execution time.
Range
N/A
latest_execution_time
String
Definition
Time when the event was last executed.
Range
N/A
- Example normal response
{ "total_count": 1, "inquiring_count": 1, "schedule_count": 0, "executing_count": 0, "failed_count": 0, "events": [ { "id": "created_time", "instance_name": "TestInstance", "db_type": "postgresql", "created_time": "2024-06-30T09:04:35+0800", "update_time": "2024-06-30T09:04:35+0800", "type": "RESTAT_NODE", "impact": "Instance Intermittent Disconnection", "status": "INQUIRING", "reason": "ECS_RESTART", "level": "MAJOR", "execute_time": "", "latest_execution_time": "", "execution_time_window": { "planned_execution_time": "2024-06-30T23:00:00+0800", "start_time": "2024-06-30T22:00:00+0800", "end_time": "2024-06-30T24:00:00+0800" } } ] } - Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot