DescribeEventsCommand

Returns events related to instances, security groups, snapshots, and DB parameter groups for the past 14 days. You can obtain events specific to a particular DB instance, security group, snapshot, or parameter group by providing the name as a parameter. By default, the events of the past hour are returned.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DocDBClient, DescribeEventsCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, DescribeEventsCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // DescribeEventsMessage
  SourceIdentifier: "STRING_VALUE",
  SourceType: "db-instance" || "db-parameter-group" || "db-security-group" || "db-snapshot" || "db-cluster" || "db-cluster-snapshot",
  StartTime: new Date("TIMESTAMP"),
  EndTime: new Date("TIMESTAMP"),
  Duration: Number("int"),
  EventCategories: [ // EventCategoriesList
    "STRING_VALUE",
  ],
  Filters: [ // FilterList
    { // Filter
      Name: "STRING_VALUE", // required
      Values: [ // FilterValueList // required
        "STRING_VALUE",
      ],
    },
  ],
  MaxRecords: Number("int"),
  Marker: "STRING_VALUE",
};
const command = new DescribeEventsCommand(input);
const response = await client.send(command);
// { // EventsMessage
//   Marker: "STRING_VALUE",
//   Events: [ // EventList
//     { // Event
//       SourceIdentifier: "STRING_VALUE",
//       SourceType: "db-instance" || "db-parameter-group" || "db-security-group" || "db-snapshot" || "db-cluster" || "db-cluster-snapshot",
//       Message: "STRING_VALUE",
//       EventCategories: [ // EventCategoriesList
//         "STRING_VALUE",
//       ],
//       Date: new Date("TIMESTAMP"),
//       SourceArn: "STRING_VALUE",
//     },
//   ],
// };

DescribeEventsCommand Input

See DescribeEventsCommandInput for more details

Parameter
Type
Description
Duration
number | undefined

The number of minutes to retrieve events for.

Default: 60

EndTime
Date | undefined

The end of the time interval for which to retrieve events, specified in ISO 8601 format.

Example: 2009-07-08T18:00Z

EventCategories
string[] | undefined

A list of event categories that trigger notifications for an event notification subscription.

Filters
Filter[] | undefined

This parameter is not currently supported.

Marker
string | undefined

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

MaxRecords
number | undefined

The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token (marker) is included in the response so that the remaining results can be retrieved.

Default: 100

Constraints: Minimum 20, maximum 100.

SourceIdentifier
string | undefined

The identifier of the event source for which events are returned. If not specified, then all sources are included in the response.

Constraints:

  • If SourceIdentifier is provided, SourceType must also be provided.

  • If the source type is DBInstance, a DBInstanceIdentifier must be provided.

  • If the source type is DBSecurityGroup, a DBSecurityGroupName must be provided.

  • If the source type is DBParameterGroup, a DBParameterGroupName must be provided.

  • If the source type is DBSnapshot, a DBSnapshotIdentifier must be provided.

  • Cannot end with a hyphen or contain two consecutive hyphens.

SourceType
SourceType | undefined

The event source to retrieve events for. If no value is specified, all events are returned.

StartTime
Date | undefined

The beginning of the time interval to retrieve events for, specified in ISO 8601 format.

Example: 2009-07-08T18:00Z

DescribeEventsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Events
Event[] | undefined

Detailed information about one or more events.

Marker
string | undefined

An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

Throws

Name
Fault
Details
DocDBServiceException
Base exception class for all service exceptions from DocDB service.