aws_sdk_pcs/operation/create_cluster/
_create_cluster_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateClusterInput {
6    /// <p>A name to identify the cluster. Example: <code>MyCluster</code></p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <p>The cluster management and job scheduling software associated with the cluster.</p>
9    pub scheduler: ::std::option::Option<crate::types::SchedulerRequest>,
10    /// <p>A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).</p>
11    /// <ul>
12    /// <li>
13    /// <p><code>SMALL</code>: 32 compute nodes and 256 jobs</p></li>
14    /// <li>
15    /// <p><code>MEDIUM</code>: 512 compute nodes and 8192 jobs</p></li>
16    /// <li>
17    /// <p><code>LARGE</code>: 2048 compute nodes and 16,384 jobs</p></li>
18    /// </ul>
19    pub size: ::std::option::Option<crate::types::Size>,
20    /// <p>The networking configuration used to set up the cluster's control plane.</p>
21    pub networking: ::std::option::Option<crate::types::NetworkingRequest>,
22    /// <p>Additional options related to the Slurm scheduler.</p>
23    pub slurm_configuration: ::std::option::Option<crate::types::ClusterSlurmConfigurationRequest>,
24    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
25    pub client_token: ::std::option::Option<::std::string::String>,
26    /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
27    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28}
29impl CreateClusterInput {
30    /// <p>A name to identify the cluster. Example: <code>MyCluster</code></p>
31    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
32        self.cluster_name.as_deref()
33    }
34    /// <p>The cluster management and job scheduling software associated with the cluster.</p>
35    pub fn scheduler(&self) -> ::std::option::Option<&crate::types::SchedulerRequest> {
36        self.scheduler.as_ref()
37    }
38    /// <p>A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).</p>
39    /// <ul>
40    /// <li>
41    /// <p><code>SMALL</code>: 32 compute nodes and 256 jobs</p></li>
42    /// <li>
43    /// <p><code>MEDIUM</code>: 512 compute nodes and 8192 jobs</p></li>
44    /// <li>
45    /// <p><code>LARGE</code>: 2048 compute nodes and 16,384 jobs</p></li>
46    /// </ul>
47    pub fn size(&self) -> ::std::option::Option<&crate::types::Size> {
48        self.size.as_ref()
49    }
50    /// <p>The networking configuration used to set up the cluster's control plane.</p>
51    pub fn networking(&self) -> ::std::option::Option<&crate::types::NetworkingRequest> {
52        self.networking.as_ref()
53    }
54    /// <p>Additional options related to the Slurm scheduler.</p>
55    pub fn slurm_configuration(&self) -> ::std::option::Option<&crate::types::ClusterSlurmConfigurationRequest> {
56        self.slurm_configuration.as_ref()
57    }
58    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
59    pub fn client_token(&self) -> ::std::option::Option<&str> {
60        self.client_token.as_deref()
61    }
62    /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
63    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
64        self.tags.as_ref()
65    }
66}
67impl CreateClusterInput {
68    /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
69    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
70        crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
71    }
72}
73
74/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct CreateClusterInputBuilder {
78    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
79    pub(crate) scheduler: ::std::option::Option<crate::types::SchedulerRequest>,
80    pub(crate) size: ::std::option::Option<crate::types::Size>,
81    pub(crate) networking: ::std::option::Option<crate::types::NetworkingRequest>,
82    pub(crate) slurm_configuration: ::std::option::Option<crate::types::ClusterSlurmConfigurationRequest>,
83    pub(crate) client_token: ::std::option::Option<::std::string::String>,
84    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
85}
86impl CreateClusterInputBuilder {
87    /// <p>A name to identify the cluster. Example: <code>MyCluster</code></p>
88    /// This field is required.
89    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.cluster_name = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>A name to identify the cluster. Example: <code>MyCluster</code></p>
94    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.cluster_name = input;
96        self
97    }
98    /// <p>A name to identify the cluster. Example: <code>MyCluster</code></p>
99    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
100        &self.cluster_name
101    }
102    /// <p>The cluster management and job scheduling software associated with the cluster.</p>
103    /// This field is required.
104    pub fn scheduler(mut self, input: crate::types::SchedulerRequest) -> Self {
105        self.scheduler = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The cluster management and job scheduling software associated with the cluster.</p>
109    pub fn set_scheduler(mut self, input: ::std::option::Option<crate::types::SchedulerRequest>) -> Self {
110        self.scheduler = input;
111        self
112    }
113    /// <p>The cluster management and job scheduling software associated with the cluster.</p>
114    pub fn get_scheduler(&self) -> &::std::option::Option<crate::types::SchedulerRequest> {
115        &self.scheduler
116    }
117    /// <p>A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).</p>
118    /// <ul>
119    /// <li>
120    /// <p><code>SMALL</code>: 32 compute nodes and 256 jobs</p></li>
121    /// <li>
122    /// <p><code>MEDIUM</code>: 512 compute nodes and 8192 jobs</p></li>
123    /// <li>
124    /// <p><code>LARGE</code>: 2048 compute nodes and 16,384 jobs</p></li>
125    /// </ul>
126    /// This field is required.
127    pub fn size(mut self, input: crate::types::Size) -> Self {
128        self.size = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).</p>
132    /// <ul>
133    /// <li>
134    /// <p><code>SMALL</code>: 32 compute nodes and 256 jobs</p></li>
135    /// <li>
136    /// <p><code>MEDIUM</code>: 512 compute nodes and 8192 jobs</p></li>
137    /// <li>
138    /// <p><code>LARGE</code>: 2048 compute nodes and 16,384 jobs</p></li>
139    /// </ul>
140    pub fn set_size(mut self, input: ::std::option::Option<crate::types::Size>) -> Self {
141        self.size = input;
142        self
143    }
144    /// <p>A value that determines the maximum number of compute nodes in the cluster and the maximum number of jobs (active and queued).</p>
145    /// <ul>
146    /// <li>
147    /// <p><code>SMALL</code>: 32 compute nodes and 256 jobs</p></li>
148    /// <li>
149    /// <p><code>MEDIUM</code>: 512 compute nodes and 8192 jobs</p></li>
150    /// <li>
151    /// <p><code>LARGE</code>: 2048 compute nodes and 16,384 jobs</p></li>
152    /// </ul>
153    pub fn get_size(&self) -> &::std::option::Option<crate::types::Size> {
154        &self.size
155    }
156    /// <p>The networking configuration used to set up the cluster's control plane.</p>
157    /// This field is required.
158    pub fn networking(mut self, input: crate::types::NetworkingRequest) -> Self {
159        self.networking = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The networking configuration used to set up the cluster's control plane.</p>
163    pub fn set_networking(mut self, input: ::std::option::Option<crate::types::NetworkingRequest>) -> Self {
164        self.networking = input;
165        self
166    }
167    /// <p>The networking configuration used to set up the cluster's control plane.</p>
168    pub fn get_networking(&self) -> &::std::option::Option<crate::types::NetworkingRequest> {
169        &self.networking
170    }
171    /// <p>Additional options related to the Slurm scheduler.</p>
172    pub fn slurm_configuration(mut self, input: crate::types::ClusterSlurmConfigurationRequest) -> Self {
173        self.slurm_configuration = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>Additional options related to the Slurm scheduler.</p>
177    pub fn set_slurm_configuration(mut self, input: ::std::option::Option<crate::types::ClusterSlurmConfigurationRequest>) -> Self {
178        self.slurm_configuration = input;
179        self
180    }
181    /// <p>Additional options related to the Slurm scheduler.</p>
182    pub fn get_slurm_configuration(&self) -> &::std::option::Option<crate::types::ClusterSlurmConfigurationRequest> {
183        &self.slurm_configuration
184    }
185    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
186    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.client_token = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
191    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.client_token = input;
193        self
194    }
195    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate 1 for you.</p>
196    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
197        &self.client_token
198    }
199    /// Adds a key-value pair to `tags`.
200    ///
201    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
202    ///
203    /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
204    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
205        let mut hash_map = self.tags.unwrap_or_default();
206        hash_map.insert(k.into(), v.into());
207        self.tags = ::std::option::Option::Some(hash_map);
208        self
209    }
210    /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
211    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
212        self.tags = input;
213        self
214    }
215    /// <p>1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.</p>
216    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
217        &self.tags
218    }
219    /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
220    pub fn build(
221        self,
222    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
223        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
224            cluster_name: self.cluster_name,
225            scheduler: self.scheduler,
226            size: self.size,
227            networking: self.networking,
228            slurm_configuration: self.slurm_configuration,
229            client_token: self.client_token,
230            tags: self.tags,
231        })
232    }
233}