You can call the DescribeEvents operation to query the historical events of an ApsaraDB RDS instance.

The event history feature enables you to view the events that occurred within a region over a specific time range. Historical events include instance creation and parameter modification. For more information, see View the event history of an ApsaraDB RDS instance.

Before you call this operation, make sure that the event history feature is enabled. Otherwise, this operation fails.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeEvents

The operation that you want to perform. Set the value to DescribeEvents.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the IDs of regions.

StartTime String No 2019-06-11T15:00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

EndTime String No 2019-06-12T15:00:00Z

The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

PageSize Integer No 30

The number of entries to return on each page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

PageNumber Integer No 1

The number of the page to return. Valid values: any non-zero positive integer.

Default value: 1.

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The page number of the returned page.

RequestId String A103039D-B1B2-4C57-B989-7D7C0DA95426

The ID of the request.

PageSize Integer 30

The number of entries returned per page.

TotalRecordCount Integer 40

The total number of entries returned.

EventItems Array of EventItems

The details of the events.

EventItems
EventName String ModifySecurityIPList

The name of the event. For more information, see View the event history of an ApsaraDB RDS instance.

EventTime String 2019-08-20T01:08:22Z

The time when the event occurred.

EventUserType String SYSTEM

The type of the user who executed the event.

EventRecordTime String 2019-08-20T01:12:49Z

The time when the event was recorded. The time is slightly later than the time the event occurred.

CallerUid Long 22973492**********

The ID of the user who executed the event.

RegionId String cn-hangzhou

The region ID of the instance.

EventId Integer 11000053

The ID of the event.

EventType String NetworkManagement

The type of the event. For more information, see View the event history of an ApsaraDB RDS instance.

ResourceType String instance

The type of the resource associated with the event. Only instances are supported for this parameter.

EventPayload String {\"Domain\": \"rds-inc-share.aliyuncs.com\", \"Api\": \"ReleaseInstancePublicConnection\"}

The request or context parameters of the event.

EventReason String FROM_USER

The source of the event. For more information, see View the event history of an ApsaraDB RDS instance.

ResourceName String rm-bp1z3065m9976ix8a

The name of the resource associated with the event. Only instance IDs are supported for this parameter.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=DescribeEvents
&Region=cn-hangzhou
&StartTime=2019-08-20T01:30:00Z
&EndTime=2019-08-20T01:35:00Z
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeEventsResponse>
    <EventItems>
        <EventItems>
            <EventName>ModifySecurityIPList</EventName>
            <EventUserType>SYSTEM</EventUserType>
            <ResourceType>instance</ResourceType>
            <EventPayload/>
            <EventTime>2019-08-20T01:33:43Z</EventTime>
            <RegionId>cn-hangzhou</RegionId>
            <EventRecordTime>2019-08-20T01:33:57Z</EventRecordTime>
            <EventReason>FROM_SYSTEM</EventReason>
            <EventId>11000048</EventId>
            <ResourceName>rm-bpxxxxxxx</ResourceName>
            <EventType>SecurityManagement</EventType>
            <CallerUid>25421491**********</CallerUid>
        </EventItems>
        <EventItems>
            <EventName>ModifySecurityIPList</EventName>
            <EventUserType>SYSTEM</EventUserType>
            <ResourceType>instance</ResourceType>
            <EventPayload/>
            <EventTime>2019-08-20T01:33:43Z</EventTime>
            <RegionId>cn-hangzhou</RegionId>
            <EventRecordTime>2019-08-20T01:33:57Z</EventRecordTime>
            <EventReason>FROM_SYSTEM</EventReason>
            <EventId>11000047</EventId>
            <ResourceName>rm-bpxxxxxxx</ResourceName>
            <EventType>SecurityManagement</EventType>
            <CallerUid>22973492**********</CallerUid>
        </EventItems>
    </EventItems>
    <TotalRecordCount>2</TotalRecordCount>
    <PageNumber>1</PageNumber>
    <PageSize>2</PageSize>
    <RequestId>B5FF9EE6-830E-4DBE-8498-9890A62D2875</RequestId>
</DescribeEventsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "EventItems" : {
    "EventItems" : [ {
      "EventName" : "ModifySecurityIPList",
      "EventUserType" : "SYSTEM",
      "ResourceType" : "instance",
      "EventPayload" : "",
      "EventTime" : "2019-08-20T01:33:43Z",
      "RegionId" : "cn-hangzhou",
      "EventRecordTime" : "2019-08-20T01:33:57Z",
      "EventReason" : "FROM_SYSTEM",
      "EventId" : 11000048,
      "ResourceName" : "rm-bpxxxxxxx",
      "EventType" : "SecurityManagement",
      "CallerUid" : "25421491**********"
    }, {
      "EventName" : "ModifySecurityIPList",
      "EventUserType" : "SYSTEM",
      "ResourceType" : "instance",
      "EventPayload" : "",
      "EventTime" : "2019-08-20T01:33:43Z",
      "RegionId" : "cn-hangzhou",
      "EventRecordTime" : "2019-08-20T01:33:57Z",
      "EventReason" : "FROM_SYSTEM",
      "EventId" : 11000047,
      "ResourceName" : "rm-bpxxxxxxx",
      "EventType" : "SecurityManagement",
      "CallerUid" : "22973492**********"
    } ]
  },
  "TotalRecordCount" : 2,
  "PageNumber" : 1,
  "PageSize" : 2,
  "RequestId" : "B5FF9EE6-830E-4DBE-8498-9890A62D2875"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidStartTime.Format Specified start time is not valid. The error message returned because the specified start time is invalid.
400 InvalidParameterCombination The end time must be greater than the start time The error message returned because the end time must be later than the start time.
400 RegionNotSupport The region is not supported. The error message returned because the operation is not supported in the region.

For a list of error codes, visit the API Error Center.