aws_sdk_ec2/operation/describe_volume_status/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_volume_status::_describe_volume_status_output::DescribeVolumeStatusOutputBuilder;
3
4pub use crate::operation::describe_volume_status::_describe_volume_status_input::DescribeVolumeStatusInputBuilder;
5
6impl crate::operation::describe_volume_status::builders::DescribeVolumeStatusInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::describe_volume_status::DescribeVolumeStatusOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_volume_status::DescribeVolumeStatusError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_volume_status();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeVolumeStatus`.
24///
25/// <p>Describes the status of the specified volumes. Volume status provides the result of the checks performed on your volumes to determine events that can impair the performance of your volumes. The performance of a volume can be affected if an issue occurs on the volume's underlying host. If the volume's underlying host experiences a power outage or system issue, after the system is restored, there could be data inconsistencies on the volume. Volume events notify you if this occurs. Volume actions notify you if any action needs to be taken in response to the event.</p>
26/// <p>The <code>DescribeVolumeStatus</code> operation provides the following information about the specified volumes:</p>
27/// <p><i>Status</i>: Reflects the current status of the volume. The possible values are <code>ok</code>, <code>impaired</code> , <code>warning</code>, or <code>insufficient-data</code>. If all checks pass, the overall status of the volume is <code>ok</code>. If the check fails, the overall status is <code>impaired</code>. If the status is <code>insufficient-data</code>, then the checks might still be taking place on your volume at the time. We recommend that you retry the request. For more information about volume status, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/monitoring-volume-status.html">Monitor the status of your volumes</a> in the <i>Amazon EBS User Guide</i>.</p>
28/// <p><i>Events</i>: Reflect the cause of a volume status and might require you to take action. For example, if your volume returns an <code>impaired</code> status, then the volume event might be <code>potential-data-inconsistency</code>. This means that your volume has been affected by an issue with the underlying host, has all I/O operations disabled, and might have inconsistent data.</p>
29/// <p><i>Actions</i>: Reflect the actions you might have to take in response to an event. For example, if the status of the volume is <code>impaired</code> and the volume event shows <code>potential-data-inconsistency</code>, then the action shows <code>enable-volume-io</code>. This means that you may want to enable the I/O operations for the volume by calling the <code>EnableVolumeIO</code> action and then check the volume for data consistency.</p>
30/// <p>Volume status is based on the volume status checks, and does not reflect the volume state. Therefore, volume status does not indicate volumes in the <code>error</code> state (for example, when a volume is incapable of accepting I/O.)</p><note>
31/// <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p>
32/// </note>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct DescribeVolumeStatusFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::describe_volume_status::builders::DescribeVolumeStatusInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40 crate::client::customize::internal::CustomizableSend<
41 crate::operation::describe_volume_status::DescribeVolumeStatusOutput,
42 crate::operation::describe_volume_status::DescribeVolumeStatusError,
43 > for DescribeVolumeStatusFluentBuilder
44{
45 fn send(
46 self,
47 config_override: crate::config::Builder,
48 ) -> crate::client::customize::internal::BoxFuture<
49 crate::client::customize::internal::SendResult<
50 crate::operation::describe_volume_status::DescribeVolumeStatusOutput,
51 crate::operation::describe_volume_status::DescribeVolumeStatusError,
52 >,
53 > {
54 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55 }
56}
57impl DescribeVolumeStatusFluentBuilder {
58 /// Creates a new `DescribeVolumeStatusFluentBuilder`.
59 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60 Self {
61 handle,
62 inner: ::std::default::Default::default(),
63 config_override: ::std::option::Option::None,
64 }
65 }
66 /// Access the DescribeVolumeStatus as a reference.
67 pub fn as_input(&self) -> &crate::operation::describe_volume_status::builders::DescribeVolumeStatusInputBuilder {
68 &self.inner
69 }
70 /// Sends the request and returns the response.
71 ///
72 /// If an error occurs, an `SdkError` will be returned with additional details that
73 /// can be matched against.
74 ///
75 /// By default, any retryable failures will be retried twice. Retry behavior
76 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77 /// set when configuring the client.
78 pub async fn send(
79 self,
80 ) -> ::std::result::Result<
81 crate::operation::describe_volume_status::DescribeVolumeStatusOutput,
82 ::aws_smithy_runtime_api::client::result::SdkError<
83 crate::operation::describe_volume_status::DescribeVolumeStatusError,
84 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85 >,
86 > {
87 let input = self
88 .inner
89 .build()
90 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91 let runtime_plugins = crate::operation::describe_volume_status::DescribeVolumeStatus::operation_runtime_plugins(
92 self.handle.runtime_plugins.clone(),
93 &self.handle.conf,
94 self.config_override,
95 );
96 crate::operation::describe_volume_status::DescribeVolumeStatus::orchestrate(&runtime_plugins, input).await
97 }
98
99 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100 pub fn customize(
101 self,
102 ) -> crate::client::customize::CustomizableOperation<
103 crate::operation::describe_volume_status::DescribeVolumeStatusOutput,
104 crate::operation::describe_volume_status::DescribeVolumeStatusError,
105 Self,
106 > {
107 crate::client::customize::CustomizableOperation::new(self)
108 }
109 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110 self.set_config_override(::std::option::Option::Some(config_override.into()));
111 self
112 }
113
114 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115 self.config_override = config_override;
116 self
117 }
118 /// Create a paginator for this request
119 ///
120 /// Paginators are used by calling [`send().await`](crate::operation::describe_volume_status::paginator::DescribeVolumeStatusPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
121 pub fn into_paginator(self) -> crate::operation::describe_volume_status::paginator::DescribeVolumeStatusPaginator {
122 crate::operation::describe_volume_status::paginator::DescribeVolumeStatusPaginator::new(self.handle, self.inner)
123 }
124 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
125 pub fn max_results(mut self, input: i32) -> Self {
126 self.inner = self.inner.max_results(input);
127 self
128 }
129 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
130 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
131 self.inner = self.inner.set_max_results(input);
132 self
133 }
134 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
135 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
136 self.inner.get_max_results()
137 }
138 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
139 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.inner = self.inner.next_token(input.into());
141 self
142 }
143 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
144 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.inner = self.inner.set_next_token(input);
146 self
147 }
148 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
149 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
150 self.inner.get_next_token()
151 }
152 ///
153 /// Appends an item to `VolumeIds`.
154 ///
155 /// To override the contents of this collection use [`set_volume_ids`](Self::set_volume_ids).
156 ///
157 /// <p>The IDs of the volumes.</p>
158 /// <p>Default: Describes all your volumes.</p>
159 pub fn volume_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.inner = self.inner.volume_ids(input.into());
161 self
162 }
163 /// <p>The IDs of the volumes.</p>
164 /// <p>Default: Describes all your volumes.</p>
165 pub fn set_volume_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
166 self.inner = self.inner.set_volume_ids(input);
167 self
168 }
169 /// <p>The IDs of the volumes.</p>
170 /// <p>Default: Describes all your volumes.</p>
171 pub fn get_volume_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
172 self.inner.get_volume_ids()
173 }
174 /// <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>
175 pub fn dry_run(mut self, input: bool) -> Self {
176 self.inner = self.inner.dry_run(input);
177 self
178 }
179 /// <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>
180 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
181 self.inner = self.inner.set_dry_run(input);
182 self
183 }
184 /// <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>
185 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
186 self.inner.get_dry_run()
187 }
188 ///
189 /// Appends an item to `Filters`.
190 ///
191 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
192 ///
193 /// <p>The filters.</p>
194 /// <ul>
195 /// <li>
196 /// <p><code>action.code</code> - The action code for the event (for example, <code>enable-volume-io</code>).</p></li>
197 /// <li>
198 /// <p><code>action.description</code> - A description of the action.</p></li>
199 /// <li>
200 /// <p><code>action.event-id</code> - The event ID associated with the action.</p></li>
201 /// <li>
202 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
203 /// <li>
204 /// <p><code>event.description</code> - A description of the event.</p></li>
205 /// <li>
206 /// <p><code>event.event-id</code> - The event ID.</p></li>
207 /// <li>
208 /// <p><code>event.event-type</code> - The event type (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>io-performance:degraded</code> | <code>io-performance:severely-degraded</code> | <code>io-performance:stalled</code>).</p></li>
209 /// <li>
210 /// <p><code>event.not-after</code> - The latest end time for the event.</p></li>
211 /// <li>
212 /// <p><code>event.not-before</code> - The earliest start time for the event.</p></li>
213 /// <li>
214 /// <p><code>volume-status.details-name</code> - The cause for <code>volume-status.status</code> (<code>io-enabled</code> | <code>io-performance</code>).</p></li>
215 /// <li>
216 /// <p><code>volume-status.details-status</code> - The status of <code>volume-status.details-name</code> (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>normal</code> | <code>degraded</code> | <code>severely-degraded</code> | <code>stalled</code>).</p></li>
217 /// <li>
218 /// <p><code>volume-status.status</code> - The status of the volume (<code>ok</code> | <code>impaired</code> | <code>warning</code> | <code>insufficient-data</code>).</p></li>
219 /// </ul>
220 pub fn filters(mut self, input: crate::types::Filter) -> Self {
221 self.inner = self.inner.filters(input);
222 self
223 }
224 /// <p>The filters.</p>
225 /// <ul>
226 /// <li>
227 /// <p><code>action.code</code> - The action code for the event (for example, <code>enable-volume-io</code>).</p></li>
228 /// <li>
229 /// <p><code>action.description</code> - A description of the action.</p></li>
230 /// <li>
231 /// <p><code>action.event-id</code> - The event ID associated with the action.</p></li>
232 /// <li>
233 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
234 /// <li>
235 /// <p><code>event.description</code> - A description of the event.</p></li>
236 /// <li>
237 /// <p><code>event.event-id</code> - The event ID.</p></li>
238 /// <li>
239 /// <p><code>event.event-type</code> - The event type (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>io-performance:degraded</code> | <code>io-performance:severely-degraded</code> | <code>io-performance:stalled</code>).</p></li>
240 /// <li>
241 /// <p><code>event.not-after</code> - The latest end time for the event.</p></li>
242 /// <li>
243 /// <p><code>event.not-before</code> - The earliest start time for the event.</p></li>
244 /// <li>
245 /// <p><code>volume-status.details-name</code> - The cause for <code>volume-status.status</code> (<code>io-enabled</code> | <code>io-performance</code>).</p></li>
246 /// <li>
247 /// <p><code>volume-status.details-status</code> - The status of <code>volume-status.details-name</code> (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>normal</code> | <code>degraded</code> | <code>severely-degraded</code> | <code>stalled</code>).</p></li>
248 /// <li>
249 /// <p><code>volume-status.status</code> - The status of the volume (<code>ok</code> | <code>impaired</code> | <code>warning</code> | <code>insufficient-data</code>).</p></li>
250 /// </ul>
251 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
252 self.inner = self.inner.set_filters(input);
253 self
254 }
255 /// <p>The filters.</p>
256 /// <ul>
257 /// <li>
258 /// <p><code>action.code</code> - The action code for the event (for example, <code>enable-volume-io</code>).</p></li>
259 /// <li>
260 /// <p><code>action.description</code> - A description of the action.</p></li>
261 /// <li>
262 /// <p><code>action.event-id</code> - The event ID associated with the action.</p></li>
263 /// <li>
264 /// <p><code>availability-zone</code> - The Availability Zone of the instance.</p></li>
265 /// <li>
266 /// <p><code>event.description</code> - A description of the event.</p></li>
267 /// <li>
268 /// <p><code>event.event-id</code> - The event ID.</p></li>
269 /// <li>
270 /// <p><code>event.event-type</code> - The event type (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>io-performance:degraded</code> | <code>io-performance:severely-degraded</code> | <code>io-performance:stalled</code>).</p></li>
271 /// <li>
272 /// <p><code>event.not-after</code> - The latest end time for the event.</p></li>
273 /// <li>
274 /// <p><code>event.not-before</code> - The earliest start time for the event.</p></li>
275 /// <li>
276 /// <p><code>volume-status.details-name</code> - The cause for <code>volume-status.status</code> (<code>io-enabled</code> | <code>io-performance</code>).</p></li>
277 /// <li>
278 /// <p><code>volume-status.details-status</code> - The status of <code>volume-status.details-name</code> (for <code>io-enabled</code>: <code>passed</code> | <code>failed</code>; for <code>io-performance</code>: <code>normal</code> | <code>degraded</code> | <code>severely-degraded</code> | <code>stalled</code>).</p></li>
279 /// <li>
280 /// <p><code>volume-status.status</code> - The status of the volume (<code>ok</code> | <code>impaired</code> | <code>warning</code> | <code>insufficient-data</code>).</p></li>
281 /// </ul>
282 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
283 self.inner.get_filters()
284 }
285}