- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
Parameter | Type | Description |
---|
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 | number | undefined | The maximum number of records to include in the response. If more records exist than the specified 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:
|
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 |
---|
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 |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DocDBServiceException | Base exception class for all service exceptions from DocDB service. |