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.
Parameters:
-
cluster_name
(String)
–
The name of the Amazon EKS cluster associated with the insights.
-
filter
(Optional[InsightsFilter], default:
None
)
–
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.
-
max_results
(Optional[ListInsightsMaxResults], default:
None
)
–
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.
-
next_token
(Optional[String], default:
None
)
–
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.
Raises:
-
InvalidParameterException
–
The specified parameter is invalid. Review the available parameters for the API request.
-
InvalidRequestException
–
The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.
-
ResourceNotFoundException
–
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
–
These errors are usually caused by a server-side issue.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_eks/_services/eks.py
| def list_insights(
self,
cluster_name: "capo_eks.types.string.String",
*,
config_overrides: Optional[EKSClientConfig] = None,
filter: Optional["capo_eks.types.insights_filter.InsightsFilter"] = None,
max_results: Optional[
"capo_eks.types.list_insights_max_results.ListInsightsMaxResults"
] = None,
next_token: Optional["capo_eks.types.string.String"] = None,
) -> "capo_eks.types.list_insights_response.ListInsightsResponse":
"""<p>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.</p> <p>The following lists the available categories:</p> <ul> <li> <p> <code>UPGRADE_READINESS</code>: Amazon EKS identifies issues that could impact your ability to upgrade to new versions of Kubernetes. These are called upgrade insights.</p> </li> <li> <p> <code>MISCONFIGURATION</code>: Amazon EKS identifies misconfiguration in your EKS Hybrid Nodes setup that could impair functionality of your cluster or workloads. These are called configuration insights.</p> </li> </ul>
Args:
cluster_name: <p>The name of the Amazon EKS cluster associated with the insights.</p>
filter: <p>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.</p>
max_results: <p>The maximum number of identity provider configurations returned by <code>ListInsights</code> in paginated output. When you use this parameter, <code>ListInsights</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListInsights</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListInsights</code> returns up to 100 results and a <code>nextToken</code> value, if applicable.</p>
next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListInsights</code> request. When the results of a <code>ListInsights</code> request exceed <code>maxResults</code>, you can use this value to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
Raises:
capo_eks.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
capo_eks.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.</p>
capo_eks.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found. You can view your available clusters with <code>ListClusters</code>. You can view your available managed node groups with <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region specific.</p>
capo_eks.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
capo_eks.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_eks.types.list_insights_request.ListInsightsRequest]",
) -> OperationResponse[
"capo_eks.types.list_insights_response.ListInsightsResponse"
]:
import capo_eks._operations.aws_wesley_frontend.list_insights
output, http_response = (
capo_eks._operations.aws_wesley_frontend.list_insights.list_insights(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListInsights")
)
input_: capo_eks.types.list_insights_request.ListInsightsRequest = {
"cluster_name": cluster_name
}
if filter is not None:
input_["filter"] = filter
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|