1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Amazon Elastic Kubernetes Service API client.
//!
//! Thin wrapper over generated ops. All URL construction and HTTP methods
//! are in `ops::eks::EksOps`. This layer adds:
//! - Ergonomic method signatures
use crate::{
AwsHttpClient, Result,
ops::eks::EksOps,
types::eks::{
DescribeClusterResponse, DescribeNodegroupResponse, ListNodegroupsResponse,
UpdateNodegroupConfigRequest, UpdateNodegroupConfigResponse,
},
};
/// Client for the Amazon Elastic Kubernetes Service API
pub struct EksClient<'a> {
ops: EksOps<'a>,
}
impl<'a> EksClient<'a> {
/// Create a new Amazon Elastic Kubernetes Service API client
pub(crate) fn new(client: &'a AwsHttpClient) -> Self {
Self {
ops: EksOps::new(client),
}
}
/// Returns descriptive information about an Amazon EKS cluster.
pub async fn describe_cluster(&self, name: &str) -> Result<DescribeClusterResponse> {
self.ops.describe_cluster(name).await
}
/// Lists the managed node groups associated with the specified cluster.
pub async fn list_nodegroups(
&self,
name: &str,
max_results: &str,
next_token: &str,
) -> Result<ListNodegroupsResponse> {
self.ops
.list_nodegroups(name, max_results, next_token)
.await
}
/// Returns descriptive information about an Amazon EKS node group.
pub async fn describe_nodegroup(
&self,
name: &str,
nodegroup_name: &str,
) -> Result<DescribeNodegroupResponse> {
self.ops.describe_nodegroup(name, nodegroup_name).await
}
/// Updates an Amazon EKS managed node group configuration.
pub async fn update_nodegroup_config(
&self,
name: &str,
nodegroup_name: &str,
body: &UpdateNodegroupConfigRequest,
) -> Result<UpdateNodegroupConfigResponse> {
self.ops
.update_nodegroup_config(name, nodegroup_name, body)
.await
}
}