aws_lite_rs/types/emr.rs
1//! Types for the Amazon EMR API (v1).
2//!
3//! Auto-generated from the AWS Botocore Model.
4//! **Do not edit manually** — modify the manifest and re-run codegen.
5
6use serde::{Deserialize, Serialize};
7
8/// This input determines how the ListClusters action filters the list of clusters that it
9/// returns.
10///
11/// **AWS API**: `emr.v1.ListClustersInput`
12#[derive(Debug, Clone, Default, Serialize, Deserialize)]
13#[serde(rename_all = "PascalCase")]
14pub struct ListClustersInput {
15 /// The creation date and time beginning value filter for listing clusters.
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub created_after: Option<f64>,
18
19 /// The creation date and time end value filter for listing clusters.
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub created_before: Option<f64>,
22
23 /// The cluster state filters to apply when listing clusters. Clusters that change state
24 /// while this action runs may be not be returned as expected in the list of clusters.
25 #[serde(default)]
26 #[serde(skip_serializing_if = "Vec::is_empty")]
27 pub cluster_states: Vec<String>,
28
29 /// The pagination token that indicates the next set of results to retrieve.
30 #[serde(skip_serializing_if = "Option::is_none")]
31 pub marker: Option<String>,
32}
33
34impl ListClustersInput {
35 #[cfg(any(test, feature = "test-support"))]
36 /// Create a fixture instance for testing.
37 pub fn fixture() -> Self {
38 Self {
39 cluster_states: vec![],
40 marker: Some("test-marker".into()),
41 ..Default::default()
42 }
43 }
44}
45
46/// This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs,
47/// names, and status.
48///
49/// **AWS API**: `emr.v1.ListClustersOutput`
50#[derive(Debug, Clone, Default, Serialize, Deserialize)]
51#[serde(rename_all = "PascalCase")]
52pub struct ListClustersOutput {
53 /// The list of clusters for the account based on the given filters.
54 #[serde(default)]
55 #[serde(skip_serializing_if = "Vec::is_empty")]
56 pub clusters: Vec<ClusterSummary>,
57
58 /// The pagination token that indicates the next set of results to retrieve.
59 #[serde(skip_serializing_if = "Option::is_none")]
60 pub marker: Option<String>,
61}
62
63impl ListClustersOutput {
64 #[cfg(any(test, feature = "test-support"))]
65 /// Create a fixture instance for testing.
66 pub fn fixture() -> Self {
67 Self {
68 clusters: vec![],
69 marker: Some("test-marker".into()),
70 }
71 }
72}
73
74/// The summary description of the cluster.
75///
76/// **AWS API**: `emr.v1.ClusterSummary`
77#[derive(Debug, Clone, Default, Serialize, Deserialize)]
78#[serde(rename_all = "PascalCase")]
79pub struct ClusterSummary {
80 /// The unique identifier for the cluster.
81 pub id: String,
82
83 /// The name of the cluster.
84 pub name: String,
85
86 /// The details about the current status of the cluster.
87 #[serde(skip_serializing_if = "Option::is_none")]
88 pub status: Option<Option<ClusterStatus>>,
89
90 /// An approximation of the cost of the cluster, represented in m1.small/hours. This value
91 /// is incremented one time for every hour an m1.small instance runs. Larger instances are
92 /// weighted more, so an Amazon EC2 instance that is roughly four times more expensive would
93 /// result in the normalized instance hours being incremented by four. This result is only
94 /// an approximation and does not reflect the actual billing rate.
95 #[serde(skip_serializing_if = "Option::is_none")]
96 pub normalized_instance_hours: Option<i32>,
97
98 /// The Amazon Resource Name of the cluster.
99 #[serde(skip_serializing_if = "Option::is_none")]
100 pub cluster_arn: Option<String>,
101
102 /// The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
103 #[serde(skip_serializing_if = "Option::is_none")]
104 pub outpost_arn: Option<String>,
105}
106
107impl ClusterSummary {
108 #[cfg(any(test, feature = "test-support"))]
109 /// Create a fixture instance for testing.
110 pub fn fixture() -> Self {
111 Self {
112 id: "test-id".into(),
113 name: "test-name".into(),
114 normalized_instance_hours: Some(100),
115 cluster_arn: Some("test-cluster_arn".into()),
116 outpost_arn: Some("test-outpost_arn".into()),
117 ..Default::default()
118 }
119 }
120}
121
122/// The detailed status of the cluster.
123///
124/// **AWS API**: `emr.v1.ClusterStatus`
125///
126/// ## Coverage
127/// 3 of 4 fields included.
128/// Omitted fields:
129/// - `ErrorDetails` — not selected in manifest
130#[derive(Debug, Clone, Default, Serialize, Deserialize)]
131#[serde(rename_all = "PascalCase")]
132pub struct ClusterStatus {
133 /// The current state of the cluster.
134 #[serde(skip_serializing_if = "Option::is_none")]
135 pub state: Option<String>,
136
137 /// The reason for the cluster status change.
138 #[serde(skip_serializing_if = "Option::is_none")]
139 pub state_change_reason: Option<Option<ClusterStateChangeReason>>,
140
141 /// A timeline that represents the status of a cluster over the lifetime of the cluster.
142 #[serde(skip_serializing_if = "Option::is_none")]
143 pub timeline: Option<Option<ClusterTimeline>>,
144}
145
146impl ClusterStatus {
147 #[cfg(any(test, feature = "test-support"))]
148 /// Create a fixture instance for testing.
149 pub fn fixture() -> Self {
150 Self {
151 state: Some("test-state".into()),
152 ..Default::default()
153 }
154 }
155}
156
157/// The reason that the cluster changed to its current state.
158///
159/// **AWS API**: `emr.v1.ClusterStateChangeReason`
160#[derive(Debug, Clone, Default, Serialize, Deserialize)]
161#[serde(rename_all = "PascalCase")]
162pub struct ClusterStateChangeReason {
163 /// The programmatic code for the state change reason.
164 #[serde(skip_serializing_if = "Option::is_none")]
165 pub code: Option<String>,
166
167 /// The descriptive message for the state change reason.
168 #[serde(skip_serializing_if = "Option::is_none")]
169 pub message: Option<String>,
170}
171
172impl ClusterStateChangeReason {
173 #[cfg(any(test, feature = "test-support"))]
174 /// Create a fixture instance for testing.
175 pub fn fixture() -> Self {
176 Self {
177 code: Some("test-code".into()),
178 message: Some("test-message".into()),
179 }
180 }
181}
182
183/// Represents the timeline of the cluster's lifecycle.
184///
185/// **AWS API**: `emr.v1.ClusterTimeline`
186#[derive(Debug, Clone, Default, Serialize, Deserialize)]
187#[serde(rename_all = "PascalCase")]
188pub struct ClusterTimeline {
189 /// The creation date and time of the cluster.
190 #[serde(skip_serializing_if = "Option::is_none")]
191 pub creation_date_time: Option<f64>,
192
193 /// The date and time when the cluster was ready to run steps.
194 #[serde(skip_serializing_if = "Option::is_none")]
195 pub ready_date_time: Option<f64>,
196
197 /// The date and time when the cluster was terminated.
198 #[serde(skip_serializing_if = "Option::is_none")]
199 pub end_date_time: Option<f64>,
200}
201
202impl ClusterTimeline {
203 #[cfg(any(test, feature = "test-support"))]
204 /// Create a fixture instance for testing.
205 pub fn fixture() -> Self {
206 Self {
207 ..Default::default()
208 }
209 }
210}
211
212/// This input determines which cluster to describe.
213///
214/// **AWS API**: `emr.v1.DescribeClusterInput`
215#[derive(Debug, Clone, Default, Serialize, Deserialize)]
216#[serde(rename_all = "PascalCase")]
217pub struct DescribeClusterInput {
218 /// The identifier of the cluster to describe.
219 pub cluster_id: String,
220}
221
222impl DescribeClusterInput {
223 #[cfg(any(test, feature = "test-support"))]
224 /// Create a fixture instance for testing.
225 pub fn fixture() -> Self {
226 Self {
227 cluster_id: "test-cluster_id".into(),
228 }
229 }
230}
231
232/// This output contains the description of the cluster.
233///
234/// **AWS API**: `emr.v1.DescribeClusterOutput`
235#[derive(Debug, Clone, Default, Serialize, Deserialize)]
236#[serde(rename_all = "PascalCase")]
237pub struct DescribeClusterOutput {
238 /// This output contains the details for the requested cluster.
239 #[serde(skip_serializing_if = "Option::is_none")]
240 pub cluster: Option<Option<Cluster>>,
241}
242
243impl DescribeClusterOutput {
244 #[cfg(any(test, feature = "test-support"))]
245 /// Create a fixture instance for testing.
246 pub fn fixture() -> Self {
247 Self {
248 ..Default::default()
249 }
250 }
251}
252
253/// The detailed description of the cluster.
254///
255/// **AWS API**: `emr.v1.Cluster`
256///
257/// ## Coverage
258/// 15 of 36 fields included.
259/// Omitted fields:
260/// - `InstanceCollectionType` — not selected in manifest
261/// - `LogEncryptionKmsKeyId` — not selected in manifest
262/// - `RequestedAmiVersion` — not selected in manifest
263/// - `RunningAmiVersion` — not selected in manifest
264/// - `UnhealthyNodeReplacement` — not selected in manifest
265/// - `Applications` — not selected in manifest
266/// - `Tags` — not selected in manifest
267/// - `Configurations` — not selected in manifest
268/// - `SecurityConfiguration` — not selected in manifest
269/// - `AutoScalingRole` — not selected in manifest
270/// - `ScaleDownBehavior` — not selected in manifest
271/// - `CustomAmiId` — not selected in manifest
272/// - `EbsRootVolumeSize` — not selected in manifest
273/// - `RepoUpgradeOnBoot` — not selected in manifest
274/// - `KerberosAttributes` — not selected in manifest
275/// - `PlacementGroups` — not selected in manifest
276/// - `OSReleaseLabel` — not selected in manifest
277/// - `EbsRootVolumeIops` — not selected in manifest
278/// - `EbsRootVolumeThroughput` — not selected in manifest
279/// - `ExtendedSupport` — not selected in manifest
280/// - `MonitoringConfiguration` — not selected in manifest
281#[derive(Debug, Clone, Default, Serialize, Deserialize)]
282#[serde(rename_all = "PascalCase")]
283pub struct Cluster {
284 /// The unique identifier for the cluster.
285 pub id: String,
286
287 /// The name of the cluster. This parameter can't contain the characters <, >, $, |,
288 /// or ` (backtick).
289 pub name: String,
290
291 /// The current status details about the cluster.
292 #[serde(skip_serializing_if = "Option::is_none")]
293 pub status: Option<Option<ClusterStatus>>,
294
295 /// Provides information about the Amazon EC2 instances in a cluster grouped by category.
296 /// For example, key name, subnet ID, IAM instance profile, and so on.
297 #[serde(skip_serializing_if = "Option::is_none")]
298 pub ec2_instance_attributes: Option<Option<Ec2InstanceAttributes>>,
299
300 /// The Amazon EMR release label, which determines the version of open-source application
301 /// packages installed on the cluster. Release labels are in the form emr-x.x.x, where x.x.x
302 /// is an Amazon EMR release version such as emr-5.14.0. For more information about Amazon
303 /// EMR release versions and included application versions and features, see
304 /// https://docs.aws.amazon.com/emr/latest/ReleaseGuide/. The release label applies only to
305 /// Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion.
306 #[serde(skip_serializing_if = "Option::is_none")]
307 pub release_label: Option<String>,
308
309 /// The path to the Amazon S3 location where logs for this cluster are stored.
310 #[serde(skip_serializing_if = "Option::is_none")]
311 pub log_uri: Option<String>,
312
313 /// Specifies whether the cluster should terminate after completing all steps.
314 #[serde(skip_serializing_if = "Option::is_none")]
315 pub auto_terminate: Option<bool>,
316
317 /// Indicates whether Amazon EMR will lock the cluster to prevent the Amazon EC2 instances
318 /// from being terminated by an API call or user intervention, or in the event of a cluster
319 /// error.
320 #[serde(skip_serializing_if = "Option::is_none")]
321 pub termination_protected: Option<bool>,
322
323 /// Indicates whether the cluster is visible to IAM principals in the Amazon Web Services
324 /// account associated with the cluster. When true, IAM principals in the Amazon Web
325 /// Services account can perform Amazon EMR cluster actions on the cluster that their IAM
326 /// policies allow. When false, only the IAM principal that created the cluster and the
327 /// Amazon Web Services account root user can perform Amazon EMR actions, regardless of IAM
328 /// permissions policies attached to other IAM principals. The default value is true if a
329 /// value is not provided when creating a cluster using the Amazon EMR API RunJobFlow
330 /// command, the CLI create-cluster command, or the Amazon Web Services Management Console.
331 #[serde(skip_serializing_if = "Option::is_none")]
332 pub visible_to_all_users: Option<bool>,
333
334 /// The IAM role that Amazon EMR assumes in order to access Amazon Web Services resources on
335 /// your behalf.
336 #[serde(skip_serializing_if = "Option::is_none")]
337 pub service_role: Option<String>,
338
339 /// An approximation of the cost of the cluster, represented in m1.small/hours. This value
340 /// is incremented one time for every hour an m1.small instance runs. Larger instances are
341 /// weighted more, so an Amazon EC2 instance that is roughly four times more expensive would
342 /// result in the normalized instance hours being incremented by four. This result is only
343 /// an approximation and does not reflect the actual billing rate.
344 #[serde(skip_serializing_if = "Option::is_none")]
345 pub normalized_instance_hours: Option<i32>,
346
347 /// The DNS name of the master node. If the cluster is on a private subnet, this is the
348 /// private DNS name. On a public subnet, this is the public DNS name.
349 #[serde(skip_serializing_if = "Option::is_none")]
350 pub master_public_dns_name: Option<String>,
351
352 /// The Amazon Resource Name of the cluster.
353 #[serde(skip_serializing_if = "Option::is_none")]
354 pub cluster_arn: Option<String>,
355
356 /// The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
357 #[serde(skip_serializing_if = "Option::is_none")]
358 pub outpost_arn: Option<String>,
359
360 /// Specifies the number of steps that can be executed concurrently.
361 #[serde(skip_serializing_if = "Option::is_none")]
362 pub step_concurrency_level: Option<i32>,
363}
364
365impl Cluster {
366 #[cfg(any(test, feature = "test-support"))]
367 /// Create a fixture instance for testing.
368 pub fn fixture() -> Self {
369 Self {
370 id: "test-id".into(),
371 name: "test-name".into(),
372 release_label: Some("test-release_label".into()),
373 log_uri: Some("test-log_uri".into()),
374 auto_terminate: Some(false),
375 termination_protected: Some(false),
376 visible_to_all_users: Some(false),
377 service_role: Some("test-service_role".into()),
378 normalized_instance_hours: Some(100),
379 master_public_dns_name: Some("test-master_public_dns_name".into()),
380 cluster_arn: Some("test-cluster_arn".into()),
381 outpost_arn: Some("test-outpost_arn".into()),
382 step_concurrency_level: Some(100),
383 ..Default::default()
384 }
385 }
386}
387
388/// Provides information about the Amazon EC2 instances in a cluster grouped by category. For
389/// example, key name, subnet ID, IAM instance profile, and so on.
390///
391/// **AWS API**: `emr.v1.Ec2InstanceAttributes`
392///
393/// ## Coverage
394/// 6 of 11 fields included.
395/// Omitted fields:
396/// - `RequestedEc2SubnetIds` — not selected in manifest
397/// - `RequestedEc2AvailabilityZones` — not selected in manifest
398/// - `ServiceAccessSecurityGroup` — not selected in manifest
399/// - `AdditionalMasterSecurityGroups` — not selected in manifest
400/// - `AdditionalSlaveSecurityGroups` — not selected in manifest
401#[derive(Debug, Clone, Default, Serialize, Deserialize)]
402#[serde(rename_all = "PascalCase")]
403pub struct Ec2InstanceAttributes {
404 /// The name of the Amazon EC2 key pair to use when connecting with SSH into the master node
405 /// as a user named "hadoop".
406 #[serde(skip_serializing_if = "Option::is_none")]
407 pub ec2_key_name: Option<String>,
408
409 /// Set this parameter to the identifier of the Amazon VPC subnet where you want the cluster
410 /// to launch. If you do not specify this value, and your account supports EC2-Classic, the
411 /// cluster launches in EC2-Classic.
412 #[serde(skip_serializing_if = "Option::is_none")]
413 pub ec2_subnet_id: Option<String>,
414
415 /// The Availability Zone in which the cluster will run.
416 #[serde(skip_serializing_if = "Option::is_none")]
417 pub ec2_availability_zone: Option<String>,
418
419 /// The IAM role that was specified when the cluster was launched. The Amazon EC2 instances
420 /// of the cluster assume this role.
421 #[serde(skip_serializing_if = "Option::is_none")]
422 pub iam_instance_profile: Option<String>,
423
424 /// The identifier of the Amazon EC2 security group for the master node.
425 #[serde(skip_serializing_if = "Option::is_none")]
426 pub emr_managed_master_security_group: Option<String>,
427
428 /// The identifier of the Amazon EC2 security group for the core and task nodes.
429 #[serde(skip_serializing_if = "Option::is_none")]
430 pub emr_managed_slave_security_group: Option<String>,
431}
432
433impl Ec2InstanceAttributes {
434 #[cfg(any(test, feature = "test-support"))]
435 /// Create a fixture instance for testing.
436 pub fn fixture() -> Self {
437 Self {
438 ec2_key_name: Some("test-ec2_key_name".into()),
439 ec2_subnet_id: Some("test-ec2_subnet_id".into()),
440 ec2_availability_zone: Some("test-ec2_availability_zone".into()),
441 iam_instance_profile: Some("test-iam_instance_profile".into()),
442 emr_managed_master_security_group: Some(
443 "test-emr_managed_master_security_group".into(),
444 ),
445 emr_managed_slave_security_group: Some("test-emr_managed_slave_security_group".into()),
446 }
447 }
448}
449
450/// Input to the TerminateJobFlows operation.
451///
452/// **AWS API**: `emr.v1.TerminateJobFlowsInput`
453#[derive(Debug, Clone, Default, Serialize, Deserialize)]
454#[serde(rename_all = "PascalCase")]
455pub struct TerminateJobFlowsInput {
456 /// A list of job flows to be shut down.
457 #[serde(default)]
458 pub job_flow_ids: Vec<String>,
459}
460
461impl TerminateJobFlowsInput {
462 #[cfg(any(test, feature = "test-support"))]
463 /// Create a fixture instance for testing.
464 pub fn fixture() -> Self {
465 Self {
466 job_flow_ids: vec![],
467 }
468 }
469}