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