Skip to main content

aws_lite_rs/api/
emr.rs

1//! Amazon EMR API client.
2//!
3//! Thin wrapper over generated ops. All URL construction and HTTP methods
4//! are in `ops::emr::EmrOps`. This layer adds:
5//! - Ergonomic method signatures
6
7use crate::{
8    AwsHttpClient, Result,
9    ops::emr::EmrOps,
10    types::emr::{
11        DescribeClusterInput, DescribeClusterOutput, ListClustersInput, ListClustersOutput,
12        TerminateJobFlowsInput,
13    },
14};
15
16/// Client for the Amazon EMR API
17pub struct EmrClient<'a> {
18    ops: EmrOps<'a>,
19}
20
21impl<'a> EmrClient<'a> {
22    /// Create a new Amazon EMR API client
23    pub(crate) fn new(client: &'a AwsHttpClient) -> Self {
24        Self {
25            ops: EmrOps::new(client),
26        }
27    }
28
29    /// Provides the status of all clusters visible to this Amazon Web Services account.
30    pub async fn list_clusters(&self, body: &ListClustersInput) -> Result<ListClustersOutput> {
31        self.ops.list_clusters(body).await
32    }
33
34    /// Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.
35    pub async fn describe_cluster(
36        &self,
37        body: &DescribeClusterInput,
38    ) -> Result<DescribeClusterOutput> {
39        self.ops.describe_cluster(body).await
40    }
41
42    /// TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow is shut down, any step not yet completed is
43    pub async fn terminate_job_flows(&self, body: &TerminateJobFlowsInput) -> Result<()> {
44        self.ops.terminate_job_flows(body).await
45    }
46}