ListFindingsCommand

Retrieves a subset of information about one or more findings.

Example Syntax

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

import { Macie2Client, ListFindingsCommand } from "@aws-sdk/client-macie2"; // ES Modules import
// const { Macie2Client, ListFindingsCommand } = require("@aws-sdk/client-macie2"); // CommonJS import
const client = new Macie2Client(config);
const input = { // ListFindingsRequest
  findingCriteria: { // FindingCriteria
    criterion: { // Criterion
      "<keys>": { // CriterionAdditionalProperties
        eq: [ // __listOf__string
          "STRING_VALUE",
        ],
        eqExactMatch: [
          "STRING_VALUE",
        ],
        gt: Number("long"),
        gte: Number("long"),
        lt: Number("long"),
        lte: Number("long"),
        neq: [
          "STRING_VALUE",
        ],
      },
    },
  },
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
  sortCriteria: { // SortCriteria
    attributeName: "STRING_VALUE",
    orderBy: "ASC" || "DESC",
  },
};
const command = new ListFindingsCommand(input);
const response = await client.send(command);
// { // ListFindingsResponse
//   findingIds: [ // __listOf__string
//     "STRING_VALUE",
//   ],
//   nextToken: "STRING_VALUE",
// };

ListFindingsCommand Input

See ListFindingsCommandInput for more details

Parameter
Type
Description
findingCriteria
FindingCriteria | undefined

The criteria to use to filter the results.

maxResults
number | undefined

The maximum number of items to include in each page of the response.

nextToken
string | undefined

The nextToken string that specifies which page of results to return in a paginated response.

sortCriteria
SortCriteria | undefined

The criteria to use to sort the results.

ListFindingsCommand Output

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

An array of strings, where each string is the unique identifier for a finding that matches the filter criteria specified in the request.

nextToken
string | undefined

The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.

Throws

Name
Fault
Details
AccessDeniedException
client

Provides information about an error that occurred due to insufficient access to a specified resource.

ConflictException
client

Provides information about an error that occurred due to a versioning conflict for a specified resource.

InternalServerException
server

Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

ResourceNotFoundException
client

Provides information about an error that occurred because a specified resource wasn't found.

ServiceQuotaExceededException
client

Provides information about an error that occurred due to one or more service quotas for an account.

ThrottlingException
client

Provides information about an error that occurred because too many requests were sent during a certain amount of time.

ValidationException
client

Provides information about an error that occurred due to a syntax error in a request.

Macie2ServiceException
Base exception class for all service exceptions from Macie2 service.