ListIncidentRecordsCommand

Lists all incident records in your account. Use this command to retrieve the Amazon Resource Name (ARN) of the incident record you want to update.

Example Syntax

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

import { SSMIncidentsClient, ListIncidentRecordsCommand } from "@aws-sdk/client-ssm-incidents"; // ES Modules import
// const { SSMIncidentsClient, ListIncidentRecordsCommand } = require("@aws-sdk/client-ssm-incidents"); // CommonJS import
const client = new SSMIncidentsClient(config);
const input = { // ListIncidentRecordsInput
  filters: [ // FilterList
    { // Filter
      key: "STRING_VALUE", // required
      condition: { // Condition Union: only one key present
        before: new Date("TIMESTAMP"),
        after: new Date("TIMESTAMP"),
        equals: { // AttributeValueList Union: only one key present
          stringValues: [ // StringList
            "STRING_VALUE",
          ],
          integerValues: [ // IntegerList
            Number("int"),
          ],
        },
      },
    },
  ],
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
};
const command = new ListIncidentRecordsCommand(input);
const response = await client.send(command);
// { // ListIncidentRecordsOutput
//   incidentRecordSummaries: [ // IncidentRecordSummaryList // required
//     { // IncidentRecordSummary
//       arn: "STRING_VALUE", // required
//       title: "STRING_VALUE", // required
//       status: "STRING_VALUE", // required
//       impact: Number("int"), // required
//       creationTime: new Date("TIMESTAMP"), // required
//       resolvedTime: new Date("TIMESTAMP"),
//       incidentRecordSource: { // IncidentRecordSource
//         createdBy: "STRING_VALUE", // required
//         invokedBy: "STRING_VALUE",
//         resourceArn: "STRING_VALUE",
//         source: "STRING_VALUE", // required
//       },
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

ListIncidentRecordsCommand Input

See ListIncidentRecordsCommandInput for more details

Parameter
Type
Description
filters
Filter[] | undefined

Filters the list of incident records you want to search through. You can filter on the following keys:

  • creationTime

  • impact

  • status

  • createdBy

Note the following when when you use Filters:

  • If you don't specify a Filter, the response includes all incident records.

  • If you specify more than one filter in a single request, the response returns incident records that match all filters.

  • If you specify a filter with more than one value, the response returns incident records that match any of the values provided.

maxResults
number | undefined

The maximum number of results per page.

nextToken
string | undefined

The pagination token for the next set of items to return. (You received this token from a previous call.)

ListIncidentRecordsCommand Output

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

The details of each listed incident record.

nextToken
string | undefined

The pagination token to use when requesting the next set of items. If there are no additional items to return, the string is null.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have sufficient access to perform this operation.

InternalServerException
server

The request processing has failed because of an unknown error, exception or failure.

ThrottlingException
client

The request was denied due to request throttling.

ValidationException
client

The input fails to satisfy the constraints specified by an Amazon Web Services service.

SSMIncidentsServiceException
Base exception class for all service exceptions from SSMIncidents service.