ListInsightsCommand

Returns a list of all insights checked for against the specified cluster. You can filter which insights are returned by category, associated Kubernetes version, and status. The default filter lists all categories and every status.

The following lists the available categories:

  • UPGRADE_READINESS: Amazon EKS identifies issues that could impact your ability to upgrade to new versions of Kubernetes. These are called upgrade insights.

  • MISCONFIGURATION: Amazon EKS identifies misconfiguration in your EKS Hybrid Nodes setup that could impair functionality of your cluster or workloads. These are called configuration insights.

Example Syntax

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

import { EKSClient, ListInsightsCommand } from "@aws-sdk/client-eks"; // ES Modules import
// const { EKSClient, ListInsightsCommand } = require("@aws-sdk/client-eks"); // CommonJS import
const client = new EKSClient(config);
const input = { // ListInsightsRequest
  clusterName: "STRING_VALUE", // required
  filter: { // InsightsFilter
    categories: [ // CategoryList
      "UPGRADE_READINESS" || "MISCONFIGURATION",
    ],
    kubernetesVersions: [ // StringList
      "STRING_VALUE",
    ],
    statuses: [ // InsightStatusValueList
      "PASSING" || "WARNING" || "ERROR" || "UNKNOWN",
    ],
  },
  maxResults: Number("int"),
  nextToken: "STRING_VALUE",
};
const command = new ListInsightsCommand(input);
const response = await client.send(command);
// { // ListInsightsResponse
//   insights: [ // InsightSummaries
//     { // InsightSummary
//       id: "STRING_VALUE",
//       name: "STRING_VALUE",
//       category: "UPGRADE_READINESS" || "MISCONFIGURATION",
//       kubernetesVersion: "STRING_VALUE",
//       lastRefreshTime: new Date("TIMESTAMP"),
//       lastTransitionTime: new Date("TIMESTAMP"),
//       description: "STRING_VALUE",
//       insightStatus: { // InsightStatus
//         status: "PASSING" || "WARNING" || "ERROR" || "UNKNOWN",
//         reason: "STRING_VALUE",
//       },
//     },
//   ],
//   nextToken: "STRING_VALUE",
// };

ListInsightsCommand Input

See ListInsightsCommandInput for more details

Parameter
Type
Description
clusterName
Required
string | undefined

The name of the Amazon EKS cluster associated with the insights.

filter
InsightsFilter | undefined

The criteria to filter your list of insights for your cluster. You can filter which insights are returned by category, associated Kubernetes version, and status.

maxResults
number | undefined

The maximum number of identity provider configurations returned by ListInsights in paginated output. When you use this parameter, ListInsights returns only maxResults results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListInsights request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListInsights returns up to 100 results and a nextToken value, if applicable.

nextToken
string | undefined

The nextToken value returned from a previous paginated ListInsights request. When the results of a ListInsights request exceed maxResults, you can use this value to retrieve the next page of results. This value is null when there are no more results to return.

ListInsightsCommand Output

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

The returned list of insights.

nextToken
string | undefined

The nextToken value to include in a future ListInsights request. When the results of a ListInsights request exceed maxResults, you can use this value to retrieve the next page of results. This value is null when there are no more results to return.

Throws

Name
Fault
Details
InvalidParameterException
client

The specified parameter is invalid. Review the available parameters for the API request.

InvalidRequestException
client

The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.

ResourceNotFoundException
client

The specified resource could not be found. You can view your available clusters with ListClusters. You can view your available managed node groups with ListNodegroups. Amazon EKS clusters and node groups are Amazon Web Services Region specific.

ServerException
server

These errors are usually caused by a server-side issue.

EKSServiceException
Base exception class for all service exceptions from EKS service.