aws_sdk_ec2/operation/modify_volume/_modify_volume_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 ModifyVolumeInput {
6 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
7 pub dry_run: ::std::option::Option<bool>,
8 /// <p>The ID of the volume.</p>
9 pub volume_id: ::std::option::Option<::std::string::String>,
10 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
11 /// <p>The following are the supported volumes sizes for each volume type:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
15 /// <li>
16 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
17 /// <li>
18 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
19 /// <li>
20 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
21 /// <li>
22 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
23 /// </ul>
24 /// <p>Default: The existing size is retained.</p>
25 pub size: ::std::option::Option<i32>,
26 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
27 /// <p>Default: The existing type is retained.</p>
28 pub volume_type: ::std::option::Option<crate::types::VolumeType>,
29 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
30 /// <p>The following are the supported values for each volume type:</p>
31 /// <ul>
32 /// <li>
33 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
34 /// <li>
35 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
36 /// <li>
37 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
38 /// </ul>
39 /// <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p>
40 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
41 pub iops: ::std::option::Option<i32>,
42 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 1,000.</p>
43 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
44 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
45 pub throughput: ::std::option::Option<i32>,
46 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
47 pub multi_attach_enabled: ::std::option::Option<bool>,
48}
49impl ModifyVolumeInput {
50 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
51 pub fn dry_run(&self) -> ::std::option::Option<bool> {
52 self.dry_run
53 }
54 /// <p>The ID of the volume.</p>
55 pub fn volume_id(&self) -> ::std::option::Option<&str> {
56 self.volume_id.as_deref()
57 }
58 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
59 /// <p>The following are the supported volumes sizes for each volume type:</p>
60 /// <ul>
61 /// <li>
62 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
63 /// <li>
64 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
65 /// <li>
66 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
67 /// <li>
68 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
69 /// <li>
70 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
71 /// </ul>
72 /// <p>Default: The existing size is retained.</p>
73 pub fn size(&self) -> ::std::option::Option<i32> {
74 self.size
75 }
76 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
77 /// <p>Default: The existing type is retained.</p>
78 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
79 self.volume_type.as_ref()
80 }
81 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
82 /// <p>The following are the supported values for each volume type:</p>
83 /// <ul>
84 /// <li>
85 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
86 /// <li>
87 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
88 /// <li>
89 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
90 /// </ul>
91 /// <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p>
92 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
93 pub fn iops(&self) -> ::std::option::Option<i32> {
94 self.iops
95 }
96 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 1,000.</p>
97 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
98 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
99 pub fn throughput(&self) -> ::std::option::Option<i32> {
100 self.throughput
101 }
102 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
103 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
104 self.multi_attach_enabled
105 }
106}
107impl ModifyVolumeInput {
108 /// Creates a new builder-style object to manufacture [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
109 pub fn builder() -> crate::operation::modify_volume::builders::ModifyVolumeInputBuilder {
110 crate::operation::modify_volume::builders::ModifyVolumeInputBuilder::default()
111 }
112}
113
114/// A builder for [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
116#[non_exhaustive]
117pub struct ModifyVolumeInputBuilder {
118 pub(crate) dry_run: ::std::option::Option<bool>,
119 pub(crate) volume_id: ::std::option::Option<::std::string::String>,
120 pub(crate) size: ::std::option::Option<i32>,
121 pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
122 pub(crate) iops: ::std::option::Option<i32>,
123 pub(crate) throughput: ::std::option::Option<i32>,
124 pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
125}
126impl ModifyVolumeInputBuilder {
127 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
128 pub fn dry_run(mut self, input: bool) -> Self {
129 self.dry_run = ::std::option::Option::Some(input);
130 self
131 }
132 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
133 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
134 self.dry_run = input;
135 self
136 }
137 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
138 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
139 &self.dry_run
140 }
141 /// <p>The ID of the volume.</p>
142 /// This field is required.
143 pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.volume_id = ::std::option::Option::Some(input.into());
145 self
146 }
147 /// <p>The ID of the volume.</p>
148 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.volume_id = input;
150 self
151 }
152 /// <p>The ID of the volume.</p>
153 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
154 &self.volume_id
155 }
156 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
157 /// <p>The following are the supported volumes sizes for each volume type:</p>
158 /// <ul>
159 /// <li>
160 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
161 /// <li>
162 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
163 /// <li>
164 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
165 /// <li>
166 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
167 /// <li>
168 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
169 /// </ul>
170 /// <p>Default: The existing size is retained.</p>
171 pub fn size(mut self, input: i32) -> Self {
172 self.size = ::std::option::Option::Some(input);
173 self
174 }
175 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
176 /// <p>The following are the supported volumes sizes for each volume type:</p>
177 /// <ul>
178 /// <li>
179 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
180 /// <li>
181 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
182 /// <li>
183 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
184 /// <li>
185 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
186 /// <li>
187 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
188 /// </ul>
189 /// <p>Default: The existing size is retained.</p>
190 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
191 self.size = input;
192 self
193 }
194 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
195 /// <p>The following are the supported volumes sizes for each volume type:</p>
196 /// <ul>
197 /// <li>
198 /// <p><code>gp2</code> and <code>gp3</code>: 1 - 16,384 GiB</p></li>
199 /// <li>
200 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
201 /// <li>
202 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
203 /// <li>
204 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
205 /// <li>
206 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
207 /// </ul>
208 /// <p>Default: The existing size is retained.</p>
209 pub fn get_size(&self) -> &::std::option::Option<i32> {
210 &self.size
211 }
212 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
213 /// <p>Default: The existing type is retained.</p>
214 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
215 self.volume_type = ::std::option::Option::Some(input);
216 self
217 }
218 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
219 /// <p>Default: The existing type is retained.</p>
220 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
221 self.volume_type = input;
222 self
223 }
224 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
225 /// <p>Default: The existing type is retained.</p>
226 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
227 &self.volume_type
228 }
229 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
230 /// <p>The following are the supported values for each volume type:</p>
231 /// <ul>
232 /// <li>
233 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
234 /// <li>
235 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
236 /// <li>
237 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
238 /// </ul>
239 /// <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p>
240 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
241 pub fn iops(mut self, input: i32) -> Self {
242 self.iops = ::std::option::Option::Some(input);
243 self
244 }
245 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
246 /// <p>The following are the supported values for each volume type:</p>
247 /// <ul>
248 /// <li>
249 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
250 /// <li>
251 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
252 /// <li>
253 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
254 /// </ul>
255 /// <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p>
256 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
257 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
258 self.iops = input;
259 self
260 }
261 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
262 /// <p>The following are the supported values for each volume type:</p>
263 /// <ul>
264 /// <li>
265 /// <p><code>gp3</code>: 3,000 - 16,000 IOPS</p></li>
266 /// <li>
267 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
268 /// <li>
269 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
270 /// </ul>
271 /// <p>For <code>io2</code> volumes, you can achieve up to 256,000 IOPS on <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">instances built on the Nitro System</a>. On other instances, you can achieve performance up to 32,000 IOPS.</p>
272 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
273 pub fn get_iops(&self) -> &::std::option::Option<i32> {
274 &self.iops
275 }
276 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 1,000.</p>
277 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
278 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
279 pub fn throughput(mut self, input: i32) -> Self {
280 self.throughput = ::std::option::Option::Some(input);
281 self
282 }
283 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 1,000.</p>
284 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
285 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
286 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
287 self.throughput = input;
288 self
289 }
290 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 1,000.</p>
291 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
292 /// <p>Valid Range: Minimum value of 125. Maximum value of 1000.</p>
293 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
294 &self.throughput
295 }
296 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
297 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
298 self.multi_attach_enabled = ::std::option::Option::Some(input);
299 self
300 }
301 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
302 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
303 self.multi_attach_enabled = input;
304 self
305 }
306 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
307 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
308 &self.multi_attach_enabled
309 }
310 /// Consumes the builder and constructs a [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
311 pub fn build(
312 self,
313 ) -> ::std::result::Result<crate::operation::modify_volume::ModifyVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
314 ::std::result::Result::Ok(crate::operation::modify_volume::ModifyVolumeInput {
315 dry_run: self.dry_run,
316 volume_id: self.volume_id,
317 size: self.size,
318 volume_type: self.volume_type,
319 iops: self.iops,
320 throughput: self.throughput,
321 multi_attach_enabled: self.multi_attach_enabled,
322 })
323 }
324}